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

Rakon wrote on xizorandy's profile.
Hello! I found a post of lightning strike pictures you posted. You said you made them, am I allowed to use them in my commercial project. Would be really cool!^^
evhht2zr.png

Have a nice day!
It's almost 3 month and this piece of drawing is still not finished yet.
aaaa.jpg

Really busy with other stuffs like commission and coping with personal problem.
Stella & Elyune, maybe used for promotional art if my game project finished one day.
My ex put my heart upon a self he said don't give me no lines and keep my hands to myself :,(
An Old... old Harold | RPG Maker News #71

Forum statistics

Threads
112,249
Messages
1,066,822
Members
145,856
Latest member
garima
Top