Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Conditional Branch Problem

I made a steal money/exp event system for my game, but I came across
a problem illustrated in these pictures:

http://i107.photobucket.com/albums/m316 ... nshot1.png[/img]

http://i107.photobucket.com/albums/m316 ... nshot2.png[/img]

Elwood is at level 51 with an EXP Glove, which increases the chance of
stealing and doubles the EXP stolen, equipped.

See the problem? According to basic math, the lowest amount of EXP
potentially stolen is 200 (100*2), and there is a 100 percent chance
(1/1) of stealing it.

What did I do wrong when I made the conditional branches?
 
The last conditional Branch isn't necessary, you can put the "> 50" statements in the "<= 50"'s 'else' section.
But, it should work fine the way it is.

Can we see the Steal EXP event?
 
It looks like it should work, as long as Elvud has the glove 'Equipped'

What should happen if the glove isn't Equipped?

Here's what I would do first.
In the 'Else' section of "Steal EXP",  where you have  "Stole Nothing"
add 
Steal Factor: \v[4]
Steal Chance: \v[6]

If they're both '0', then the code in the Steal Factor event isn't getting executed.
Which should indicate that the Glove isn't actually 'Equipped'

I assume you still want the event to execute if the glove is not equipped, but only yield
half the amount of EXP.

Get rid of the first Conditional Branch in Steal Factor  ([Elvud] is [EXP Glove] Equipped)
Copy the Conditional branch right below it, and paste it outside of the one you want to delete.
Then, delete it.

Make sense?
 
Not really... could you elaborate a little more?

Below the EXP Glove is the SL(Money) Glove, then the No Glove.

Can you tell me exactly what to do and what you believe it will
do?

EDIT: I tried the \v[4] and \v[6] thing, and they do work, except
        they are amounts that would occur at level 1, not 51.
 
goldenryu9292":1ig7ole0 said:
The system thinks his level is zero...

NO, the system KNOWS the level is zero. The system is not sentient, and will NEVER "think" something that's not true.  :scruff:

Set the actor's level to 51 before entering battle.  Or, just for testing purposes, set the level to 51 at the top of your event.

Be Well
 
I tried that, and it didn't work, and even if it did, It would be of no help
because, using the skill in-game, I can't be changing the character's
level before every battle.

It seems that the variable is not changing to Elvud's level before the Steal
factor and Steal chance are decided by the event, because even if I
set his level to increase to 99, the variable is zero, so therefore, the
event is executeted as if he was level zero.

Brewmeister":1qgtzuns said:
goldenryu9292":1qgtzuns said:
The system thinks his level is zero...

NO, the system KNOWS the level is zero. The system is not sentient, and will NEVER "think" something that's not true.  :scruff:

And although the computer cannot "think" his level is zero, it is not checking
the level directly, but the variable. If the variable fails to get changed
for one reason or another, the computer will be "misinformed" and therefore
"know" incorrect information.

Now I want to know what to do to make sure the event doesn't
skip over, miss, fail to execute, or execute the variable incorrectly.
 
Well, since you are setting the variable to his level, that means the level is not getting set.

It could be a problem with the battle-test function, if you are setting the level there before testing the battle.
Did you try creating an event that sets the level, starts the battle, and using the regular playtest method instead of battletest?

I think at this point, we need someone with VX to take a look at your project.
I have the trial downloaded, I just haven't installed it yet.
If you want to upload your project somewhere, I'll install it & have a look.

Be Well
 
Now THAT sounds like a plan!

Yes, one of the first things I tried was setting an event. I figured it took too long, and I was too lazy to set up a TEST map, so I switched to Test Battle.

I'll upload it and PM you the link if that's okay. I have a demo uploaded, but It's compressed, so I'll have to upload a new one.
 
Ok, I got it to work.
Brewmeister":c5pdzck2 said:
There is a bug in Game_Interpreter.

Before line 750, add

    when 4  # Actor

then it works just peachy!

[ edit ]  oops,  then change line 751 from/to
[ edit again ] just delete that line, it doesn't do anything...

  #  actor = $game_actors[@parameters[1]]

For clarity, that section of code should look like...  (lines 748-752)
Code:    when 3  # Item
      value = $game_party.item_number($data_items[@params[4]])
    when 4  # Actor
      actor = $game_actors[@params[4]]
      if actor != nil
        case @params[5]
        when 0  # Level
          value = actor.level
etc....

I also copied the Scripts.rvdata file, after saving, back to
C:\Program Files\Enterbrain\RPGVX\System\Data
so I won't have to fix it everytime I start a new project.

Be Well

Thanks Brewmeister!
(Even though It wasn't in my topic)
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top