LynX

Veteran
Veteran
Joined
Jan 6, 2014
Messages
83
Reaction score
8
First Language
Polish
Primarily Uses
However I have still one question how get this number to specific variable ?
 

kyoui

Villager
Member
Joined
Feb 3, 2015
Messages
15
Reaction score
9
First Language
Dutch
Primarily Uses
RMVXA
@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

Veteran
Veteran
Joined
Jan 6, 2014
Messages
83
Reaction score
8
First Language
Polish
Primarily Uses
@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 ? 
 

kyoui

Villager
Member
Joined
Feb 3, 2015
Messages
15
Reaction score
9
First Language
Dutch
Primarily Uses
RMVXA
Hmm odd... for me it worked like a charm. Are you sure you referring to the right event?
 
Last edited by a moderator:

LynX

Veteran
Veteran
Joined
Jan 6, 2014
Messages
83
Reaction score
8
First Language
Polish
Primarily Uses
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.
 

LynX

Veteran
Veteran
Joined
Jan 6, 2014
Messages
83
Reaction score
8
First Language
Polish
Primarily Uses
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
 
Last edited by a moderator:

LynX

Veteran
Veteran
Joined
Jan 6, 2014
Messages
83
Reaction score
8
First Language
Polish
Primarily Uses
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.
 
 
Last edited by a moderator:

kyoui

Villager
Member
Joined
Feb 3, 2015
Messages
15
Reaction score
9
First Language
Dutch
Primarily Uses
RMVXA
@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

Veteran
Veteran
Joined
Jan 6, 2014
Messages
83
Reaction score
8
First Language
Polish
Primarily Uses
@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 
:p  Btw Kyoui did you find a way how to get life(to variable) from the enemy which was last attacked ? or this is impossibru :D ?
 

kyoui

Villager
Member
Joined
Feb 3, 2015
Messages
15
Reaction score
9
First Language
Dutch
Primarily Uses
RMVXA
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.
 
Last edited by a moderator:

LynX

Veteran
Veteran
Joined
Jan 6, 2014
Messages
83
Reaction score
8
First Language
Polish
Primarily Uses
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 :(
 

kyoui

Villager
Member
Joined
Feb 3, 2015
Messages
15
Reaction score
9
First Language
Dutch
Primarily Uses
RMVXA
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::Damage_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::Damage_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::Damage_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::Damage_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.
 

LynX

Veteran
Veteran
Joined
Jan 6, 2014
Messages
83
Reaction score
8
First Language
Polish
Primarily Uses
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::Damage_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::Damage_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::Damage_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::Damage_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.
 

kyoui

Villager
Member
Joined
Feb 3, 2015
Messages
15
Reaction score
9
First Language
Dutch
Primarily Uses
RMVXA
Oh ****, I thought i changed it to char... whoops...  :p


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.
 
Last edited by a moderator:
Joined
Jul 15, 2012
Messages
61
Reaction score
9
First Language
Swedish
Primarily Uses
RMMV
Another pic of how it looks.
 
Last edited by a moderator:

bersauron

Warper
Member
Joined
Aug 13, 2016
Messages
3
Reaction score
1
First Language
Turkish
Primarily Uses
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
 

ALEXjo.

Warper
Member
Joined
Oct 23, 2016
Messages
3
Reaction score
0
First Language
Swedish
Primarily Uses
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
 

Mooshry

BTS has consumed my very existence help.
Veteran
Joined
May 30, 2016
Messages
465
Reaction score
152
First Language
English
Primarily Uses
RMMV
How do i add a heal skill? It crashes when i open the menu with a heal skill.
 

Latest Threads

Latest Posts

Latest Profile Posts

Made a title screen, and by ''made'' I ofc mean I slapped a simple title on some cool art I bought xD This side project might be fun.

sIMPLE.png
CDF.png

Trying for a Classical RPG with Pokemon Elements. Capture monsters like Zombies and Harpys and use them on your team.
ow28O4A.png

Astarte in her usual demeanor: mocking people.
45% off MZ on Steam. Just in case some are like me and never check for that stuff :)
I was surprised to see a email from Safeway that my grocery have been delivered when they have not. The email was a noreply message. So enjoy the $88 of free food random person.

Forum statistics

Threads
129,870
Messages
1,205,813
Members
171,041
Latest member
Herdoxer
Top