The Dink Network

Reply to Re: Mkbul's code error thread

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
March 13th 2010, 08:35 AM
custom_robj.png
Robj
Jester He/Him Australia
You feed the madness, and it feeds on you. 
Below is a copy of the script, all the errors I could see have been fixed.
- Remember to always use two equal signs when checking a variable (for if statements).
- When checking a variable within a choice command you do not add if, you just use the brackets.
- The choice start and end lines should have semicolons after them, as should the title start and end lines.
- The if (&lady_vesti > 2) had an open bracket, but was not closed.
See fixed script below.

void main( void )
{
	playmidi("ticket.mid");
	sp_speed(&current_sprite, 2);
	sp_base_walk(&current_sprite, 370);
	sp_brain(&current_sprite, 16);
}

void talk( void )
{
	freeze(1);
	freeze(&current_sprite);
	say_stop("Hi there!", 1);
	wait(100);
	
	choice:
	choice_start();

	set_y 240
	set_title_color 10

	title_start();
	What is that you want here?
	title_end();
	(&story == 4) "I read a note"
	"What are you doing here?"
	"You seem not ok"
	"Forget it"

	choice_end();
	
	if (&result == 1)
	{	
		say_stop("I've found a note on a cavern that opened from the earthquake!", 1);
		wait(100);
		say_stop("`0Oh really?", &current_sprite);
		wait(100);
		say_stop("`0I guess you want something from me now", &current_sprite);
		wait(100);
		say_stop("Yeah...", 1);
		wait(100);
		
		if (&lady_vesti == 2)
		{
				say_stop("`0Go save my wife first, and then tell me!", &current_sprite);
	
		}
		
		if (&lady_vesti > 2)
		{
		say_stop("`0Ok, what do you want?", &current_sprite);
		wait(100);
		say_stop("Im suspecting that Island of Icrotie has a passage to this hell...", 1);
		wait(100);
		say_stop("`0But that turned into Wasteland years ago!", &current_sprite);
		wait(100);
		say_stop("Just send me there!", 1);
		wait(100);
		say_stop("`0Not so fast, bring me some firefist gloves first!", &current_sprite);
		wait(100);
		say_stop("Crap...another adventure", 1);
		unfreeze(1);
		unfreeze(&current_sprite);

		if (&fire_gloves == 0)
		{
			say("`0Get me those gloves!", &current_sprite);
		} 
		else
		{
		say_stop("I got you the gloves!", 1);
		wait(100);
		say_stop("`0Thank you man!", &current_sprite);
		wait(100);
		say_stop("`0Now, let's get to work", &current_sprite);
		wait(100);
		goto warp;
        }
		}

	}
	
	if (&result == 2)
	{
		say_stop("What are you doing here?", 1);
		wait(100);
		say_stop("`0I just wanted to leave from the buzy village above", &current_sprite);
		wait(100);
		say_stop("`0With all those taxes", &current_sprite);
		wait(100);
		say_stop("Yeah, the Giff is very selfish", 1);
		wait(100);
		say_stop("`0Basicly i argued with Mr. Pua", &current_sprite);
		wait(100);
		goto choice;
	}
	if (&result == 3)
	{
		say_stop("You don't seem very well, what's wrong?", 1);
		wait(100);
		say_stop("`0Well, my wife has gone to make some potions", &current_sprite);
		wait(100);
		say_stop("`0And she hasn't returned yet...", &current_sprite);
		wait(100);
		say_stop("I think i know where to go...", 1);
		wait(100);
		say_stop("`0Really? Thank you...eeerm your name?", &current_sprite);
		wait(100);
		say_stop("Dink Smallwood", 1);
		&lady_vesti += 1;
		goto choice;

	}
	if (&result == 4)
	{
		unfreeze(1);
		unfreeze(&current_sprite);
	}
		
		warp:
		
		fade_down();
		&player_map = 5;
		sp_x(1, 145);
		sp_y(1, 90);
		load_screen(5);
		draw_screen();
		fade_up();
		
		
}