Reply to Re: Mkbul's code error thread
If you don't have an account, just leave the password field blank.
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.
- 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(¤t_sprite, 2); sp_base_walk(¤t_sprite, 370); sp_brain(¤t_sprite, 16); } void talk( void ) { freeze(1); freeze(¤t_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?", ¤t_sprite); wait(100); say_stop("`0I guess you want something from me now", ¤t_sprite); wait(100); say_stop("Yeah...", 1); wait(100); if (&lady_vesti == 2) { say_stop("`0Go save my wife first, and then tell me!", ¤t_sprite); } if (&lady_vesti > 2) { say_stop("`0Ok, what do you want?", ¤t_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!", ¤t_sprite); wait(100); say_stop("Just send me there!", 1); wait(100); say_stop("`0Not so fast, bring me some firefist gloves first!", ¤t_sprite); wait(100); say_stop("Crap...another adventure", 1); unfreeze(1); unfreeze(¤t_sprite); if (&fire_gloves == 0) { say("`0Get me those gloves!", ¤t_sprite); } else { say_stop("I got you the gloves!", 1); wait(100); say_stop("`0Thank you man!", ¤t_sprite); wait(100); say_stop("`0Now, let's get to work", ¤t_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", ¤t_sprite); wait(100); say_stop("`0With all those taxes", ¤t_sprite); wait(100); say_stop("Yeah, the Giff is very selfish", 1); wait(100); say_stop("`0Basicly i argued with Mr. Pua", ¤t_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", ¤t_sprite); wait(100); say_stop("`0And she hasn't returned yet...", ¤t_sprite); wait(100); say_stop("I think i know where to go...", 1); wait(100); say_stop("`0Really? Thank you...eeerm your name?", ¤t_sprite); wait(100); say_stop("Dink Smallwood", 1); &lady_vesti += 1; goto choice; } if (&result == 4) { unfreeze(1); unfreeze(¤t_sprite); } warp: fade_down(); &player_map = 5; sp_x(1, 145); sp_y(1, 90); load_screen(5); draw_screen(); fade_up(); }