Wanting to make a series of conditionals. Got an error.

I want to make the system differentiate between buffs and debuffs so that I'm not stuck with -X*buffcount% and +X*buffcount%. I decided to use the object param_id as the case identifier. Here is my code:

def param_buff_rate(param_id) if param_id < 0 @buffs[param_id] * 0.15 + 1.0 if param_id > 0 @buffs[param_id] * 0.5 + 1.0 if param_id == 0 @buffs[param_id] * 0 + 1.0 endSince the error message pointed to line 738 as an unexpected "end," I'm guessing my syntax is off instead of referencing the wrong object/function. I am a complete newb at RGSSx, so bear that in mind with any details given.
You're missing a couple of ends.

def param_buff_rate(param_id) if param_id < 0 @buffs[param_id] * 0.15 + 1.0 end if param_id > 0 @buffs[param_id] * 0.5 + 1.0 end if param_id == 0 @buffs[param_id] * 0 + 1.0 end endAt the end of every conditional, you need to have an end.Another way you could do this is

Code:
 def param_buff_rate(param_id)    if param_id < 0      @buffs[param_id] * 0.15 + 1.0     elsif param_id > 0      @buffs[param_id] * 0.5 + 1.0     elsif param_id == 0      @buffs[param_id] * 0 + 1.0     end  end
okie dokie, thanks
Your problem is actually just many syntax errors together:

Your coude should look like this:

  1. def param_buff_rate(param_id) if param_id < 0 @buffs[param_id] * 0.15 + 1.0 elsif param_id > 0 @buffs[param_id] * 0.5 + 1.0 else # param_id == 0 ... @buffs[param_id] * 0 + 1.0 endend I don't know why you try to write code like that, are you from phyton ?
  2. See the else and the elsif, wich is a combination of else and if ?
  3. Also you missed many ends there...

I just ask something too, this line:

@buffs[param_id] * 0 + 1.0Why *0 + 1, just return 1...

@edit ninja'ed again
If youre checking the samw thing, just use cases...

Original thread: https://forums.rpgmakerweb.com/threads/wanting-to-make-a-series-of-conditionals-got-an-error.44142/