Location: JBPLAY \ Meteor 2 \ Editing \ Confirm box script Back to Threads |
Raaka-arska Joined: 22 September 2003 Posts: 109 |
22 May 2005 08:28 (UK time)
It's a long time since I last visited here. Anyway I'm a little confused on how this SC_ConfirmBox script works? Lets say that I press OK button then some dude says me blah blah in a message box, but if I press Cancel this same dude says different blah blah. Can someone write an example for me here? You need to login to create posts in this thread. |
James Bunting Posts: 1308 |
22 May 2005 22:35 (UK time)
Sure... if( SC_ConfirmBo "Do Something?" ) { SC_MessageBo"You pressed OK" } else { SC_MessageBo"You pressed Cancel" } You need to login to create posts in this thread. |
Raaka-arska Joined: 22 September 2003 Posts: 109 |
23 May 2005 18:32 (UK time)
void DudeSpeak() { if(SC_ConfirmBo"Do Something?"); { SC_MessageBo"You pressed OK" } else { SC_MessageBo"You pressed Cancel" } This didn't work Edit: And yes I _did_ write export DudeSpeak; on top of the script. Edited: 23 May 2005 18:35 You need to login to create posts in this thread. |
Assain Joined: 02 November 2003 Posts: 979 |
23 May 2005 19:33 (UK time)
Assuming you directly copy-pasted the script here, the problem might be that you dont have closing brackets for your void Dudespeak() command. Such as: void DudeSpeak() { if(SC_ConfirmBo"Do Something?"); { SC_MessageBo"You pressed OK" } else { SC_MessageBo"You pressed Cancel" } <b>}</b> Edited: 23 May 2005 19:34 You need to login to create posts in this thread. |
Dave Man Joined: 19 October 2003 Posts: 374 |
24 May 2005 13:24 (UK time)
Another possible problem could be that you didn't put the command right in the sector code (run DudeSpeak. You need to login to create posts in this thread. |
James Bunting Posts: 1308 |
24 May 2005 23:35 (UK time)
Yes it could be that or the missing brace/bracket. Also you don't put a ; on the end of a "run ?????" statement, I know its pretty nuts. You need to login to create posts in this thread. |
me_mantis Joined: 26 September 2003 Posts: 1152 |
25 May 2005 03:23 (UK time)
When my map scripts don't work, I press the "`" key, and look at the console messages. I can usually decode what my error was from there. You need to login to create posts in this thread. |
Raaka-arska Joined: 22 September 2003 Posts: 109 |
26 May 2005 16:35 (UK time)
void DudeSpeak() { if(SC_ConfirmBo"Do Something?"); { SC_MessageBo"You pressed OK" } else { SC_MessageBo"You pressed Cancel" } } Still doesn't work... everything else is fine but this part of script has something buggy in it. You need to login to create posts in this thread. |
Dave Man Joined: 19 October 2003 Posts: 374 |
27 May 2005 13:20 (UK time)
Is there supposed to be a line between the void command and the if command? You need to login to create posts in this thread. |
Raaka-arska Joined: 22 September 2003 Posts: 109 |
27 May 2005 15:11 (UK time)
I dunno you tell me. You need to login to create posts in this thread. |
James Bunting Posts: 1308 |
28 May 2005 00:14 (UK time)
It makes no difference if the line is there or not. People often leave lines between blocks of code for ease of reading. You need to login to create posts in this thread. |
Raaka-arska Joined: 22 September 2003 Posts: 109 |
29 May 2005 07:50 (UK time)
Yea but could we stick in the point? This sciprt has something buggy in it... void DudeSpeak() { if(SC_ConfirmBo"Do Something?"); { SC_MessageBo"You pressed OK" } else { SC_MessageBo"You pressed Cancel" } } You need to login to create posts in this thread. |
Dave Man Joined: 19 October 2003 Posts: 374 |
30 May 2005 03:02 (UK time)
I got it. The problem falls from the if statment. In a if statment you need to have something be compared, this statemet does not do this. If you put if(SC_BoxMessage(blah..)="yes" (simillar to this but with the correct statement and the correct counterpart) than all should be fine, I think. You need to login to create posts in this thread. |
Raaka-arska Joined: 22 September 2003 Posts: 109 |
30 May 2005 18:26 (UK time)
I get it but I wonder what is the correct statement then? You need to login to create posts in this thread. |
Dave Man Joined: 19 October 2003 Posts: 374 |
31 May 2005 13:22 (UK time)
void DudeSpeak() { if(SC_ConfirmBo"Do Something?" == 1) { SC_GameMessage("You Pressed Okay" } Else { SC_GameMessage("You Pressed Cancel" } } I think this is the correct code. The 1 might be a 0 but that's changeable. You need to login to create posts in this thread. |
James Bunting Posts: 1308 |
01 June 2005 00:35 (UK time)
Yes the if line does not have a ; on the end. You need to login to create posts in this thread. |
Raaka-arska Joined: 22 September 2003 Posts: 109 |
01 June 2005 10:42 (UK time)
It says `Else' undeclared Line: Else, Error No: 4 Edited: 01 June 2005 11:12 You need to login to create posts in this thread. |
Dave Man Joined: 19 October 2003 Posts: 374 |
01 June 2005 13:24 (UK time)
Ohh, that's another easy one. Just put, on the else line: Else if(SC_ConfirmBo"Do Something?" == 0) Or you can get rid of all the rouble and use this code: void DudeSpeak() { x=SC_ConfirmBo"Do Something?" if(x == 1) { SC_GameMessage("You Pressed Ok." } if(x == 0) { SC_GameMessage("You Pressed Cancel." } } however I'm not rooting for this code. Try using the else commands. You need to login to create posts in this thread. |
Raaka-arska Joined: 22 September 2003 Posts: 109 |
01 June 2005 14:44 (UK time)
void DudeSpeak() { if(SC_ConfirmBo"Do Something?" == 1) { SC_GameMessage("You Pressed Okay" } Else if(SC_ConfirmBo"Do Something?" == 0) { SC_GameMessage("You Pressed Cancel" } } Neither of those codes didn't work!? You need to login to create posts in this thread. |
Dave Man Joined: 19 October 2003 Posts: 374 |
02 June 2005 13:24 (UK time)
Okay, I'm going to test some things out and report back to you in this thread but first, what does SC_ConfirmBox return and how does it reutrn it (what does it tell you in the form of a variable or string and what form does it tell you in)? You need to login to create posts in this thread. |
Raaka-arska Joined: 22 September 2003 Posts: 109 |
02 June 2005 15:22 (UK time)
Compile Error: test( 73) Error[V:\seer\src\Expr.c:1688] :`Else' undeclared Line: Else if(SC_ConfirmBo"Do Something?" == 0), Error No: 4 Is this it what you wanted? You need to login to create posts in this thread. |
me_mantis Joined: 26 September 2003 Posts: 1152 |
03 June 2005 02:40 (UK time)
¿!?! else has a capital E not lower e try changing Else to else. Heres another example from a large level I made.(I did change the messages though) export box; void bo) { if( SC_ConfirmBo "Blah Blah Blah?" ) { SC_MessageBo"You hit OK!!!!!." } else { SC_MessageBo"Bam! You hit cancel" int PosX, PosY, plyr; plyr = SC_GetPlayerObjectId(); SC_SetObjectHits( plyr, 1); SC_SetObjectSide(plyr,2); SC_SetObjectCoords( 511, PosX, PosY); } } You need to login to create posts in this thread. |
Raaka-arska Joined: 22 September 2003 Posts: 109 |
03 June 2005 08:27 (UK time)
void DudeSpeak() { if(SC_ConfirmBo"Do Something?" == 1) { SC_GameMessage("You Pressed Okay" } else { SC_GameMessage("You Pressed Cancel" } } Cool this script works perfectly. Thanks for helping. Edited: 13 June 2005 19:02 You need to login to create posts in this thread. |
me_mantis Joined: 26 September 2003 Posts: 1152 |
15 June 2005 04:01 (UK time)
great to here it. Maybe I shold go into programming... NOT! =D You need to login to create posts in this thread. |
|
Forums system (C) 1999-2023 by James Bunting.
Terms of Use