Announcement

Collapse
No announcement yet.

User Controlled Event Problem

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

    User Controlled Event Problem

    OK, here's a tricky one. I was making an event where you pull a lever and some action begins. The action stops when the user presses the triangle button. This is done with the repeat command set to repeat until the user input = {triangle} (I forget the database number).

    This works just fine, but when the script ends the character winds up stuck and can not move until I press another button (to change the value of the user input I guess).

    Am I missing something obvious (again) or is there something subtle I can do to allow movement when the event ends (I never turned on the "no movement" flag).

    The problem is one I have not worked too hard on, and am only asking so I can save time and MAYBE get this thing finished in time for the contest. There is very little chance of that (but I want to try and if the great folx here can help save me time, the chances improve).

    Since I am at work again (my only Internet access for a while) I can not be too long, but I had a thought I do not know if will work while I was typing this. Would simply changing the variable value in the last line of the script work? I'll try when I get home and find out!

    Peace.

    MOO!





    #2
    Re: User Controlled Event Problem

    Just change the button variable to -1 after the event stops. Just be careful that the player can't press /\ somewhere else in the room and cause it to freeze again.
    Last edited by ErikaFuzzbottom; 04-12-2005, 09:47 AM.
    "What if like...there was an exact copy of you somewhere, except they're the opposite gender, like you guys could literally have a freaky friday moment and nothing would change. Imagine the best friendship that could be found there."

    Comment


      #3
      Re: User Controlled Event Problem

      Don't know much about this sort of thing, but maybe instead of using a repeat script just make an action script with an input button set to constant wait. Use a script branch sort with apply if for the trianble button, then create a no application in the sort so that if you press anything else it goes back to the top. This should work fine, just have a flag come on once the triangle button is pressed to keep the event from resetting.
      Do you serve with a purpose or purposely serve?

      Comment


        #4
        Re: User Controlled Event Problem

        Wow,

        It's 10:00 break (a few minutes late) and responses already! (I like this board)

        The reason for the repeat command is to avoid the constant wait. I wanted to use the wait "X" frames command to add an element of timing to the button press. With it set low the timing is tricky, but easily mastered.

        I could probably still use it with the sort command, but my archaic style of programming (I'm REALLY OLD) seems to work best with conditional branches. I am often surprised by the results when I try to use the Sort and Apply if commands. I do eventually get them working, they just never seem to work right the first time (for me).

        I can't wait to get my computer fixed so I can post these things while I am next to my game and can tell you if your suggestions worked! I'll let ya know what happens.

        Stay tuned for further developments!

        MOO!




        Comment


          #5
          Re: User Controlled Event Problem

          The secret to apply ifs is to remember to include a 'to end' comand after each option. Otherwise the stupid system will execute each if command.
          Do you serve with a purpose or purposely serve?

          Comment


            #6
            Re: User Controlled Event Problem

            Thanks Final Rune!

            I'll have to check the scripts that gave me "interesting" results and see if I missed that detail.

            Conditional script branches do seem to take marginally more memory than "sort" and "apply if" branches, but with the "to end" added they may just equal out and make them interchangable. I have not yet run into a situation where I could not use conditions to get the desired results.

            MOO!




            Comment


              #7
              Re: User Controlled Event Problem

              It's roughly if it's 1 If Statement a Sort: Apply If To End will cost more, if it's 2 they'll be the same, and if it's 3 or more (quite frequent) the Sort: Apply If To End will be a l o t more cost effective. Believe me, I used to only do Script Conditions too, but I've gone back and changed what should be Apply Ifs of them and on average I'd save around 1/3 of what the whole script costed (like free up 800 memory on what was originally a 2400 memory script).

              The only difference is this (along what Final Rune said):

              If you put two script conditions right after each other RPGM2 will check both conditions and if one or the other fails it will skip what needs to be done.

              If you put Sorts like this (2 together)

              Sort: x variable
              Apply If 1
              Apply If 2
              blah blah blah
              To End
              Sort: End

              RPGM2 will do the blah blah blah part whether the variable is equal to 1 OR 2.

              The Apply If _, something happens, To End is the exact same as the Script: Condition, something happens, Condition: End.

              I'm warning you now to learn how to use these or else you'll find yourself later going back and changing all of them in your scripts (which can take a while) later to free up remaining memory (seems like you'll never need to but you will).

              As for what you asked, I haven't done anything like this before, but the reason why you can't move is because the content script is not done executing, so this is a fairly simple problem with numerous solutions.

              Comment


                #8
                Re: User Controlled Event Problem

                Yup,

                I planned on learning how this works before attempting a second game if only to see if it actually saves memory, but your data confirms it does indeed do so!

                I am just so close to finishing this one that I fear if I take the time to re-script everything I'll never make the April 28th deadline for the contest.

                Not that I have much chance of making it anyhow, but I'm determined to try!

                I already ran out of memory once and broke it into 2 chapters (memory card blocks). This was due to graphics though, not scripts. My idea of a small adventure was obviously too big for my own good. Too many dungeons!

                If it is acceptable I'll try submitting just the first half. Even though it would be technically not a whole game, it would fill the memory card block nearly completely!

                Until tomorrow...

                ====================================

                Well, it's tomorrow (technically it's today, but by that definition tomorrow never comes... so I'm calling today tomorrow anyhow) and I'm just editing this post because I think I recalll something somewhere in the rules about "double posting". Anyway;

                This is what happened:

                I tried resetting the variable to another value, but "Variable 004" (the user button) cannot be modified with a Data command. It is "grayed out".

                So, taking the advice proferred by WilliamKirk I used the sort command in solving the problem. I knew I had to reset the user button to something else (Oh yeah, Draygone: when the script is done, pressing Triangle has no effect elsewhere and elsewhen) so after the event is done moving, having been stopped by the correctly timed user button input, I opened a message window with the "close window" button unchecked and said something stupid, silly, or otherwise amusing. Then I set up another user button input which was sorted and told to go "to top" if it equaled Triangle. Otherwise it just closed the window and the script ended.

                Most people will instinctively press "X" to close the window, although it could be closed with any button. This solved the problem just fine.

                Thanks to all for helping out!

                Peace.
                Last edited by Rodak; 04-13-2005, 08:15 AM.

                MOO!




                Comment

                Working...
                X