integer problem in dialog_request

Started by proximity, Sun 21/08/2005 23:46:47

Previous topic - Next topic

proximity

i just tried something about dialogs and never got result.

in global script i placed:
function dialog_request (int 1,int 2) {
1= AnimateCharacter(JIL,........);


2=Ã,  AnimateCharacter(EGO,.........);

}

and then in conversation i typed:
EGO: " Can you teach me Salsa "
JIL: " Watch me "
RunScript 1

it worked well. But, when i wanted to make second different action in same conversation, it played first aciton again. i did:

EGO:Ã,  " Can you teach me Salsa "
JIL: " Watch me "
RunScript 1
EGO: " Wov. You're really good "
JIL: " Now it's your turn "
JIL: " Try to play like me "
EGO: "Ok "
RunScript 2
JIL: " Oh my god. We really need to practise :) "

Here, when i typed RunScript 2, it played first action (runscript 1). Where did i make mistake?
Proximity Entertainment

monkey0506

Oh my.  Please do the tutorial.  PLEASE.  Let me try to fix this before it gets any worse.

Code: ags
function dialog_request(int param) {
  if (param == 1) AnimateCharacter(JIL, ...);
  else if (param == 2) AnimateCharacter(EGO, ...);
  }


Learn how to use if statements and you may be able to write working code.

proximity

#2
Quote from: monkey_05_06 on Mon 22/08/2005 00:41:05
Oh my.Ã,  Please do the tutorial.Ã,  PLEASE.Ã,  Let me try to fix this before it gets any worse.

Code: ags
function dialog_request(int param) {
Ã,  if (param == 1) AnimateCharacter(JIL, ...);
Ã,  else if (param == 2) AnimateCharacter(EGO, ...);
Ã,  }


Learn how to use if statements and you may be able to write working code.


monkey_05_06, i did the tutorial at least 10 times don't worry. Problem is, Chris Jones couldn't make RunScript X explanation very clear. Chris should have told what X is in RunScript X. i simply understand that X is an integer, not parameter.

There is also some inadequete parts in tutorial.Ã,  Some examples in text script functions are not clear. Anyway, i got your solution. Thanks...

P.S: i made 4 games with AGS. 2 of them are published in this site. IF i wouldn't know how to use if statements, i couldn't make those games  :)
Proximity Entertainment

monkey0506

I didn't mean to sound rude, but:

Code: ags
function dialog_request (int 1,int 2) {
1= AnimateCharacter(JIL,........);


2=  AnimateCharacter(EGO,.........);

}


Is just completely wrong.  When using the "run-script X" command from a dialog, 'X' is the integer value that will be passed to dialog_request.  For example, if you type

@1:
run-script 45

Then dialog_request(45) will be called, and the corresponding "if (param == 45)" statements would be run.

I'm glad to hear that you know how to use if statements.  Just the above code had me very worried. ;) :D

proximity

Thanks monkey_05_06. i understand what you mean. now i completely understood what run-script x actually does. Thank you so much
Proximity Entertainment

SMF spam blocked by CleanTalk