Announcement

Collapse
No announcement yet.

How To Use Multiple Modes With Multiple Variable Conditions

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

    How To Use Multiple Modes With Multiple Variable Conditions

    The following code gives you 1 event, checking a variable for 36 different values(0-35) and gives you up to 13 lines of code for each variable condition, for a total of 644 lines of code.

    I doubt seriously anyone will have a code system that utilizes over 500 lines of code in one event, but this is to give you an idea on how you can make modes work for you

    I worked hard on presentation for this(almost 2 hours), turned out better then I was hoping


    Mode 1
    Touch/Talk
    01;Val-Conditional Branch -> Shared Variable 01( <= 2, 5, 8)
    --02;<Option 1/Start> -> Shared Variable 01 <= 2
    ----03;Modify Mode -> Mode 3
    --04;<Option 1/End>

    --05;<Option 2/Start> -> Shared Variable 01 <= 5
    ----06;Modify Mode -> Mode 4
    --07;<Option 2/End>

    --08;<Option 3/Start> -> Shared Variable 01 <= 8
    ----09;Modify Mode -> Mode 5
    --10;<Option 3/End>

    11;End Branch
    12;Val-Conditional Branch -> Shared Variable 01( <= 11, 14, 17)
    --13;<Option 1/Start> -> Shared Variable 01 <= 11
    ----14;Modify Mode -> Mode 6
    --15;<Option 1/End>

    --16;<Option 2/Start> -> Shared Variable 01 <= 14
    ----17;Modify Mode -> Mode 7
    --18;<Option 2/End>

    --19;<Option 3/Start> -> Shared Variable 01 <= 17
    ----20;Modify Mode -> Mode 8
    --21;<Option 3/End>

    22;End Branch
    23;Val-Conditional Branch -> Shared Variable 01( <= 20, 23, 26)
    --24;<Option 1/Start> -> Shared Variable 01 <= 20
    ----25;Modify Mode -> Mode 9
    --26;<Option 1/End>

    --27;<Option 2/Start> -> Shared Variable 01 <= 23
    ----28;Modify Mode -> Mode 10
    --29;<Option 2/End>

    --30;<Option 3/Start> -> Shared Variable 01 <= 26
    ----31;Modify Mode -> Mode 11
    --32;<Option 3/End>

    33;End Branch
    34;Val-Conditional Branch -> Shared Variable 01( <= 29, 32, 35)
    --35;<Option 1/Start> -> Shared Variable 01 <= 29
    ----36;Modify Mode -> Mode 12
    --37;<Option 1/End>

    --38;<Option 2/Start> -> Shared Variable 01 <= 32
    ----39;Modify Mode -> Mode 13
    --40;<Option 2/End>

    --41;<Option 3/Start> -> Shared Variable 01 <= 35
    ----42;Modify Mode -> Mode 14
    --43;<Option 3/End>

    44;End Branch

    Mode 3
    Auto
    ***You have up to 13 lines of code available for each option***
    01;Val-Conditional Branch -> Shared Variable 01( = 0, 1, 2)
    --02;<Option 1/Start> -> Shared Variable 01 = 0
    --03;<Option 1/End>

    --04;<Option 2/Start> -> Shared Variable 01 = 1
    --05;<Option 2/End>

    --06;<Option 3/Start> -> Shared Variable 01 = 2
    --07;<Option 3/End>

    08;End Branch
    09;Modify Mode -> Mode 1

    Mode 4
    Auto
    ***You have up to 13 lines of code available for each option***
    01;Val-Conditional Branch -> Shared Variable 01( = 3, 4, 5)
    --02;<Option 1/Start> -> Shared Variable 01 = 3
    --03;<Option 1/End>

    --04;<Option 2/Start> -> Shared Variable 01 = 4
    --05;<Option 2/End>

    --06;<Option 3/Start> -> Shared Variable 01 = 5
    --07;<Option 3/End>

    08;End Branch
    09;Modify Mode -> Mode 1

    Mode 5
    Auto
    ***You have up to 13 lines of code available for each option***
    01;Val-Conditional Branch -> Shared Variable 01( = 6, 7, 8)
    --02;<Option 1/Start> -> Shared Variable 01 = 6
    --03;<Option 1/End>

    --04;<Option 2/Start> -> Shared Variable 01 = 7
    --05;<Option 2/End>

    --06;<Option 3/Start> -> Shared Variable 01 = 8
    --07;<Option 3/End>

    08;End Branch
    09;Modify Mode -> Mode 1

    Mode 6
    Auto
    ***You have up to 13 lines of code available for each option***
    01;Val-Conditional Branch -> Shared Variable 01( = 9, 10, 11)
    --02;<Option 1/Start> -> Shared Variable 01 = 9
    --03;<Option 1/End>

    --04;<Option 2/Start> -> Shared Variable 01 = 10
    --05;<Option 2/End>

    --06;<Option 3/Start> -> Shared Variable 01 = 11
    --07;<Option 3/End>

    08;End Branch
    09;Modify Mode -> Mode 1

    Mode 7
    Auto
    ***You have up to 13 lines of code available for each option***
    01;Val-Conditional Branch -> Shared Variable 01( = 12, 13, 14)
    --02;<Option 1/Start> -> Shared Variable 01 = 12
    --03;<Option 1/End>

    --04;<Option 2/Start> -> Shared Variable 01 = 13
    --05;<Option 2/End>

    --06;<Option 3/Start> -> Shared Variable 01 = 14
    --07;<Option 3/End>

    08;End Branch
    09;Modify Mode -> Mode 1

    Mode 8
    Auto
    ***You have up to 13 lines of code available for each option***
    01;Val-Conditional Branch -> Shared Variable 01( = 15, 16, 17)
    --02;<Option 1/Start> -> Shared Variable 01 = 15
    --03;<Option 1/End>

    --04;<Option 2/Start> -> Shared Variable 01 = 16
    --05;<Option 2/End>

    --06;<Option 3/Start> -> Shared Variable 01 = 17
    --07;<Option 3/End>

    08;End Branch
    09;Modify Mode -> Mode 1

    Mode 9
    Auto
    ***You have up to 13 lines of code available for each option***
    01;Val-Conditional Branch -> Shared Variable 01( = 18, 19, 20)
    --02;<Option 1/Start> -> Shared Variable 01 = 18
    --03;<Option 1/End>

    --04;<Option 2/Start> -> Shared Variable 01 = 19
    --05;<Option 2/End>

    --06;<Option 3/Start> -> Shared Variable 01 = 20
    --07;<Option 3/End>

    08;End Branch
    09;Modify Mode -> Mode 1

    Mode 10
    Auto
    ***You have up to 13 lines of code available for each option***
    01;Val-Conditional Branch -> Shared Variable 01( = 21, 22, 23)
    --02;<Option 1/Start> -> Shared Variable 01 = 21
    --03;<Option 1/End>

    --04;<Option 2/Start> -> Shared Variable 01 = 22
    --05;<Option 2/End>

    --06;<Option 3/Start> -> Shared Variable 01 = 23
    --07;<Option 3/End>

    08;End Branch
    09;Modify Mode -> Mode 1

    Mode 11
    Auto
    ***You have up to 13 lines of code available for each option***
    01;Val-Conditional Branch -> Shared Variable 01( = 24, 25, 26)
    --02;<Option 1/Start> -> Shared Variable 01 = 24
    --03;<Option 1/End>

    --04;<Option 2/Start> -> Shared Variable 01 = 25
    --05;<Option 2/End>

    --06;<Option 3/Start> -> Shared Variable 01 = 26
    --07;<Option 3/End>

    08;End Branch
    09;Modify Mode -> Mode 1

    Mode 12
    Auto
    ***You have up to 13 lines of code available for each option***
    01;Val-Conditional Branch -> Shared Variable 01( = 27, 28, 29)
    --02;<Option 1/Start> -> Shared Variable 01 = 27
    --03;<Option 1/End>

    --04;<Option 2/Start> -> Shared Variable 01 = 28
    --05;<Option 2/End>

    --06;<Option 3/Start> -> Shared Variable 01 = 29
    --07;<Option 3/End>

    08;End Branch
    09;Modify Mode -> Mode 1

    Mode 13
    Auto
    ***You have up to 13 lines of code available for each option***
    01;Val-Conditional Branch -> Shared Variable 01( = 30, 31, 32)
    --02;<Option 1/Start> -> Shared Variable 01 = 30
    --03;<Option 1/End>

    --04;<Option 2/Start> -> Shared Variable 01 = 31
    --05;<Option 2/End>

    --06;<Option 3/Start> -> Shared Variable 01 = 32
    --07;<Option 3/End>

    08;End Branch
    09;Modify Mode -> Mode 1

    Mode 14
    Auto
    ***You have up to 13 lines of code available for each option***
    01;Val-Conditional Branch -> Shared Variable 01( = 33, 34, 35)
    --02;<Option 1/Start> -> Shared Variable 01 = 33
    --03;<Option 1/End>

    --04;<Option 2/Start> -> Shared Variable 01 = 34
    --05;<Option 2/End>

    --06;<Option 3/Start> -> Shared Variable 01 = 35
    --07;<Option 3/End>

    08;End Branch
    09;Modify Mode -> Mode 1
    Last edited by JPS; 01-17-2007, 11:40 AM.

    Here I come Pav, like the Kool-Aid man barging into a funeral! Oh yeah!

    #2
    Re: How To Code Events Requiring 50+ Lines

    What percentage of memory does this take up?
    I want that Mulan McNugget sauce, Morty!

    Comment


      #3
      Re: How To Use Modes With Variable Conditions

      probably quite a bit, but you can make an entire game revolve around this event

      Here I come Pav, like the Kool-Aid man barging into a funeral! Oh yeah!

      Comment


        #4
        Re: How To Use Modes With Variable Conditions

        Wow, JPS, you just keep cranking out the cool stuff on here. What can be said except "Nice job!!"
        " I am the way, the truth, and the life. No one comes to the Father but by me. " - Jesus

        Comment


          #5
          Re: How To Use Modes With Variable Conditions

          Very nice. Very, VERY nice, dude. Should be a lot of help to a lot of people in quantifying a somewhat tough concept to wrap one's head around.

          Have you tried this code (or a smaller variant of it) out? I haven't needed to use intra-event mode-switching yet (though I will when I tackle the actual code for Item Creation), but I'm looking at this and seeing it switch to, let's say, Mode 4, then back to Mode 1 when it's done.

          What will make it automatically go to Mode 4's code and run it, if that's the appropriate Mode to switch the Event to? If it does so automatically, what will keep it from Looping over and over once it switches back to Mode 1? Does a "Never Mind" type choice need to be included to end the event, or does it end itself when you switch it's Mode to an "earlier" one?


          How Badly Do You Want It? (VX Ace) is now available for download! - no outside software necessary.

          "I live and love in God's peculiar light." - Michelangelo

          Comment


            #6
            Re: How To Use Modes With Variable Conditions

            Mode 1 starts out as a touch/talk mode, if the val-cond makes you go to Mode 4, mode 4 is an auto mode so it will trigger automatically, once the mode finishes the Modify Mode->1 will make it return to the beginning of Mode 1, and it will not activate again until you touch/talk to the event again.

            What determines where it will put you is the first val-cond checks to see if the value is between 0 and 3, if not it moves to the next val-cond, and so on, if the value is lets say, 2, it will trigger the first val-cond(< = 3), that takes you to Mode 3, it has another val-cond that determines if the variable is 0, 1, 2, or 3 and then lets you input coding for it, and if the value is 8, it will skip all the <= until the statement is true, then it will trigger a modify event, thus entering another val-cond that does the same thing as I said above in the first example.

            I have already tested out this entire code earlier to make sure it works, and it returns no loops at all and is 100% successful

            Have fun

            I try to think outside the box page

            Also if you wanted to, you could use all 1,000 lines of code if you're creative enough, you can also branch it out to 2,000 lines of code just by telling it to activate another separate event that does the same, or as many as you want, you can create an entire text based game on this concept.
            Last edited by JPS; 01-16-2007, 09:44 PM.

            Here I come Pav, like the Kool-Aid man barging into a funeral! Oh yeah!

            Comment


              #7
              Re: How To Use Modes With Variable Conditions

              Originally posted by JPS View Post
              Mode 1 starts out as a touch/talk mode, if the val-cond makes you go to Mode 4, mode 4 is an auto mode so it will trigger automatically, once the mode finishes the Modify Mode->1 will make it return to the beginning of Mode 1, and it will not activate again until you touch/talk to the event again.
              Ooh, I didn't catch that. Awesome thinking, JPS.


              How Badly Do You Want It? (VX Ace) is now available for download! - no outside software necessary.

              "I live and love in God's peculiar light." - Michelangelo

              Comment

              Working...
              X