Fate of Destiny - Problems
Well first of all, a progress report for those of you interested;
It's still going, slowly, and at this stage has backtracked to around 70% complete, as I've been testing through and finding more and more problems. A lot of the errors I've been trying to fix have been simple enough but there's a few that are causing me a real headache, especially when I can't see what could be causing it and when I've tried to fix it multiple times.
Now with my Contest entry taking up more time than FoD, I've decided its better to ask for help.
("It's dangerous to go alone, take this DinkC reference!" Jk, I own one already.)
Here's the first of (hopefully FEW) problematic scripts I can't seem to correct. The problem with this one, is that if Dink talks to the character again at the correct point and has already increased &story and &qlog by one, the dialogue (and the variables) repeat the script again regardless of the If statement. Alongside that, attempts to disable him before the correct point haven't worked entirely well either (Dink talks to thin air to investigate stuff, and it can initiate the dialogue.)
Any thoughts?
EDIT: The [.code] feature seems to change ¤t_sprite to ¤t_sprite for some reason.
It's still going, slowly, and at this stage has backtracked to around 70% complete, as I've been testing through and finding more and more problems. A lot of the errors I've been trying to fix have been simple enough but there's a few that are causing me a real headache, especially when I can't see what could be causing it and when I've tried to fix it multiple times.
Now with my Contest entry taking up more time than FoD, I've decided its better to ask for help.
("It's dangerous to go alone, take this DinkC reference!" Jk, I own one already.)
Here's the first of (hopefully FEW) problematic scripts I can't seem to correct. The problem with this one, is that if Dink talks to the character again at the correct point and has already increased &story and &qlog by one, the dialogue (and the variables) repeat the script again regardless of the If statement. Alongside that, attempts to disable him before the correct point haven't worked entirely well either (Dink talks to thin air to investigate stuff, and it can initiate the dialogue.)
Any thoughts?
EDIT: The [.code] feature seems to change ¤t_sprite to ¤t_sprite for some reason.
//HAMLET - Character [censored] void main(void) { sp_brain(¤t_sprite, 0); sp_base_walk(¤t_sprite, 230); sp_speed(¤t_sprite, 2); playmidi("2.mid"); loopmidi(1); if(&story <= 5) { sp_nodraw(¤t_sprite, 1); freeze(¤t_sprite); sp_disabled(1); kill_this_task; } } void talk(void) { if (&story 5) sp_nodraw(¤t_sprite, 1); freeze(¤t_sprite); sp_disabled(1); kill_this_task; if (&story 7) { say_stop("`0Good luck, Dink. I only wish I could be of more help.", ¤t_sprite); } //Plot Dialogue, occurs once. //CURRENTLY BUGGED. Repeats if talked to again straight away. if (&story 6); { freeze(1); freeze(¤t_sprite); //Dialogue cleared for bug assistance wait(200); say_stop("`0If there is anything else you wish to discuss, feel free to stop by.", ¤t_sprite); Say_xy("`%Dink has updated his Quest Log!", 0, 386); unfreeze(1); unfreeze(¤t_sprite); //increase story & quest log variables by 1 &story += 1; &qlog += 1; //playmidi("27.mid"); } //End of Plot Dialogue // } void hit(void) { say_stop("`0Would you please not do that again?", ¤t_sprite); }
You might want to peruse the DinkC reference for how to write if checks again.
Only the first one is correct.
About disabling the sprite, the easiest method is to just use sp_active(¤t_sprite,0) in void main.

About disabling the sprite, the easiest method is to just use sp_active(¤t_sprite,0) in void main.
The if (&story 6) shouldn't have a semi colon. Also, the checks need to have so sort of equation to them…
==
+=
-=
>=
<=
!=
I think those are the only ones.
So it can't just be if(&story 6)
It would have to be if(&story == 6)
Which would mean it only happens when the story is at 6.
==
+=
-=
>=
<=
!=
I think those are the only ones.
So it can't just be if(&story 6)
It would have to be if(&story == 6)
Which would mean it only happens when the story is at 6.
EDIT: The [.code] feature seems to change ¤t_sprite to ¤t_sprite for some reason.
It only does that if you edit your post
It only does that if you edit your post

... but I always edit my post! I'm OCD about correcting errors lol.
Your if statements are really odd... The following if statement have no brackets. If you don't have brackets around your conditional statements; only the first code line will be counted to the statement. In your case, only the "sp_nodraw(¤t_sprite, 1);" counts to the statement.
Furthermore, you don't have any operators (as leprochaun pointed out).
if (&story 5) sp_nodraw(¤t_sprite, 1); freeze(¤t_sprite); sp_disabled(1); kill_this_task;
Furthermore, you don't have any operators (as leprochaun pointed out).
Well that's certainly helped me fix a fair number of scripts so far already! Thanks so far.