- Joined
- Jun 5, 2020
- Messages
- 8
- Reaction score
- 0
- First Language
- Italian
- Primarily Uses
- RMXP
Hi guys! I need some help to fix this trouble.
I'm scripting a Scene that simulates a wrestling pinfall.
During the action the player needs to push a button repeatedly, that adds one point of HP any time, to reach 30% of MAXHP to escape.
I have two problems:
- In time update I put percentage formula but it doesn't work. There's no difference if i write extended or not ($game_actors[1].hp / 100 * 30 )
- I need to stop time if the condition of 30% is reached
There is my script :
The result is... The game continue in the same way... With 0 or 100% HP
I'm scripting a Scene that simulates a wrestling pinfall.
During the action the player needs to push a button repeatedly, that adds one point of HP any time, to reach 30% of MAXHP to escape.
I have two problems:
- In time update I put percentage formula but it doesn't work. There's no difference if i write extended or not ($game_actors[1].hp / 100 * 30 )
- I need to stop time if the condition of 30% is reached
There is my script :
Code:
def time
@time += 1
case @time
when 100
@conteggio.bitmap = RPG::Cache.picture("3") rescue nil
end
case @time
when 50
@conteggio.bitmap = RPG::Cache.picture("2") rescue nil
end
case @time
when 0
@conteggio.bitmap = RPG::Cache.picture("1") rescue nil
end
if @time > 150
if $game_actors[1].hp >= 30%
$game_variables[5] += 1
$game_switches[1] = true
$game_map.need_refresh = true
$scene = Scene_Map.new
else $game_actors[1].hp <= 30%
$scene = Scene_Gameover.new
end
end
end
The result is... The game continue in the same way... With 0 or 100% HP
Last edited: