panpaper

Villager
Member
Joined
Jun 26, 2014
Messages
11
Reaction score
0
First Language
English
Primarily Uses
First off I want to say thank you, this community has been amazing, with all the helpful and swift responses!

I'm trying to implement a sidearm where the player can use a gun as a secondary weapon. In order to use the gun, the player must "consume" an ammunition item from the inventory. Doing so will grant them the "locked and loaded" state.

The "locked and loaded" states gives access to the "Gun" skill type. The player will then be able to use the skill "Open fire". When the skill "Open fire" is used, I want the state "locked and loaded" to be removed, so that the player must consume another ammunition item before they can use "Open fire" again. The following image shows the State and Skill entry:

Untitled.png
I've listed "Remove State - Locked and Loaded 100%" as the skill effect for "Open Fire", but the state never gets removed when the skill is used (I can still see the icon beside the player's name). I know I can probably add "seal skill type" to "Open fire", but I want to know what I've done wrong, so I can avoid such mistakes again.

Thanks in advance!
 

LadyBaskerville

Hell-poodle
Veteran
Joined
Sep 12, 2016
Messages
645
Reaction score
531
First Language
German
Primarily Uses
RMMV
The effects are applied to the skill's target, not the user - that's why the state isn't removed from your actor. To change the user's state, you can use the damage formula (which can also evaluate Javascript commands):

a.removeState(STATE_ID); 25

This will remove the state from the user (a), and then deal 25 damage. (When using the damage formula for things like this, the last line - what's written after the last semicolon - will always be the actual damage value.)
 

panpaper

Villager
Member
Joined
Jun 26, 2014
Messages
11
Reaction score
0
First Language
English
Primarily Uses
The effects are applied to the skill's target, not the user - that's why the state isn't removed from your actor. To change the user's state, you can use the damage formula (which can also evaluate Javascript commands):

a.removeState(STATE_ID); 25

This will remove the state from the user (a), and then deal 25 damage. (When using the damage formula for things like this, the last line - what's written after the last semicolon - will always be the actual damage value.)
I completely overlooked that! This clears up this issue and opens some other possibilites, thank you very much!
 

panpaper

Villager
Member
Joined
Jun 26, 2014
Messages
11
Reaction score
0
First Language
English
Primarily Uses
The effects are applied to the skill's target, not the user - that's why the state isn't removed from your actor. To change the user's state, you can use the damage formula (which can also evaluate Javascript commands):

a.removeState(STATE_ID); 25

This will remove the state from the user (a), and then deal 25 damage. (When using the damage formula for things like this, the last line - what's written after the last semicolon - will always be the actual damage value.)

I could not find this function in the help and documentation. Is there a reference list of all the functions I can put in the formula box?
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,315
Reaction score
11,737
First Language
English
Primarily Uses
RMVXA
[dpost]panpaper[/dpost]
Actually it's a triple post. If you want to add something, simply edit your earlier post. If you want to quote more than one person, use the Multi-quote option and then you can insert a quote, reply to it, insert the next quote and reply to that and repeat as often as necessary.

Actually, it is often better not to quote (especially whole quotes, which makes it more difficult for those accessing this on their phones) and instead just tag the person by typing @ followed by the username. A dropdown list appears, and you select the person you want.
 

panpaper

Villager
Member
Joined
Jun 26, 2014
Messages
11
Reaction score
0
First Language
English
Primarily Uses
@Kes sorry I did not know that. I'll take note from now on, thanks!
 

Latest Threads

Latest Profile Posts

Took a small break by playing VR. Latest update of these glasses unfortunately caused a little of trouble but it can be fixed with a manual operation.

Until You Fall is freaking awesome.
I am SO HYPED to share this trailer with everyone when its done. I almost want to tear up i had no idea how far i came along with Fallen Feather in these last 3 years.
how it looks from the top
Hike was successful guys! I made it to the top!
Add Film-like Visual Effects During Test-Play, Deploy Games with Electron | RPG Maker News #69

Forum statistics

Threads
112,187
Messages
1,066,455
Members
145,787
Latest member
LaVeyan
Top