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,318
Reaction score
11,740
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

Come join us while we play Pocket Mirror by Astral Shift! :LZSjoy: Starting at 2PM ET today!
Tried changing profile icon but...It just felt weird, you know? Who would even want to talk to me if I didn't have this fat yellow rodent thing....Or whatever it is as a mascot....No one, that's who! I am nothing without it. NOTHING!!..
I am having such a good hair day but because it's thunderstorms all day I don't go out and as such nobody will see my hair >.< It's not often my hair cooperates!
Pretty much stopped posting in the progress thread cuz it feels like talking to the void, lol, so I've just been posting on IG instead. But someone finally liked my post there, lol. Dunno if I'll continue tho. Probably not xD

My game's progressing quite well. Just kinda stuck on mapping right now. Decided to go the side, slightly top down view route. I'm drawing everything from scratch for a personal touch uwu
Stomach isn't feeling too good last time. Perhaps something I ate

Forum statistics

Threads
112,337
Messages
1,067,533
Members
145,978
Latest member
KSAvagePenguin
Top