- Joined
- Oct 15, 2015
- Messages
- 31
- Reaction score
- 3
- First Language
- Eng
- Primarily Uses
- N/A
Hey guys, thank you in advance for the help.
I've reworked quite intensively SAS IV script from Khas, but I can't figure out one thing.
I need enemies to get damaged when they are in proximity of a ''bomb'' that's exploding.
We have the bomb (the icon gets placed when the player presses CTRL and goes 2 tiles ahead of the character, in the direction he's facing).
The bomb's coord are then stored in the variables 791 and 792.
After 2-3 seconds the bomb explodes.
if (Keys.trigger?
L_CTRL))
if !$game_switches[997]
if !$game_switches[996]
if $game_switches[739]
$game_temp.reserve_common_event(102)
case $game_player.direction
when 2
$game_map.screen.pictures[1].show("[fixed]keg.png", 1, $game_player.x * 32, $game_player.y * 32, 100, 100, 255, 0)
$game_map.screen.pictures[1].move(1, $game_player.x * 32, ($game_player.y * 32) + 64, 100, 100, 255, 0, 15)
$game_variables[791]=$game_player.x
$game_variables[792]=$game_player.y + 2
when 4
$game_map.screen.pictures[1].show("[fixed]keg.png", 1, $game_player.x * 32, $game_player.y * 32, 100, 100, 255, 0)
$game_map.screen.pictures[1].move(1, ($game_player.x * 32) - 64, $game_player.y * 32, 100, 100, 255, 0, 15)
$game_variables[791]=$game_player.x - 2
$game_variables[792]=$game_player.y
when 6
$game_map.screen.pictures[1].show("[fixed]keg.png", 1, $game_player.x * 32, $game_player.y * 32, 100, 100, 255, 0)
$game_map.screen.pictures[1].move(1, ($game_player.x * 32) + 64, $game_player.y * 32, 100, 100, 255, 0, 15)
$game_variables[791]=$game_player.x + 2
$game_variables[792]=$game_player.y
when 8
$game_map.screen.pictures[1].show("[fixed]keg.png", 1, $game_player.x * 32, $game_player.y * 32, 100, 100, 255, 0)
$game_map.screen.pictures[1].move(1, $game_player.x * 32, ($game_player.y * 32) - 64, 100, 100, 255, 0, 15)
$game_variables[791]=$game_player.x
$game_variables[792]=$game_player.y - 2
end
end
end
end
end
But I have to resort to a Common Event Call to do the actual damage, and to have it work I need to place a ''call common event'' inside every enemy, running in parallel process.
Common Event
Command in Enemy (the ''Boom'' switch gets turned ON during the explosion, then it goes back OFF)
It would be 200 times better if I could implement it all in the SAS IV Script, so that I wouldn't have all the enemies call for the common event.
If anyone would be so kind to lend me a hand I would be verily inclined to pay for it
I've reworked quite intensively SAS IV script from Khas, but I can't figure out one thing.
I need enemies to get damaged when they are in proximity of a ''bomb'' that's exploding.
We have the bomb (the icon gets placed when the player presses CTRL and goes 2 tiles ahead of the character, in the direction he's facing).
The bomb's coord are then stored in the variables 791 and 792.
After 2-3 seconds the bomb explodes.
if (Keys.trigger?
if !$game_switches[997]
if !$game_switches[996]
if $game_switches[739]
$game_temp.reserve_common_event(102)
case $game_player.direction
when 2
$game_map.screen.pictures[1].show("[fixed]keg.png", 1, $game_player.x * 32, $game_player.y * 32, 100, 100, 255, 0)
$game_map.screen.pictures[1].move(1, $game_player.x * 32, ($game_player.y * 32) + 64, 100, 100, 255, 0, 15)
$game_variables[791]=$game_player.x
$game_variables[792]=$game_player.y + 2
when 4
$game_map.screen.pictures[1].show("[fixed]keg.png", 1, $game_player.x * 32, $game_player.y * 32, 100, 100, 255, 0)
$game_map.screen.pictures[1].move(1, ($game_player.x * 32) - 64, $game_player.y * 32, 100, 100, 255, 0, 15)
$game_variables[791]=$game_player.x - 2
$game_variables[792]=$game_player.y
when 6
$game_map.screen.pictures[1].show("[fixed]keg.png", 1, $game_player.x * 32, $game_player.y * 32, 100, 100, 255, 0)
$game_map.screen.pictures[1].move(1, ($game_player.x * 32) + 64, $game_player.y * 32, 100, 100, 255, 0, 15)
$game_variables[791]=$game_player.x + 2
$game_variables[792]=$game_player.y
when 8
$game_map.screen.pictures[1].show("[fixed]keg.png", 1, $game_player.x * 32, $game_player.y * 32, 100, 100, 255, 0)
$game_map.screen.pictures[1].move(1, $game_player.x * 32, ($game_player.y * 32) - 64, 100, 100, 255, 0, 15)
$game_variables[791]=$game_player.x
$game_variables[792]=$game_player.y - 2
end
end
end
end
end
But I have to resort to a Common Event Call to do the actual damage, and to have it work I need to place a ''call common event'' inside every enemy, running in parallel process.
Common Event
Command in Enemy (the ''Boom'' switch gets turned ON during the explosion, then it goes back OFF)
It would be 200 times better if I could implement it all in the SAS IV Script, so that I wouldn't have all the enemies call for the common event.
If anyone would be so kind to lend me a hand I would be verily inclined to pay for it
Last edited by a moderator:
