Script Call: Am I doing something wrong?

CrazyCrab

Veteran
Veteran
Joined
Mar 5, 2014
Messages
950
Reaction score
403
First Language
Polish
Hi everyone,

I'm really stuck. I've spent god knows how many hours on this day-based turn system, yet no matter what I do I get this:



The thing is that I don't know why and I'm not even sure what it means... it means that there is an ''else'' somewhere where it's not supposed to be, right?

Anyway, I've spend, again, I don't even know how much time looking at the common event that is causing the trouble and yet no matter what I do I can't locate the mistake...

If anyone knows what's up I'd be really, really grateful as I just don't know what's going on.



(The normal flow control comment so that it stands out)Comment: X#---Birth Chance Bonuses$game_variables[37] = 0#---Birth Chance Penalties$game_variables[38] = 0Comment: X#---Turn all Event switches OFF$game_switches[101] = false$game_switches[102] = false$game_switches[103] = falseA ton of switches here, move along...$game_switches[116] = falseComment: X#---Hygiene:#---Hygiene: Base Tower Bonus $game_variables[8] = 5#---Hygiene: Homesteads $game_variables[8] += ($game_variables[102]*2)#---Pollution:#---Pollution: Base no. of citizens $game_variables[9] = $game_variables[20]#---Compare the two and behave accordinglyIf $game_variables[8] >= $game_variables[9] $game_variables[46] = $game_variables[8] - $game_variables[9] if $game_variables[46] >= 25 $game_variables[37] += 25 else $game_variables[37] += $game_variables[46] endelse $game_switches[113] = true $game_variables[46] = $game_variables[9] - $game_variables[8] if $game_variables[46] >= 25 $game_variables[38] += 25 else $game_variables[38] += $game_variables[46] endend#---Check for the gravity of the pollution, turn on switches.if $game_switches[113] = true if $game_variables[46] >= 75 $game_switches[101] = true else end if $game_variables[46] >= 50 $game_switches[102] = true else end if $game_variables[46] >= 25 $game_switches[103] = true else endelseendComment: X#---Happiness:#---Happiness: Base Tower Bonus $game_variables[10] = 5#---Happiness: Inns $game_variables[10] += ($game_variables[108]*2)#---Unrest:#---Unrest: Base no. of citizens $game_variables[11] = $game_variables[20]#---Compare the two and behave accordinglyIf $game_variables[10] >= $game_variables[11] $game_switches[114] = true $game_variables[47] = $game_variables[10] - $game_variables[11]else $game_switches[115] = true $game_variables[47] = $game_variables[11] - $game_variables[10end#---Check for the gravitiy of the happiness, turn on switches.if $game_switches[114] = true if $game_variables[46] >= 75 $game_switches[104] = true else end if $game_variables[46] >= 50 $game_switches[105] = true else end if $game_variables[46] >= 25 $game_switches[106] = true else endelseend#---Check for the gravitiy of the unrest, turn on switches.if $game_switches[115] = true if $game_variables[46] >= 75 $game_switches[107] = true else end if $game_variables[46] >= 50 $game_switches[108] = true else end if $game_variables[46] >= 25 $game_switches[109] = true else endelseendComment: X#---Security:#---Security: Base Tower Bonus $game_variables[19] = 5#---Security: Homesteads $game_variables[19] += ($game_variables[102]*2)#---Danger:#---Danger: Hunter's Camps $game_variables[18] = ($game_variables[110]*2)#---Compare the two and behave accordinglyIf $game_variables[18] >= $game_variables[19] $game_switches[116] = true $game_variables[48] = $game_variables[18] - $game_variables[19]elseend#---Check for the gravitiy of the danger, turn on switches.if $game_switches[116] = true if $game_variables[48] >= 75 $game_switches[110] = true else end if $game_variables[48] >= 50 $game_switches[111] = true else end if $game_variables[48] >= 25 $game_switches[112] = true else endelseend

Sorry about the size, but after having read it countless times I still can't anything.

Any idea what's the problem?

Thanks a ton!  :)  
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
You have many else's with no commands after them. The way I understand them, if there is nothing after the else, the interpreter becomes confused. Either put a command there, or get rid of all the

else

end

you have in your code.
 

CrazyCrab

Veteran
Veteran
Joined
Mar 5, 2014
Messages
950
Reaction score
403
First Language
Polish
You have many else's with no commands after them. The way I understand them, if there is nothing after the else, the interpreter becomes confused. Either put a command there, or get rid of all the

else

end

you have in your code.
I tried that, but I still get the same error message... weird.
 

Vexeno

Villager
Member
Joined
Jun 20, 2014
Messages
19
Reaction score
2
First Language
English
Primarily Uses
Quick question. If you take the script out does everything function normally?
 

CrazyCrab

Veteran
Veteran
Joined
Mar 5, 2014
Messages
950
Reaction score
403
First Language
Polish
Quick question. If you take the script out does everything function normally?
Yeah, I tried using them one at a time, had some more mistakes but fixed the ones present in the other ones.

The event is pretty much 7 common events in a row, this is the 2nd one. Everything works when I take it out, except of course for the other things dependent on it.
 

reno385

Veteran
Veteran
Joined
May 2, 2013
Messages
31
Reaction score
8
First Language
English
Primarily Uses
Edit- nvm I think I misunderstood. And yeah cremnophobia is right, it has to be if not If.
 
Last edited by a moderator:

cremnophobia

Veteran
Veteran
Joined
Dec 10, 2013
Messages
216
Reaction score
97
Primarily Uses
If has to be if. Case-sensitivity matters. The superfluous else's don't. You're also confusing = (assignment) with == (comparison).


By the way, why do you even use Ruby scripting? I could be missing something, but it looks like that everything can be achieved with event commands.
 

CrazyCrab

Veteran
Veteran
Joined
Mar 5, 2014
Messages
950
Reaction score
403
First Language
Polish
If has to be if. Case-sensitivity matters. The superfluous else's don't. You're also confusing = (assignment) with == (comparison).

By the way, why do you even use Ruby scripting? I could be missing something, but it looks like that everything can be achieved with event commands.
Haha, I knew it has to be something so simple - thanks a bunch, you really saved me from rewriting everything!  :guffaw:

I know that they're different, I just haven't wrote anything in a long, long time so I keep forgetting - thanks for the reminder.

And yeah, it would be possible and probably more bug-proof, but this is just so, so much faster and it's much easier when it comes to changing things afterwards.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,977
Members
137,563
Latest member
cexojow
Top