Properly selecting a random party member though d20

hawkEyeDguY

Warper
Member
Joined
May 7, 2018
Messages
3
Reaction score
0
First Language
English
Primarily Uses
RMMV
(This is my first post, so please let me know if I missed something here.) (Edition is MV)
I'm trying to put negative repercussions on party abilities. For this instance, random party members might be blinded by a light-based move.
I have a d20, a DiceRoll variable in a DiceRoll common event that sets the number from 1 to 20. That's simple enough.
The trick is trying to call on random party members to be blinded. You can see in the screenshot that I tried to make it a kind of descending "if d20 is less than or equal to", with an else branch for the result. I can't seem to get party member 1 to show up as a result, and the party member called on a roll of, say, 10, come up null/0.
Is there a better way of doing this, or do I simply need to move around my If branches? I think I might need to make exclusions somehow, but am not sure how to approach that, either.
D20issues.PNG
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
what numbers are set in your diceroll event?
 

hawkEyeDguY

Warper
Member
Joined
May 7, 2018
Messages
3
Reaction score
0
First Language
English
Primarily Uses
RMMV
The diceroll variable is randomized in a range of 1 to 20.
Edit: *whenever the DiceRoll common event is called
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
but have you done that correctly? because the event where you gave the screenshot from should work correctly, so the error has to be somewhere else.
(That event is a bit convoluted, it could have been done without the else-branches and less commands with a bit restructure and a goto label command, but it still works correctly as far as I can see).

So we need to see both what happens before and after that to check the rest of the logic.
 

hawkEyeDguY

Warper
Member
Joined
May 7, 2018
Messages
3
Reaction score
0
First Language
English
Primarily Uses
RMMV
I don't think the issue is here. How would Jump to Label help with this system? I've only really used labels with loops so far.
The test NPC I made to test the output says "The result of the dice roll was \v[1] (like, say, 10, refering to this event's result). The party member chosen was \v[2] (This one refers to the Random Party Member event, see OP). If \v[1]=10 \v[2] errors and defaults to 0).
Dicerollvariable+common.PNG
Edit: *A correct result would be something like "The result of the dice roll was 19. The party member chosen was 1 (referring to Actor ID)."
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
If \v[1]=10 \v[2] errors and defaults to 0).
That is the info you should have given us - an error is something else than just not getting the result.

It sounds as if there is a problem with the data of the actors in the party - how did you determine which actors gets added? by plugin or by event?
And check which actor that is in the database.

One more question: do you test this events after loading a saved file or after starting a new game? Test it with a new game (important!!!)

EDIT: and by the way, 10 results in actor of party #2, not #1
 

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

Latest Threads

Latest Posts

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,862
Messages
1,017,050
Members
137,571
Latest member
grr
Top