16
Technical forum / Re: Scripting help - declaring variables
« on: December 23, 2011, 01:52:11 PM »
If I were you, I would try this:
Code: WME Script
- global myVariable;
- //some action changes myVariable to 1
- myVariable = 1;
- //some other action changes myVariable to 2
- myVariable = 2;
- //trigger the function actorDialogue
- actorDialogue(myVariable);
- //function actorDialogue with parameter
- function actorDialogue(myVar)
- {
- switch (myVar)
- {
- case 1:
- actorDialogue1();
- break;
- case 2:
- actorDialogue2();
- break;
- case 3:
- actorDialogue3();
- break;
- //etc.
- }
- }