Something is wrong with this action definition... For some damn reason i don't understand. It worked before and also works for another similar trigger, but a third similar trigger also doesn't function correctly. It screws up where the Initiation Timer is created. I don't know if just the creation isn't working or the show, but everything since the timer creation is not working. No timer pops up, and the rest of the trigger does not complete.
I get the error "Trying to access an element past the end of an array," while the array for the variable BattlePlayerGroup[] is clearly large enough as it works fine for earlier actions.
Gladiator1v1InitiatorOptions:ActionReturnType:(None)ParametersBattle=0<Integer>GrammarText:Gladiator1v1Initiator(Battle)HintText:(None)CustomScriptCodeLocalVariablesa=0<Integer>b=0<Integer>InitiationTimer=(Newtimer)<Timer>InitiationTimerWindow=NoTimerWindow<TimerWindow>Player=0<Integer[2]>Chooser=NoUnit<Unit[2]>MapActivate=0<Integer>i=0<Integer>ActionsVariable-SetPlayer[1]=(Player1fromBattlePlayerGroup[Battle])Variable-SetPlayer[2]=(Player2fromBattlePlayerGroup[Battle])-------BGOccupiedCheckandRerollVariable-SetMapActivate=(Randomintegerbetween1and4)General-While(Conditions)aretrue,do(Actions)ConditionsBGOccupied?[MapActivate]==TrueActionsVariable-SetMapActivate=(Randomintegerbetween1and4)Variable-SetBattlefield[Battle]=combatRegion[MapActivate]Variable-SetBattle'sBG[Battle]=MapActivateVariable-SetBGOccupied?[MapActivate]=TrueVariable-SetVictoryOn[Battle]=TruePlayerGroup-ForeachplayerbinBattlePlayerGroup[Battle]do(Actions)ActionsPlayer-ModifyplayerbMinerals:SetTo3Variable-SetGladiatorsAlive[b]=3UnitGroup-Pickeachunitin(Beacon(ProtossLarge)unitsinBattlefield[Battle]ownedbyplayer0matchingExcluded:Missile,Dead,Hidden,withatmostAnyAmount)anddo(Actions)ActionsUnit-Turn(Pickedunit)TargetablestateOffCamera-SetthecameraboundsforBattlePlayerGroup[Battle]toBattlefield[Battle](Doadjusttheminimap)Dialog-HideObserverDialogforBattlePlayerGroup[Battle]UI-ShowCommandPanelforBattlePlayerGroup[Battle]UI-ShowMinimapPanelforBattlePlayerGroup[Battle]UI-ShowControlGroupPanelforBattlePlayerGroup[Battle]UI-ShowInfoPanelforBattlePlayerGroup[Battle]-------ChooserUI-Display"Choose 3 warriors to do battle."forBattlePlayerGroup[Battle]toSubtitleareaUnit-Create1GladiatorSelectorforplayerPlayer[1]atBGPylonLeft[MapActivate]facing270.0degrees(NoOptions)Variable-SetChooser[Player[1]]=(Lastcreatedunit)UnitSelection-Select(Lastcreatedunit)forplayerPlayer[1]Camera-PanthecameraforplayerPlayer[1]to(Positionof(Lastcreatedunit))over0.5secondswithExistingVelocity%initialvelocity,10%deceleration,andDoNotusesmartpanningUnit-Create1GladiatorSelectorforplayerPlayer[2]atBGPylonRight[MapActivate]facing270.0degrees(NoOptions)Variable-SetChooser[Player[2]]=(Lastcreatedunit)UnitSelection-Select(Lastcreatedunit)forplayerPlayer[2]Camera-PanthecameraforplayerPlayer[2]to(Positionof(Lastcreatedunit))over0.5secondswithExistingVelocity%initialvelocity,10%deceleration,andDoNotusesmartpanning-------TimerTimer-StartInitiationTimerasaOneShottimerthatwillexpirein25.0GameTimesecondsTimer-Createatimerwindowfor(Laststartedtimer),withthetitle"Initiation Timer",usingRemainingtime(initiallyHidden)Variable-SetInitiationTimerWindow=(Lastcreatedtimerwindow)Timer-MoveInitiationTimerWindowto(970,322)Timer-ShowInitiationTimerWindowforBattlePlayerGroup[Battle]General-WaitforInitiationTimertohave0.0secondsRemainingPlayerGroup-ForeachplayerbinBattlePlayerGroup[Battle]do(Actions)ActionsVariable-SetGladiatoractive?[b]=TruePlayerGroup-AddplayerbtoGladiatorMineralGroupDialog-CreateaModaldialogofsize(200,200)at(0,0)relativetoCenterofscreenVariable-SetEnemyTargetDialogTest[b]=(Lastcreateddialog)Dialog-ShowEnemyTargetDialogTest[b]for(Playergroup(b))Dialog-HidethebackgroundimageofEnemyTargetDialogTest[b]Dialog-CreateanimagefordialogEnemyTargetDialogTest[b]withthedimensions(111,111)anchoredtoTopLeftwithanoffsetof(11,11)settingthetooltipto""usingtheimageAssets\Textures\cursor-target-invalid.ddsasaNormaltypewithtiledsettoFalsetintcolorRedandblendmodeLightenDialog-Set(Lastcreateddialogitem)sizetoparentlayoutTruefor(Allplayers)Dialog-ShowControlGroupSwitchDialogforBattlePlayerGroup[Battle]Dialog-ShowForfeitDialogforBattlePlayerGroup[Battle]Dialog-SetMineralBaritemcurrentvalueto0.0forBattlePlayerGroup[Battle]Dialog-ShowMineralBarforBattlePlayerGroup[Battle]Timer-DestroyInitiationTimerWindowDialog-EnableObserverDialogGameButton[Battle]for(Allplayers)UnitGroup-Pickeachunitin(GladiatorSelectorunitsinBattlefield[Battle]ownedbyplayerAnyPlayermatchingExcluded:Missile,Dead,Hidden,withatmostAnyAmount)anddo(Actions)ActionsUnit-Kill(Pickedunit)
You got the Player variable, which is an integer of size 2, and you try to set the 3rd element of it by using Player[2].
Array elements start at 0, so an array of size 2 has [0] and [1] as useable elements.
You got the Player variable, which is an integer of size 2, and you try to set the 3rd element of it by using Player[2].
Array elements start at 0, so an array of size 2 has [0] and [1] as useable elements.
That's not it... I never had a problem with setting arrays like that before. I just tried setting the Player[] and Chooser[] arrays to size 3 and I still get the same problem. If what you're suggesting was the case, the action definition would stop working at the beginning instead of in the middle.
You got the Player variable, which is an integer of size 2, and you try to set the 3rd element of it by using Player[2].
Array elements start at 0, so an array of size 2 has [0] and [1] as useable elements.
Only in galaxy scripting ... in GUI, an array of size 2 is actually (3) in galaxy ... [0] [1] [2] ...
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Something is wrong with this action definition... For some damn reason i don't understand. It worked before and also works for another similar trigger, but a third similar trigger also doesn't function correctly. It screws up where the Initiation Timer is created. I don't know if just the creation isn't working or the show, but everything since the timer creation is not working. No timer pops up, and the rest of the trigger does not complete.
I get the error "Trying to access an element past the end of an array," while the array for the variable BattlePlayerGroup[] is clearly large enough as it works fine for earlier actions.
Trigger below thanks to o3210.
@o3210: Go
Thanks how did you fix my trigger like that?
You got the Player variable, which is an integer of size 2, and you try to set the 3rd element of it by using Player[2].
Array elements start at 0, so an array of size 2 has [0] and [1] as useable elements.
Your trigger looked like you wanted to put it within code-tags yourself, but messed it up. For WikiCreole, you need to use the tags like this:
<<code>>
Trigger
<</code>>
If the tags are in the same line, they won't work. Same with BB tags. (the one line in between is just for clarification, thats unnecessary)
That's not it... I never had a problem with setting arrays like that before. I just tried setting the Player[] and Chooser[] arrays to size 3 and I still get the same problem. If what you're suggesting was the case, the action definition would stop working at the beginning instead of in the middle.
Only in galaxy scripting ... in GUI, an array of size 2 is actually (3) in galaxy ... [0] [1] [2] ...