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,331
Reaction score
11,754
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 Posts

Latest Profile Posts

Made a showcase, guide, and tutorial to using GENE Scene Builder with RPG Maker MV :kaoslp:

For a long time I always consider XP soundtracks as the best one.
Just listened to some of MZ tracks from the free version.
It's... Quite mindblowing. xD
Only listened to the battles, towns, and fields.
But I'm sure the rest are equally good. :D
What do you guys want to see for the new Jump into Javascript? A continuation of the rpg_objects, or would you prefer a "lesson 0" where I go back to the absolute basics of Javascript and cover the fundamentals of the language and its construction?
Hey RPG members!!

How do you finish projects? Some new game developers start off strong but end up losing momentum. What keeps you motivated while working on new projects?
Feeling wee sleepy.. ZzzZ

Forum statistics

Threads
112,454
Messages
1,068,398
Members
146,114
Latest member
HeitorFull
Top