Make items do different things depending on actor status.

Status
Not open for further replies.

Munty

Villager
Member
Joined
Sep 9, 2013
Messages
13
Reaction score
1
Primarily Uses
I'll start this off by saying that this probably needs a script, but I thought I'd try here first anyway.

So onto the question:

Is there any way to make an item do different things depending on actor status? For example I have an antidote, and give it to actor 1. If actor 1 is poisoned, I want him cured, but if actor 1 is not poisoned, I want him blinded (or some other status effect).

So is this possible? Is there a script I need that someone has already made? Or should I just ask in the script request forum?

Thanks,

 - Galdric
 

Hollow

(◡‿◡✿)
Veteran
Joined
Jul 14, 2012
Messages
519
Reaction score
439
First Language
English
Primarily Uses
RMMV
You should have the item call a common event, and in that common event you can set up a conditional branch that checks whether or not the user is poisoned. No scripts needed!  :)
 

Munty

Villager
Member
Joined
Sep 9, 2013
Messages
13
Reaction score
1
Primarily Uses
Right, that'll work. I didn't even think about common events. :blush:

Thanks :D
 

Munty

Villager
Member
Joined
Sep 9, 2013
Messages
13
Reaction score
1
Primarily Uses
Gah, how do I tell the common event which actor to affect?
 
Last edited by a moderator:

Hollow

(◡‿◡✿)
Veteran
Joined
Jul 14, 2012
Messages
519
Reaction score
439
First Language
English
Primarily Uses
RMMV
Sorry, I didn't even think about that before! :(  Make a state and call it "Using Antidote" or something and make the item apply the state. Then in the common event, make conditional branches for each actor to check and see if they have the "Using Antidote" state applied. If they do, then you can run the poison conditional branch. At the end of the common event, remove the "Using Antidote" state from the entire party.
 
Last edited by a moderator:

Munty

Villager
Member
Joined
Sep 9, 2013
Messages
13
Reaction score
1
Primarily Uses
Well it works... it's just kind of time consuming to do... (currently  I have something like 10 different status changes, for at least 5 actors :( )

It'll work, but I think I'll put in a script request as well... (It would be so much more convenient to be able toto add a note to the item saying something like <if normal add.state poison> and have it do all the work. Be less room for me to miss out an actor as well >_> )

Thanks for the help Hollow :)
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
on your item, make it have a scope of one something, then put something like this in the damage formula

$game_variables[x] = b.actor_id

then on your CE, just use the variable option for the actor selection

OR

if it's just one or two states, maybe the formula box itself will suffice?
 
Last edited by a moderator:

Celianna

Tileset artist
Veteran
Joined
Mar 1, 2012
Messages
10,557
Reaction score
5,592
First Language
Dutch
Primarily Uses
RMMV
Munty, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.
 

Munty

Villager
Member
Joined
Sep 9, 2013
Messages
13
Reaction score
1
Primarily Uses
on your item, make it have a scope of one something, then put something like this in the damage formula

$game_variables[x] = b.actor_id

then on your CE, just use the variable option for the actor selection

OR

if it's just one or two states, maybe the formula box itself will suffice?
I wouldn't know how to set states in the formula box, but it would only be 2 states. I'm pairing things together, such as Sedative to remove Berserk or put you to sleep if you are not Berserk, and Hyper to wake you up or make you Berserk if you are not asleep.

I tried putting $game_variables[6] = b.actor_id into the formula box, but it didn't seem to do anything. (Variable 6 was always 0 according to the conditionals)
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Did your item have a target? if it has then it should at least return the id of that target...

anyway, 

you can do like

if b.state?(id for berserk) ? b.remove_state(id for berserk) : b.add_state(id for sleep) ; nil
 

Munty

Villager
Member
Joined
Sep 9, 2013
Messages
13
Reaction score
1
Primarily Uses
Did your item have a target? if it has then it should at least return the id of that target...

anyway, 

you can do like

if b.state?(id for berserk) ? b.remove_state(id for berserk) : b.add_state(id for sleep) ; nil
I've just tried that out, and it works. Neat.

One thing though, you need to add an end to the end of that line otherwise it throws an error, so:

if b.state?(30) ? b.remove_state(30) : b.add_state(6) ; nil endIt's a nice and simple way to do it. 

Thanks adiktuzmiko!
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

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

Latest Threads

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,867
Messages
1,017,062
Members
137,575
Latest member
akekaphol101
Top