Alright well I am flummoxed. I've gone over this trigger again and again even rewriting it from scratch once and it just refuses to work.
It produces this error:
Quote:
Parameter out of bounds in
'sUnitCreate' (value: 16, min: 0, max: 15)
Trigger Error in 'gt_Respawn_Func':
e_arrayIndexUnderflow
And I cannot figure out why. Here's the trigger:
RespawnEventsUnit-AnyUnitdiesLocalVariablesSpawnEffect=NoActor<Actor>Conditions(Ownerof(Triggeringunit))<15(Ownerof(Triggeringunit))>0ActionsCamera-Lockcamerainputforplayer(Ownerof(Triggeringunit))UI-Display((Nameofplayer(Ownerof(Triggeringunit)))+" has fallen!")for(Allplayers)toSubtitleareaGeneral-Wait2.0GameTimesecondsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)IfTeamGame==trueThenGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If((Triggeringunit)isinBlueTeam)==trueThenUnit-Create1PlayerCharacterType[(Ownerof(Triggeringunit))] for player (Owner of (Triggering unit)) at CharacterSpawn[(Randomintegerbetween0and1)] facing (Center of GameType) (No Options)
Variable - Set PlayerCharacter[(Ownerof(Triggeringunit))] = (Last created unit)
Unit - Set PlayerCharacter[(Ownerof(Triggeringunit))] team color to PlayerCharacterColor[(Ownerof(Triggeringunit))]
Else
Unit - Create 1 PlayerCharacterType[(Ownerof(Triggeringunit))] for player (Owner of (Triggering unit)) at CharacterSpawn[(Randomintegerbetween2and3)] facing (Center of GameType) (No Options)
Variable - Set PlayerCharacter[(Ownerof(Triggeringunit))] = (Last created unit)
Unit - Set PlayerCharacter[(Ownerof(Triggeringunit))] team color to PlayerCharacterColor[(Ownerof(Triggeringunit))]
Else
Unit - Create 1 PlayerCharacterType[(Ownerof(Triggeringunit))] for player (Owner of (Triggering unit)) at CharacterSpawn[(Randomintegerbetween0and3)] facing (Center of GameType) (No Options)
Variable - Set PlayerCharacter[(Ownerof(Triggeringunit))] = (Last created unit)
Unit - Set PlayerCharacter[(Ownerof(Triggeringunit))] team color to PlayerCharacterColor[(Ownerof(Triggeringunit))]
Unit - Turn PlayerCharacter[(Ownerof(Triggeringunit))] Highlightable state Off
Unit - Turn PlayerCharacter[(Ownerof(Triggeringunit))] Status Bar state Off
Actor - Create actor TimeWarpLaunch (Unnamed) at point (Position of PlayerCharacter[(Triggeringplayer)])
Variable - Set SpawnEffect = (Last created actor)
Camera - Apply camera object Rotation (Facing of PlayerCharacter[(Ownerof(Triggeringunit))]) for player (Owner of (Triggering unit)) over 2.0 seconds with Existing Velocity% initial velocity and 10% deceleration
General - If (Conditions) then do (Actions) else do (Actions)
If
TeamGame == true
Then
General - If (Conditions) then do (Actions) else do (Actions)
If
((Triggering unit) is in BlueTeam) == true
Then
Unit Group - Add PlayerCharacter[(Ownerof(Triggeringunit))] to BlueTeam
Else
Unit Group - Add PlayerCharacter[(Ownerof(Triggeringunit))] to RedTeam
Else
General - Wait 2.0 Game Time seconds
Actor - Kill actor model SpawnEffect
Camera - Unlock camera input for player (Owner of (Triggering unit))
From the looks of it , in the Unit - Create section I believe the value (Owner of (Triggering unit)) returns a value outside the array range (probably too low since it's stating underflow in the error) of PlayerCharacterType. Not knowing how the variables are set up etc it's hard to say for sure, but I'd start troubleshooting there. I could take a quick peek at it myself if you'd be willing to upload the file.
That was my first thought too, but the trigger wouldn't even be running if the value of (Owner of (Triggering Unit)) were outside the array, because of the conditions I set.
Nah it's from the value going over (see value: 16, min:0, max:15). Really need to see your other triggers, in particular what you set your array values as. This doesn't seem the case but have you accounted for the fact that arrays start at 0 while player counting starts at 1?
Essentially it's trying to create a unit of type PlayerCharacterType[16], which doesn't exist. My only guess as to why your conditions don't stop this is because you have a wait 2 seconds timer; and I think that during those 2 seconds the ownership of said dying unit might somehow switch (to player 16? because unit decays?). What you may want to do is use a local variable int PlayerOwn = 0 then run set PlayerOwn = TriggeringPlayer at the very beginning of the trigger. Then instead of TriggeringPlayer, use the variable PlayerOwn. That way, if the ownership of dying unit somehow switches during those 2 seconds of game-time, it won't matter.
Alternatively, I forget whether multiple conditions in the Conditions default to OR or AND relationship. I would assume AND, but assumptions are never very wise. So you may want to put your two conditions under an AND, just in case.
Hope this helps!
Cheers!,
Xen.
Edit: I took the liberty of testing this change for your map and it worked. Cheers again!, Xen.
I just wanted to confirm xenrathe's solution. It appears any Wait action causes the dead unit to switch to Player 16. This problem had me stumped for an hour until I stumbled on this thread.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Alright well I am flummoxed. I've gone over this trigger again and again even rewriting it from scratch once and it just refuses to work.
It produces this error:
And I cannot figure out why. Here's the trigger:
I could really use some help on this one.
From the looks of it , in the Unit - Create section I believe the value (Owner of (Triggering unit)) returns a value outside the array range (probably too low since it's stating underflow in the error) of PlayerCharacterType. Not knowing how the variables are set up etc it's hard to say for sure, but I'd start troubleshooting there. I could take a quick peek at it myself if you'd be willing to upload the file.
That was my first thought too, but the trigger wouldn't even be running if the value of (Owner of (Triggering Unit)) were outside the array, because of the conditions I set.
Map's already uploaded actually, since this is the only major bug. http://www.sc2mapster.com/maps/templar-battles/
@EphemeralNight: Go
Nah it's from the value going over (see value: 16, min:0, max:15). Really need to see your other triggers, in particular what you set your array values as. This doesn't seem the case but have you accounted for the fact that arrays start at 0 while player counting starts at 1?
Essentially it's trying to create a unit of type PlayerCharacterType[16], which doesn't exist. My only guess as to why your conditions don't stop this is because you have a wait 2 seconds timer; and I think that during those 2 seconds the ownership of said dying unit might somehow switch (to player 16? because unit decays?). What you may want to do is use a local variable int PlayerOwn = 0 then run set PlayerOwn = TriggeringPlayer at the very beginning of the trigger. Then instead of TriggeringPlayer, use the variable PlayerOwn. That way, if the ownership of dying unit somehow switches during those 2 seconds of game-time, it won't matter.
Alternatively, I forget whether multiple conditions in the Conditions default to OR or AND relationship. I would assume AND, but assumptions are never very wise. So you may want to put your two conditions under an AND, just in case.
Hope this helps!
Cheers!,
Xen.
Edit: I took the liberty of testing this change for your map and it worked. Cheers again!, Xen.
I just wanted to confirm xenrathe's solution. It appears any Wait action causes the dead unit to switch to Player 16. This problem had me stumped for an hour until I stumbled on this thread.