The Dink Network

Choices Command

July 7th 2003, 09:11 PM
dragon.gif
eug1404
Peasant He/Him New Zealand
 
Ok i'm fairly new to DinkC scripting and have been through a couple of tutorials but whenever i select anything in the following code it crashes my computer and pulling out the plug is the only solution .

void talk(void)
{
freeze(1);
say_stop("`#What were YOU doing in pillbug manor?", &current_sprite);

choice_start()
"I was teleported there by a magical duck-mage to save our world"
"Im an idiot who just got lost"
choice_end()

}

if (&result== 1)
{
say("`#Ah ha and i'm king Daniel, u aint going anywhere", &current_sprite);
}

if (&result== 2)
{
say("`# Exactly as i thought, Get out of here scumbag!", &current_sprite);
screenlock(0);
}

Im guessing it will be something simple that im just too new to pick-up but yeah any help would be great.
July 7th 2003, 09:19 PM
pq_frog.gif
Ric
Peasant They/Them Canada
 
You don't need that bracket after the choice_end, that bracket closes the talk procedure and needs to go at the end. It's also best to unfreeze just before the end of the talk procedure( unless the script ends itself in mid-proc. e.g.-return; ) Otherwise it looks o.k. to me
July 8th 2003, 04:28 AM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
Yeah, the unfreeze you forgot will make your PC end up in that situation. However, you should still be able to escape Dink by pushing CTRL-ALT-DEL or simply ALT-ESC.

And pushing reset is better than pulling the plug.
July 8th 2003, 09:37 AM
sob_scorpy.gif
Tyrsis
Peasant She/Her Russia
 
The first thing I see is you need a space here:
if (&result == 1)
July 8th 2003, 05:31 PM
dragon.gif
eug1404
Peasant He/Him New Zealand
 
CTRL-ALT-DEL, ALT-F4, and ALT-ESC didn't work and with XP there is no reset button .
But after a proper reset CTRL-ALT-DEL workds now but still with the following revised script i still get a crash:

void talk(void)
{
freeze(1);
say_stop("`#What were YOU doing in pillbug manor?", ¤t_sprite);

choice_start()
"I was teleported there by a magical duck-mage to save our world"
"Im an idiot who just got lost"
choice_end
unfreeze(1);
}

if (&result == 1)
{
say("`#Ah ha and i'm king Daniel, u aint going anywhere", ¤t_sprite);
}

if (&result == 2)
{
say("`# Exactly as i thought, Get out of here scumbag!", ¤t_sprite);
screenlock(0);
}

Same freeze PC error
July 8th 2003, 07:02 PM
pillbug.gif
Well, you don't need a bracket after ending the choice_start(), it's still one script, but if that doen't work you can always try something else. How about... GOTOS!


VOID TALK(VOID)
{
freeze(1);
say_stop("`#What were YOU doing in pillbug manor?", ¤t_sprite);

choice_start()
I was teleported there by a magical duck-mage to save our world"
"Im an idiot who just got lost"
choice_end

if (&result == 1) goto AST
if (&result == 2) goto BST
{

AST:

say("`#Ah ha and i'm king Daniel, u aint going anywhere", ¤t_sprite)
unfreeze(1);
return;

BST:

say("`# Exactly as i thought, Get out of here scumbag!", ¤t_sprite);
screenlock(0);
unfreeze(1);
}
}

...I let it do the same thing, just changed how it's done. I fixed a problem where Dink was never unfrozen after the script is finished and you had one extra closing and opening thingy that ended the script way too soon. That should fix it.

July 9th 2003, 12:20 AM
old.gif
LOL, nobody notices it

change

choice_end

into

choice_end()
July 9th 2003, 01:36 AM
fairy.gif
glennglenn
Peasant He/Him Norway
GlennGlenn doesn't want a custom title. 
well you dont need a bracket after the choice end istead put that bracket after the last bracket in the script that will help
July 9th 2003, 03:13 AM
old.gif
Nice copy-paste action glennglenn ( read ric's reply )
July 9th 2003, 04:35 AM
fish.gif
Simeon
Peasant He/Him Netherlands
Any fool can use a computer. Many do. 
GOTOS!!?! Arh, no gotos. Not here...
July 9th 2003, 11:50 AM
peasantmb.gif
Ehhh, why is at the end of the script a screenlock(0); command?
At first i don't see a screenlock(1); there, so this command is just unecessary.
July 9th 2003, 01:22 PM
pillbug.gif
Maybe, there's another script in that screen that creates a screenlock.
July 9th 2003, 01:57 PM
peasantmb.gif
I don't think so, because if there's a screenlock(1); in another script, then he should screenlock(0); in the same script.
Unless this choice script is just from a spawn(); command, but that's useless.
July 9th 2003, 02:46 PM
spike.gif
Well. 'Could as well be in the same script, void main or so. And.. eh.. Why should the screenlock(0); be in the same script as screenlock(1); ? Is it a serious gaffe if it's not or something?
July 9th 2003, 06:53 PM
dragon.gif
eug1404
Peasant He/Him New Zealand
 
Thanx for all your help everyone .
There is a screenlock in another script that locks the screen and i have done that b4 and it worked.