So, I'm working on a script that is defining a local variable based on $game_variables[15]. I'm an incredibly novice scripter, so I don't understand what the issue going on here is.
Variable 15 will be set to something (say, 192), but it will be treated as if it were the first item in a || list. Checking the variable externally says that it is 192, but the script is treating it as 144 (the first number that appears). Can anyone let me know what I'm doing wrong?
Affected sections:
Thanks in advance for any help that can be offered! I can post my full script if helpful, but I found only these sections to be pertinent.
~Tya
Variable 15 will be set to something (say, 192), but it will be treated as if it were the first item in a || list. Checking the variable externally says that it is 192, but the script is treating it as 144 (the first number that appears). Can anyone let me know what I'm doing wrong?
Affected sections:
class Game_Interpreter def apply_gear optimalWeapon = 0 if $game_variables[15] == 144||145||146 optimalWeapon = 62 elsif $game_variables[15] == 147||148||149 optimalWeapon = 63 elsif $game_variables[15] == 150||151||152 optimalWeapon = 64 elsif $game_variables[15] == 153||154||155 optimalWeapon = 65 elsif $game_variables[15] == 156||157||158 optimalWeapon = 66 elsif $game_variables[15] == 159||160||161 optimalWeapon = 67 elsif $game_variables[15] == 162||163||164 optimalWeapon = 68 elsif $game_variables[15] == 165||166||167 optimalWeapon = 69 elsif $game_variables[15] == 168||169||170 optimalWeapon = 70 elsif $game_variables[15] == 171||172||173 optimalWeapon = 71 elsif $game_variables[15] == 174||175||176 optimalWeapon = 72 elsif $game_variables[15] == 177||178||179 optimalWeapon = 73 elsif $game_variables[15] == 180||181||182 optimalWeapon = 74 elsif $game_variables[15] == 183||184||185 optimalWeapon = 75 elsif $game_variables[15] == 186||187||188 optimalWeapon = 76 elsif $game_variables[15] == 189||190||191 optimalWeapon = 77 elsif $game_variables[15] == 192||193||194 optimalWeapon = 78 elsif $game_variables[15] == 195||196||197 optimalWeapon = 79 elsif $game_variables[15] == 198||199||200 optimalWeapon = 80 elsif $game_variables[15] == 201||202||203 optimalWeapon = 81 elsif $game_variables[15] == 204||205||206 optimalWeapon = 82 elsif $game_variables[15] == 207||208||209 optimalWeapon = 83 elsif $game_variables[15] == 210||211||212 optimalWeapon = 84 elsif $game_variables[15] == 213||214||215 optimalWeapon = 85 elsif $game_variables[15] == 216||217||218 optimalWeapon = 86 elsif $game_variables[15] == 219||220||221 optimalWeapon = 87 elsif $game_variables[15] == 222||223||224 optimalWeapon = 88 elsif $game_variables[15] == 225||226||227 optimalWeapon = 89 elsif $game_variables[15] == 228||229||230 optimalWeapon = 90 elsif $game_variables[15] == 231||232||233 optimalWeapon = 91 elsif $game_variables[15] == 234||235||236 optimalWeapon = 92 elsif $game_variables[15] == 237||238||239 optimalWeapon = 93 elsif $game_variables[15] == 240||241||242 optimalWeapon = 94 elsif $game_variables[15] == 243||244||245 optimalWeapon = 95 elsif $game_variables[15] == 246||247||248 optimalWeapon = 96 elsif $game_variables[15] == 249||250||251 optimalWeapon = 97 end
Code:
if $game_actors[$game_variables[13]].equips[0].template_id == $game_variables[16]#optimalWeapon optimalTrue = true plusApply = optimalWeapon + 145 else optimalTrue = false slashApply = optimalWeapon + 191 end if optimalTrue == true if $game_variables[15] == 144||147||150||153||156||159||162||165||168||171|| 174||177||180||183||186||189||192||195||198||201|| 204||207||210||213||216||219||222||225||228||231|| 234||237||240||243||246||249 if $game_actors[$game_variables[13]].equips[0].plus_id==0 set_plus($data_weapons[$game_actors[$game_variables[13]].equips[0].id], plusApply) $game_party.lose_item($data_armors[gearUsed], 1) $game_message.background = 0 $game_message.position = 2 $game_message.add("The weapon was upgraded!") else $game_message.background = 0 $game_message.position = 2 $game_message.add("The weapon is already at this level!") end
~Tya