Help - Search - Members - Calendar
Full Version: Event X touches Tile Y, Z happens...
RPG RPG Revolution Forums > Scripting > Event Emporium
Pillanious
Hey guys smile.gif

I'm trying to event a puzzle whereby (for example) There are four boxes (red, green, blue, yellow), and they must be pushed onto the corresponding block to open the door to the next room. I'm not really sure how to event this, and was wondering if anyone could perhaps offer some insight, or guidance in the right direction? :3.
LaDestitute
First of all, what's your RPG maker? XP? VX? 2K3?
Pillanious
QUOTE (Miles Castea @ Jan 28 2011, 01:33 AM) *
First of all, what's your RPG maker? XP? VX? 2K3?


My apologies. RPG maker VX
LaDestitute
QUOTE (Pillanious @ Jan 27 2011, 10:34 PM) *
QUOTE (Miles Castea @ Jan 28 2011, 01:33 AM) *
First of all, what's your RPG maker? XP? VX? 2K3?


My apologies. RPG maker VX

Ok, your going to need a bit of work to achieve this. If you think this is too much (Its EXTREMELY variable consuming), it might be better to ask for a script to do this.
First create eight variables, one for each boxe's X AND Y positions (ex: Red Box X, Red Box Y) and create a parrelarel process event that basicallys set the variable as:
Variable 1: Red Box X = Red Box (NPC01)'s X position
Variable 2: Red Box Y = Red Box (NPC01)'s Y position
And so on for all four boxes. This will allow the engine to track their positions in real time.

Then create eight more variables, except for the squares where you want each box to go correctly, again with the same routine of setting their variables to be monitored.

Then either on the same parralel event or on the actual prize event (like a door) make sixteen conditional braches checking if Box n is on the correct tile like this: http://img545.imageshack.us/img545/8472/exampley.png

Grand total of variables used; 32 (ouch)
Pillanious
QUOTE (Miles Castea @ Jan 28 2011, 01:46 AM) *
QUOTE (Pillanious @ Jan 27 2011, 10:34 PM) *
QUOTE (Miles Castea @ Jan 28 2011, 01:33 AM) *
First of all, what's your RPG maker? XP? VX? 2K3?


My apologies. RPG maker VX

Ok, your going to need a bit of work to achieve this. If you think this is too much (Its EXTREMELY variable consuming), it might be better to ask for a script to do this.
First create eight variables, one for each boxe's X AND Y positions (ex: Red Box X, Red Box Y) and create a parrelarel process event that basicallys set the variable as:
Variable 1: Red Box X = Red Box (NPC01)'s X position
Variable 2: Red Box Y = Red Box (NPC01)'s Y position
And so on for all four boxes. This will allow the engine to track their positions in real time.

Then create eight more variables, except for the squares where you want each box to go correctly, again with the same routine of setting their variables to be monitored.

Then either on the same parralel event or on the actual prize event (like a door) make sixteen conditional braches checking if Box n is on the correct tile like this: http://img545.imageshack.us/img545/8472/exampley.png

Grand total of variables used; 32 (ouch)


Dear gods that's huge o_o Methinks I'd be best to come up with some other sort of puzzle o.o

Edit: Made it work with only 16 variables. That's not too bad :3 - Thank you for the help, Miles! smile.gif
brewmeister
Ok, I read this as a personal challenge, and did it with 2 variables, and one switch...

Each 'box' event is

CODE
Set Move Route: This Evenet
                            :Move away from Player
Call Common Event: Check Puzzle


Hint: You only need to check the positions after a box moves.

The Common Event:

CODE
Control Variables: [0001:Event X] = [EV001]'s Map X
Conditional Branch: Variable  [0001:Event X] == 3
    Control Variables: [0002:Event Y] = [EV001]'s Map Y
    Conditional Branch: Variable  [0001:Event Y] == 4
        Control Variables: [0001:Event X] = [EV002]'s Map X
        Conditional Branch: Variable  [0001:Event X] == 12
            Control Variables: [0002:Event Y] = [EV002]'s Map Y
            Conditional Branch: Variable  [0001:Event Y] == 4
                Control Variables: [0001:Event X] = [EV003]'s Map X
                Conditional Branch: Variable  [0001:Event X] == 3
                    Control Variables: [0002:Event Y] = [EV003]'s Map Y
                    Conditional Branch: Variable  [0001:Event Y] == 8
                        Control Variables: [0001:Event X] = [EV004]'s Map X
                        Conditional Branch: Variable  [0001:Event X] == 12
                            Control Variables: [0002:Event Y] = [EV004]'s Map Y
                            Conditional Branch: Variable  [0001:Event Y] == 8
                                Control Switches: [0001:Open Door] = ON
                            Branch End
                        Branch End
                    Branch End
                Branch End
            Branch End
        Branch End
    Branch End
Branch End


When the switch [0001:Open Door] is on, open the door.

Be Well
Pillanious
QUOTE (brewmeister @ Feb 14 2011, 08:52 PM) *
Ok, I read this as a personal challenge, and did it with 2 variables, and one switch...

Each 'box' event is

CODE
Set Move Route: This Evenet
                            :Move away from Player
Call Common Event: Check Puzzle


Hint: You only need to check the positions after a box moves.

The Common Event:

CODE
Control Variables: [0001:Event X] = [EV001]'s Map X
Conditional Branch: Variable  [0001:Event X] == 3
    Control Variables: [0002:Event Y] = [EV001]'s Map Y
    Conditional Branch: Variable  [0001:Event Y] == 4
        Control Variables: [0001:Event X] = [EV002]'s Map X
        Conditional Branch: Variable  [0001:Event X] == 12
            Control Variables: [0002:Event Y] = [EV002]'s Map Y
            Conditional Branch: Variable  [0001:Event Y] == 4
                Control Variables: [0001:Event X] = [EV003]'s Map X
                Conditional Branch: Variable  [0001:Event X] == 3
                    Control Variables: [0002:Event Y] = [EV003]'s Map Y
                    Conditional Branch: Variable  [0001:Event Y] == 8
                        Control Variables: [0001:Event X] = [EV004]'s Map X
                        Conditional Branch: Variable  [0001:Event X] == 12
                            Control Variables: [0002:Event Y] = [EV004]'s Map Y
                            Conditional Branch: Variable  [0001:Event Y] == 8
                                Control Switches: [0001:Open Door] = ON
                            Branch End
                        Branch End
                    Branch End
                Branch End
            Branch End
        Branch End
    Branch End
Branch End


When the switch [0001:Open Door] is on, open the door.

Be Well


I think I missed this post here - but I wanted to say thank you for your help. If this is considered a necropost, I sincerely apologise - but I wanted to make sure I said thank you smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.