Sapphire Action System IV

However I have still one question how get this number to specific variable ?
@LynX


 



$game_variables[m]=$game_map.events[n].enemy.hp


Where m is the index of the variable you want to assign the data to.


Also, thanks Kyuukon, saves me the trouble of figuring it out myself  🙂 . I was just about to add a healthbar to a boss.
@LynX


 



$game_variables[m]=$game_map.events[n].enemy.hp


Where m is the index of the variable you want to assign the data to.


Also, thanks Kyuukon, saves me the trouble of figuring it out myself  🙂 . I was just about to add a healthbar to a boss.

Hmm its weird man I put in Enemies max Hp of this enemy like 10 and Im getting number 25 in variables... why ? 
Hmm odd... for me it worked like a charm. Are you sure you referring to the right event?
Hmm odd... for me it worked like a charm. Are you sure you referring to the right event?

Yeah it some bug i think from sas maybe I get the data too early. Because first of the Enemy is regular Autostart event which say something then he turn Selfswitch where there is Enemy setup hmm maybe that why. I put few 0,2 wait before gattering the data and working.
Btw, Kyoui is there a way to heal enemy? using this formula:
$game_map.events[x].damage_enemy(value)   ??
EDIT:


Ok I used this command... and it's working for healing enemy.


$game_map.events[1].enemy.hp += 1
Hi it's me again I have a question is there a way to get data from "Recover" count to the variable from hero ? 


by recover I mean the point where you cant attack use skills etc.
 
@LynX Do you mean the remaining recover time before you can cast the next spell?


An question of my own: is there a way to make an enemy/event cast a skill by script call?
@LynX Do you mean the remaining recover time before you can cast the next spell?


An question of my own: is there a way to make an enemy/event cast a skill by script call?

Yup but i started analissing the saphire code and finally figured out that it was a $game_variables[651]=$game_player.recover 
😛  Btw Kyoui did you find a way how to get life(to variable) from the enemy which was last attacked ? or this is impossibru 😀 ?
Hmm... that should be doable...


I'd say search for "perform_damage(char)" in the script and look under "else"


Just put the same  $game_variables[m]=$game_map.events[n].enemy.hp  under there I guess.


That way it'll updat the variable everytime you hit an enemy and it'll be set to that event's current hp.
Hmm... that should be doable...


I'd say search for "perform_damage(char)" in the script and look under "else"


Just put the same  $game_variables[m]=$game_map.events[n].enemy.hp  under there I guess.


That way it'll updat the variable everytime you hit an enemy and it'll be set to that event's current hp.

ok I find something like this but...

 for event in $game_map.enemies
        if (event.px - px).abs < event.cx && (event.py - py).abs < event.cy
          next if event.enemy.static
          perform_damage(event) and $game_variables[651]=$game_map.events[event].enemy.hp

but it didnt take the enemy hp to the variable actualy it did nothing 🙁
I was talking about this part of the script


def perform_damage(char)
if @cast_by_enemy
actor = $game_actors[1]
already_dead = actor.dead?
actor.add_state(@state)
$game_temp.reserve_common_event(@common)
actor.perform_collapse_effect if actor.dead? and !already_dead
actor.result.clear
char.animation_id = @skill.animation_id
char.set_direction(10-@direction)
damage = @power + @skill.power
damage += rand(damage*Sapphire_Core:😀amage_Random).to_i
$game_player.skill_damage_hero(damage)
else
char.animation_id = @skill.animation_id unless char.enemy.object
$game_temp.reserve_common_event(@common)
damage = @power + @skill.power
damage += rand(damage*Sapphire_Core:😀amage_Random).to_i
char.skill_damage_enemy(damage,true) unless char.enemy.skl_invincible


So the change i would make to that would then be:


def perform_damage(char)
if @cast_by_enemy
actor = $game_actors[1]
already_dead = actor.dead?
actor.add_state(@state)
$game_temp.reserve_common_event(@common)
actor.perform_collapse_effect if actor.dead? and !already_dead
actor.result.clear
char.animation_id = @skill.animation_id
char.set_direction(10-@direction)
damage = @power + @skill.power
damage += rand(damage*Sapphire_Core:😀amage_Random).to_i
$game_player.skill_damage_hero(damage)
else
char.animation_id = @skill.animation_id unless char.enemy.object
$game_temp.reserve_common_event(@common)
damage = @power + @skill.power


$game_variables[m]=$game_map.events[n].enemy.hp


damage += rand(damage*Sapphire_Core:😀amage_Random).to_i
char.skill_damage_enemy(damage,true) unless char.enemy.skl_invincible


Not sure if this works since i don't have time to try it but I imagine i would look somewhat like this.
I was talking about this part of the script



def perform_damage(char)
if @cast_by_enemy
actor = $game_actors[1]
already_dead = actor.dead?
actor.add_state(@state)
$game_temp.reserve_common_event(@common)
actor.perform_collapse_effect if actor.dead? and !already_dead
actor.result.clear
char.animation_id = @skill.animation_id
char.set_direction(10-@direction)
damage = @power + @skill.power
damage += rand(damage*Sapphire_Core:😀amage_Random).to_i
$game_player.skill_damage_hero(damage)
else
char.animation_id = @skill.animation_id unless char.enemy.object
$game_temp.reserve_common_event(@common)
damage = @power + @skill.power
damage += rand(damage*Sapphire_Core:😀amage_Random).to_i
char.skill_damage_enemy(damage,true) unless char.enemy.skl_invincible


So the change i would make to that would then be:



def perform_damage(char)
if @cast_by_enemy
actor = $game_actors[1]
already_dead = actor.dead?
actor.add_state(@state)
$game_temp.reserve_common_event(@common)
actor.perform_collapse_effect if actor.dead? and !already_dead
actor.result.clear
char.animation_id = @skill.animation_id
char.set_direction(10-@direction)
damage = @power + @skill.power
damage += rand(damage*Sapphire_Core:😀amage_Random).to_i
$game_player.skill_damage_hero(damage)
else
char.animation_id = @skill.animation_id unless char.enemy.object
$game_temp.reserve_common_event(@common)
damage = @power + @skill.power


$game_variables[m]=$game_map.events[n].enemy.hp


damage += rand(damage*Sapphire_Core:😀amage_Random).to_i
char.skill_damage_enemy(damage,true) unless char.enemy.skl_invincible


Not sure if this works since i don't have time to try it but I imagine i would look somewhat like this.

Thanks man Im gonna dig a little with it. Hover I thinkt the main problem is the "[n]" maybe there should be diffrent value.
Oh , I thought i changed it to char... whoops...  😛


But tbh i'm also not sure if char works but it seemded to be the most logical one to try out.


$game_variables[m]=$game_map.events[char].enemy.hp


Would be my guess then.
I
Another pic of how it looks.
Can anyone help me to create skill that heal myself. Im using that sapphire action system. I dont know much things so if u guys can help me i would be grateful
How do I make a heal skill in this script?
here is a thing with this awsome system! but there is a issue if you stand in middle of to events thanks by the full pixel movement!


both events will trigger! is there a way it can only trigger once or i can make a event longer then 32 x 32 pixels.


like 96 x 32 pix long event? how can i do that
How do i add a heal skill? It crashes when i open the menu with a heal skill.

Original thread: https://forums.rpgmakerweb.com/threads/sapphire-action-system-iv.4918/