i looked up the search function but didnt seem to find anything related.
Following problem:
Im creating a Trivia map with several Questions that are answered thorugh a dialog button, for every wrong answer theres an array that saves the dialog item. Now in my event i have a switch case, where i want some actions to happen if ANY index of the array is used. but i cant seem to find the order/preset for the
Can you try to explain the question a little better as I am not 100% understanding on what you are wanting to do...
From what I read I believe your question was answered by s3rius, but you may want to throw in a FOR statement that loops from 0 to (MAX ARRAY LENGTH) and increments X.
If (clicked dialog item) == YourButton[X] then...
That will loop over every item in the array and if it was clicked it will proceed.
Yeah sorry its hard to get the picture if you dont know for what i use it for.
So basically i have a series of questions that you get some answers to choose from, if you pass you move on if not you die.
So i had this idea to put all the wrong answers into an array and on every question theres just 1 right variable and this big array of wrong answers.
On every a new question i would put up a switch function
1. right variable
2. array of wrongs
3. default = cancel
and i asked myself how i could just let the programm look out for the array without knowing which index just look for any index doesnt matter, basically useing it like a boolean that means = wrong
im kinda new to programming so i guess theres tons of better solutions but i want to learn and asked myself if it would be possible with this array.
Hope this lightens things up a bit.
At the moment i use the default of the switch function as the wrong, really works out without this array of wrongs.
heres an example:
Answer2EventsDialog-AnyDialogItemisClickedbyPlayerAnyPlayerLocalVariablesbuttonpressed=(Useddialogitem)<DialogItem>ConditionsAndConditionsQuestionnumber==2Menubutton!=(Useddialogitem)ActionsGeneral-Switch(Actions)dependingonbuttonpressedCasesGeneral-If(right)ActionsDialog-DestroyDialog[4]Dialog-DestroyDialog[5]Camera-Panthecameraforplayer1to(PositionofPathblock[10.00,95.00])over2.0secondswithExistingVelocity%initialvelocity,10%deceleration,andDoNotusesmartpanningGeneral-Wait2.0GameTimesecondsUnit-Orderallunitsin(PathblockunitsinRegion002ownedbyplayerAnyPlayermatchingExcluded:Missile,Dead,Hidden,withatmostAnyAmount)to(SupplyDepot-Lower(SupplyDepot))(ReplaceExistingOrders)General-Wait1.0GameTimesecondsUnit-UnpauseArchon[14.33,100.12]Transmission-StopsallactivetransmissionsTrigger-TurnQuestion1dialogOffCamera-Panthecameraforplayer1to(PositionofArchon[14.33,100.12])over2.0secondswithExistingVelocity%initialvelocity,10%deceleration,andDoNotusesmartpanningUnit-MakeArchon[14.33,100.12]CommandableTransmission-Sendtransmissionto(Allplayers)from(Changeling[2.08,12.21]withFlash(DoNotoverrideportrait)playingTalk)playingNoSoundLinkwithname"Mazekeeper"andmessage"Nifty Nifty ;D"using(Cinematicportrait(CenterLeft))playingTalk(Add5.0seconds,Don't Wait until it finishes)Variable-Settrialnumber=1Variable-SetQuestionnumber=3General-If(cancel)ActionsUnit-UnpauseArchon[14.33,100.12]Dialog-DestroyDialog[4]Dialog-DestroyDialog[5]Transmission-StopsallactivetransmissionsUnit-MakeArchon[14.33,100.12]CommandableDefaultUnit-OrderArchon[14.33,100.12]to(HoldPosition)(ReplaceExistingOrders)Transmission-StopsallactivetransmissionsDialog-DestroyDialog[4]Dialog-DestroyDialog[5]Camera-Zoomcameraforplayer1at(PositionofArchon[14.33,100.12])fromDefaultCameraDistanceto(Abs(15.0))over3.0secondsUnit-OrderallunitsinUnitGroup003to(Zergling-Unburrow)(ReplaceExistingOrders)Unit-OrderallunitsinUnitGroup004to(Zergling-Unburrow)(ReplaceExistingOrders)Unit-OrderallunitsinUnitGroup006to(Zergling-Unburrow)(ReplaceExistingOrders)Unit-OrderallunitsinUnitGroup007to(Zergling-Unburrow)(ReplaceExistingOrders)Unit-OrderallunitsinUnitGroup008to(Zergling-Unburrow)(ReplaceExistingOrders)Unit-OrderallunitsinUnitGroup009to(Zergling-Unburrow)(ReplaceExistingOrders)General-Wait1.0GameTimesecondsUnit-OrderallunitsinUnitGroup003to(AttackArchon[14.33,100.12])(ReplaceExistingOrders)Unit-OrderallunitsinUnitGroup004to(AttackArchon[14.33,100.12])(ReplaceExistingOrders)Unit-OrderallunitsinUnitGroup006to(AttackArchon[14.33,100.12])(ReplaceExistingOrders)Unit-OrderallunitsinUnitGroup007to(AttackArchon[14.33,100.12])(ReplaceExistingOrders)Unit-OrderallunitsinUnitGroup008to(AttackArchon[14.33,100.12])(ReplaceExistingOrders)Unit-OrderallunitsinUnitGroup009to(AttackArchon[14.33,100.12])(ReplaceExistingOrders)
Hello everyone
i looked up the search function but didnt seem to find anything related.
Following problem: Im creating a Trivia map with several Questions that are answered thorugh a dialog button, for every wrong answer theres an array that saves the dialog item. Now in my event i have a switch case, where i want some actions to happen if ANY index of the array is used. but i cant seem to find the order/preset for the
Does anyone know?
Greetz Fanta
Guess that's what you were looking for?
And then in your actions..
Or with switch/case if you want to.
Not exactly, i want the action to happen with any index of the array.
is this possible?
I used the default setting for a workaround but now the game menu dialog item is causing problems.
Can you try to explain the question a little better as I am not 100% understanding on what you are wanting to do...
From what I read I believe your question was answered by s3rius, but you may want to throw in a FOR statement that loops from 0 to (MAX ARRAY LENGTH) and increments X.
If (clicked dialog item) == YourButton[X] then...
That will loop over every item in the array and if it was clicked it will proceed.
@zachet: Go
from what I understand there's no For in SC2edit, so you'll want a do .. while loop I think.
Yeah sorry its hard to get the picture if you dont know for what i use it for.
So basically i have a series of questions that you get some answers to choose from, if you pass you move on if not you die.
So i had this idea to put all the wrong answers into an array and on every question theres just 1 right variable and this big array of wrong answers.
On every a new question i would put up a switch function
1. right variable 2. array of wrongs 3. default = cancel
and i asked myself how i could just let the programm look out for the array without knowing which index just look for any index doesnt matter, basically useing it like a boolean that means = wrong
im kinda new to programming so i guess theres tons of better solutions but i want to learn and asked myself if it would be possible with this array.
Hope this lightens things up a bit.
At the moment i use the default of the switch function as the wrong, really works out without this array of wrongs.
heres an example: