Darkskull

Veteran
Veteran
Joined
Sep 14, 2016
Messages
95
Reaction score
15
First Language
English
Primarily Uses
Hey all! I'm not certain if this can be done with or without the use of .js, so for now this question will be asked here. If it turns out that .js scripts are the only way to do what I'm looking for, I'll ask a moderator to move the topic.

So! I'm looking to have an RNG mechanic in my game. That is, when a certain event occurs, one of the (alive) party members has something happen to them randomly.

For instance, let us say "Fred" is in position 2 in the party.

"Fred has dysentery"

A message box would pop up, and Fred, having randomly been selected, gains a state and has his health lowered.

Do you know a way to do this with the base game that I'm just not seeing? Affecting party members based on selecting a random living member of the party?
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,159
Reaction score
10,738
First Language
Czech
Primarily Uses
RMMV
$gameParty.members()[slot - 1, because they begin from 0].addState (whatever).
Then you'd also do \P[1] or \P[2] in the message box to display his name.
 

Darkskull

Veteran
Veteran
Joined
Sep 14, 2016
Messages
95
Reaction score
15
First Language
English
Primarily Uses
@Poryg

Awesome!

What would be the code for changing HP/MP/A variable? :)
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,159
Reaction score
10,738
First Language
Czech
Primarily Uses
RMMV
$gameParty.members()[0]._hp = x;
mp is similar
$gameVariables.setValue(id, value)
 

Darkskull

Veteran
Veteran
Joined
Sep 14, 2016
Messages
95
Reaction score
15
First Language
English
Primarily Uses
Thank you! That's just about it I think. Awesome :)

Edit: Does anything weird happen if the chosen actor is already dead?
 

Latest Threads

Latest Profile Posts

Is RPG Maker VX (rgss2) still relevant? xD
ZyCHqk2.png

Something about top-downs.
I have never felt so attacked by a tree before :LZSlol: it took 10++ hours to make but at least it looks pretty LOL

Untitled-1.png
now seems like the worst time for me to need a better computer with how much stuff is costing. that and I don't thing there's much else I can do to make MV run any better with what I have.
Sigh... to have some variety in this weather. More than just sun and rain and wind and thunder.
In the meantime, I've discovered that I'm slowly becoming fatigued from the many sleepless nights my neighbors cause. Or at least their dogs. Always barking at something.
I might need a day to just sleep and recharge.

Forum statistics

Threads
118,454
Messages
1,116,101
Members
155,435
Latest member
Lucifersatan2
Top