Question about Calling common event using "Effects" in a skill

hardqueen

Crazy Talker
Veteran
Joined
Oct 26, 2015
Messages
78
Reaction score
15
First Language
Chinese
I am trying to create a skill.

It is easy to call a common event using the built-in Effects setting.

Although in the Formula, a stands for the user who performing the skill,

how do I pass "a" to the common event?

Speaking in detail,

I want my hero to perform a skill that damage two enemies' HP and at the same time kill herself/himself.

I set "scope" to 2 random enemies and enter "a.hp" in the Formula.

The two enemies are damaged by a.hp.

However, my hero do not die.

So, I want to call a common event to call "Change state" to set my hero to "Die".

But I can not figure it out how to let the common event know which hero I am pointing to.

(There are four heroes in the party. They all can perform that skill)

Thanks for your help and ideas.
 

Smelipanda

Veteran
Veteran
Joined
Oct 25, 2015
Messages
40
Reaction score
37
First Language
English
Try putting "a.addState(1) : a.hp" in the effect field and see if it works
 
Last edited by a moderator:

hardqueen

Crazy Talker
Veteran
Joined
Oct 26, 2015
Messages
78
Reaction score
15
First Language
Chinese
It did not work, Smelipana.

I think the reason is that the calculation of damage is at the last, so addState(1) makes my hero's hp become 0, so a.hp = 0. Therefore, the enemies will not be hurt because the damage is 0.
 

Nuhada

Villager
Member
Joined
Oct 26, 2015
Messages
27
Reaction score
14
First Language
French
Put a ";" instead of a ":", the ":" is the "else" of the conditions.

So

a.addState(1); a.hpYou can do a lot of things with the formula box :)
 

Smelipanda

Veteran
Veteran
Joined
Oct 25, 2015
Messages
40
Reaction score
37
First Language
English
good call, @Nuhada, i hit the wrong semi-colon/colon <3
 

hardqueen

Crazy Talker
Veteran
Joined
Oct 26, 2015
Messages
78
Reaction score
15
First Language
Chinese
It did not work, even after I corrected the ":" mistake according to Nuhada.

I think the reason is that the calculation of damage is at the last, so addState(1) makes my hero's hp become 0, so a.hp = 0. Therefore, the enemies will not be hurt because the damage is 0.
 

Smelipanda

Veteran
Veteran
Joined
Oct 25, 2015
Messages
40
Reaction score
37
First Language
English
By chance, could you offload the a.hp into a variable? im not as familiar with trying that yet, but that seems like the most plausible solution. Maybe Nuhada might know? If not ill look but that seems like the most likely fix for your problem
 

Nuhada

Villager
Member
Joined
Oct 26, 2015
Messages
27
Reaction score
14
First Language
French
Try

r=a.hp; a.gainHp(-r);rHp stocked into the variable r, deduce Hp to the player (so death), and do damages. You can replace the "a.gainHp(-r)" by "a.addState(1)", but i just don't like this like this :p
 

hardqueen

Crazy Talker
Veteran
Joined
Oct 26, 2015
Messages
78
Reaction score
15
First Language
Chinese
Thank you Nuhada. That works fine and I have learned a new skill.,!
 

Smelipanda

Veteran
Veteran
Joined
Oct 25, 2015
Messages
40
Reaction score
37
First Language
English
i didnt relize it was as easy as just declaring it a variable letter!!! GAHH lol. i thought you would have to use a game.variable or something more complicated! thanks!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,040
Messages
1,018,472
Members
137,822
Latest member
madelbylz
Top