Is this a bug? Or is there another way to do it in one script?

Started by juncmodule, Fri 06/06/2003 19:12:43

Previous topic - Next topic

juncmodule

I have had similiar problems before and have a solution given to me by Scorpiorus. That sort of works for this problem but, it will just take forever to do. Besides this doesn't make since, the engine is skipping commands.

Here is my code:
Code: ags

SetGlobalInt(45,2);
ObjectOff(2);
if (GetGlobalInt(46) ==0){
  RunDialog(1);
  SetGlobalInt(46,1);
}
if (GetGlobalInt(46) ==1){
  PlaySound(1);
  SetGlobalInt(46,2);
}
if (GetGlobalInt(46) ==2){
  RunDialog(2);
  SetGlobalInt(46,3);
}
if (GetGlobalInt(46) ==3){
 SetCharacterView(WILSON, 8);
 AnimateCharacter(WILSON, 0,3,0);
 Wait(20);
SetGlobalInt(46,4);
}
if (GetGlobalInt(46) ==4){
 ReleaseCharacterView(WILSON);
 SetGlobalInt(46,5);
}
if (GetGlobalInt(46) ==5){
 RunDialog(3);
 SetGlobalInt(46,6);
}  


When I run this it plays the sound, plays the animation, and runs dialog 3. It completely skips the other two dialogs. It also does all of that at the same time. Should the commands be executed this way!?

If that is the case then I will just use what Scorpiorus recommended HERE

thanks,
-junc

Vel


Jimi

its not a bug. WWhen you change (for example) global int 20 to 2 eg:

if GetGlobalInt(20)==1 {
   SetGlobalInt(20,2);
   }

Then have something straight under it saying:

if GetGlobalInt(20)==2 {
   PlaySound(1);
   }

it will change the global int to 2, then underneath is the "if global int is 2" bit, so it does that because global int 20 is 2. The script is read all at once, rather than line by line. Its just the things followed by a ; that is read line by line (I think).

So change if to else if.

(sorry about my explanation, I can't think of the right words to use)

Hope I helped

juncmodule

Wow.

I need to take a break.

That was stupid. ::)

thanks,
-junc

SMF spam blocked by CleanTalk