Announcement

Collapse
No announcement yet.

I need variable help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    I need variable help

    I made a dojo with a sensei that asks if you want to spar. if you say yes he sets var 01 to 0 and says go defeat 3 students. If you defeat 3, you should get a small stat bonus. but there are 4 students, and if you defeat all four, you will get a message saying that you exceeded his expectations, and you will get a better bonus.

    Here is the problem: I made it so that if you beat less than three he will just reset the whole event, like it never happened. but when i beat three students, it went straight to the "exceeded expectations" part. here is the VCB I put on the very beginning of his script

    shared var 01 VCB
    3 options
    <=2
    =3
    >=4

    option 1:
    mod shared var 01 = 0
    ask all the stuff he asks, etc.

    option 2:
    Very well done. I am impressed!
    add STR 15
    mod shared var 01 = 0

    option 3:
    you exceeded my expectations! well done!!
    add STR 15
    add AGI 10
    mod shared var 01 = 0

    Please tell me why it skips option 2!!!!
    P.S. I am going now to check thos variable and I may be wrong about what they are set to, but what I said happens is what i need help with.

    P.P.S. dont flame me, I'm new on this site and kinda new at RPG maker 3.
    http://i208.photobucket.com/albums/b...diumBattle.gif
    This picture is way to big for a sig (linked instead)

    yeah, I made that!!! message me about this to get your own!!!!! ( I have 2 mini animations so far that are rather funny.)

    #2
    Re: I need variable help

    P.P.S. dont flame me, I'm new on this site and kinda new at RPG maker 3.
    Don't worry, no one would ever think of flaming you. we were all new at some point.



    Comment


      #3
      Re: I need variable help

      What are you doing with the variable upon beating each student?

      Are you modifying it, or increasing it?

      I'm assuming that you're increasing the variable by 1 increment for each student that you beat. As I understand it:

      Beat first student - shared variable 01 is changed to 1
      if you go back to the sensei at this point, he will modify variable 01 back to 0 again, and then you need to beat the students all over again.

      Beat second student - shared variable 01 is changed to 2
      If you back to the sensei point, he will modify variable 01 back to 0 again, and then you need to beat the students all over again.

      Beat third student - shared variable 01 is changed to 3
      If you go back to the sensei at this point, he will give you 15 STR and modify shared variable 01 back to 0 again.

      Beat fourth student - shared variable 01 is changed to 4
      If you go back to the sensei at this point, he will give you 15 STR and 10 AGI and modify shared variable 01 back to 0 again.

      Is this what is supposed to happen?


      -If it is, here are some suggestions/questions-

      -After you beat each student in Playtest mode, bring up the menu that allows you to see the shared variables, and just check that they are being modified by the right quantity. This is probably the reason why the second choice in the variable branch isn't being triggered correctly.

      Also, what have you programmed to happen after three (or more than three) students are beaten? Does each student's display turn off after beating him/her? As it stands now, it seems that you could keep going back and beating more and more students to keep increasing your STR (and AGI) stats.


      I'm sure others on here will have some valuable input for you too. Have a great day, and welcome to the Pav.
      Last edited by Pagerron; 06-26-2007, 12:42 PM.
      " I am the way, the truth, and the life. No one comes to the Father but by me. " - Jesus

      Comment


        #4
        Re: I need variable help

        Welcome to the pavilion!
        Are you making the code on each student variable + 1? Check for an variable = somewhere, that would cause the problem. This code looks fine so it's probably a student tripping you up.
        EDIT: My point is pretty much page's except not as detailed. Use that. Oh! Are you using two variables? Your design calls for two, and if you only have one I can see it being problematic.
        Last edited by hitogoroshi; 06-26-2007, 12:37 PM.

        Comment


          #5
          Re: I need variable help

          Here's how I would go about doing this...

          Variable 1 = Have we gotten the "beat students" quest yet? If it equals 0, we haven't. If it equals 1, then we've talked to Mr. Sensai already.

          Variable 2 = Number of students beaten.

          Sensai Event
          Val Condition Branch - 2 Options
          . Option 1 - Variable 1 = 0
          . . Message [Sensai tells us what to do.]
          . . Increase Variable 1 by 1
          . . Modify Variable 2 so it = 0
          . . End Event
          . Option 2 - Variable 1 = 1
          . Val Condition Branch - 3 Options
          . . Option 1 - Variable 2 is less than 3
          . . . Message "You could use some practice." (You beat 1 or 2 students)
          . . . Modify Variable 1 so it = 0
          . . . End Event
          . . Option 2 - Variable 2 = 3
          . . . Message "You did great!" (You beat 3 students)
          . . . Give bonus
          . . . Modify Variable 1 so it = 0
          . . . End Event
          . . Option 3 - Variable 2 = 4
          . . . Message "Awesome! You are totally rad, man!" (You beat 4 students)
          . . . Give bonuses
          . . . Modify Variable 1 so it = 0
          . . . End Event
          . . Message "I already told you what to do."
          . . End Event

          Here's how it works. If you talk to Mr. Sensai once, he tells you what you have to do. Var 2 (number of students beaten) is reset to zero. Var 1 (have we gotten quest yet?) is set to 1. If you talk to Mr. Sensai a second time before confronting a student, Mr. Sensai says "I already told you what to do."

          If you beat two or less students, he says you need practice. If you beat three, he gives out a bonus. If you beat all four, he gives out the bonuses. Each possible result of the quest resets the "have we gotten the quest?" variable back to zero. That way, regardless of what result you get, you can always try again by talking to Mr. Sensai again.

          I typed all of this up on the spot. I'm pretty sure it should work. If not, I hope I helped in terms of ironing out the general idea. Note that the second Val Condition Branch is inside Option 2 of the first.

          By the way, this is a really nice idea. I like it.

          Also, @ Valkysas - Sage words, my man.

          Edit: Pagerron is right. It'll be possible to keep doing this routine (beat 3 or 4 students) as many times as you want to get as many bonuses as you want. I'd also include a "how many times have we done this?" variable. Each time you get a bonus, this variable should be increased by 1. At the beginning of the code when you first get the quest from Mr. Sensai, he should check this third variable to see how many bonuses you've gotten. If you've gotten a bonus, say, three times, he should say something along the lines of "You are now a master of the martial arts! No more training for you!"
          Last edited by Crythania; 06-26-2007, 01:32 PM.

          Comment


            #6
            Re: I need variable help

            Thanks for all of your help everyone, but when i looked at the variable conditions, I found that I had set condition one <=3 , Condition 2 =3 and condition 3 >=3. I thoudht that the = was just a typo in the game, but I'm guessig that it means less than or equal to and greater than or equal to, and not just less or more than.

            Please let me know if this is right!


            Oh, and I ran into another problem:

            I was making events for boss battles, and I wanted the victory condition to escape dungeon, and then I was going to have a little conversation between the two main characters. However, when I escape the dungeon, the conversation doesnt play!! Help!
            http://i208.photobucket.com/albums/b...diumBattle.gif
            This picture is way to big for a sig (linked instead)

            yeah, I made that!!! message me about this to get your own!!!!! ( I have 2 mini animations so far that are rather funny.)

            Comment


              #7
              Re: I need variable help

              yes, the <= means "less than or equal to"

              As far as the second questions goes, once you move locations, event codes from the previous location will not play out anymore. Can you have the storyteller play before you are forced to escape the dungeon?
              " I am the way, the truth, and the life. No one comes to the Father but by me. " - Jesus

              Comment


                #8
                Re: I need variable help

                Thanks, Pagerron. I have been hovering around Pavillion, and it seems that you are the one to ask if I have any questions, according to other threads. But thank you for your help!
                Last edited by johnricemofo; 06-26-2007, 01:49 PM.
                http://i208.photobucket.com/albums/b...diumBattle.gif
                This picture is way to big for a sig (linked instead)

                yeah, I made that!!! message me about this to get your own!!!!! ( I have 2 mini animations so far that are rather funny.)

                Comment

                Working...
                X