Charas-Project

  • Home
  • Help
  • Search
  • Calendar
  • Login
  • Register
*
Please login or register.

Login with username, password and session length
 

News:

Click here to join us on IRC (#charas on irc.freenode.net)!



  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • Need help with variables and such
« previous next »
  • Print
Pages: [1]

Author Topic: Need help with variables and such  (Read 3163 times)

Offline Linkforce

  • The Original Master of the Mosey
  • Leader
  • *
  • Posts: 2,330
  • i love rpgs
Need help with variables and such
« on: June 14, 2005, 09:11:53 PM »
Well, I'm up to my first dungeon, and I'm trying to make a sytem of switches.  For example:

Three switches on the floor.  One is pushed in, and two are not.  There are two rocks that can be moved.  So, how do i make it that when the rock is on the button, it gets pushed down, and one gets pushed up.  That way, you have to put both rocks on both switches?

Edit:  Not related, but I have another problem.  WhenI get to thw World Map, my sprite turns blank...but in the menu, the hero is there...and I have no event on the map.  0_o  Please help with this too if you can. :D
Logged

Offline Slayer004_69

  • Member
  • Initiate
  • *
  • Posts: 81
(No subject)
« Reply #1 on: June 14, 2005, 10:46:20 PM »
wow, the trailer was cool :P, but how in the world u do that :|, amazing...if u could explain my ... go ! lol :P good job
Logged
I'm the master of Pedegrees :D

Offline Linkforce

  • The Original Master of the Mosey
  • Leader
  • *
  • Posts: 2,330
  • i love rpgs
(No subject)
« Reply #2 on: June 14, 2005, 10:54:57 PM »
....um thanks......but thats not the issue on hand....lol......?
Logged

Offline Slayer004_69

  • Member
  • Initiate
  • *
  • Posts: 81
(No subject)
« Reply #3 on: June 14, 2005, 10:56:55 PM »
aww too bad...
Logged
I'm the master of Pedegrees :D

Offline Linkforce

  • The Original Master of the Mosey
  • Leader
  • *
  • Posts: 2,330
  • i love rpgs
(No subject)
« Reply #4 on: June 15, 2005, 05:06:16 PM »
Can't anyone please help me out?
Logged

Offline WarxePB

  • Action Sue
  • Royal
  • *
  • Posts: 3,601
  • What killed the dinosaurs?
    • The Gigaverse
(No subject)
« Reply #5 on: June 15, 2005, 05:28:07 PM »
You'll have to use coordinates.

First, make the switch a "Parallel Process" event. Then, using two variables (Switch-X and Switch-Y), get the X and Y coordinates of the switch. Next, have two more variables (Rock-X and Rock-Y) get the coordinates of the rock. Then, use two Conditional Branches to compare the X and Y values; if they're the same, turn a switch ON.

Codewise:

<>Variable Operation: Var[0218:Switch-X] Set, Switch X Coord
<>Variable Operation: Var[0219:Switch-Y] Set, Switch Y Coord
<>Variable Operation: Var[0220:Rock-X] Set, Rock X Coord
<>Variable Operation: Var[0221:Rock-Y] Set, Rock Y Coord
<>Branch if Var[0218:Switch-X] is Var[0220]
|<>Branch if Var[0219:Switch-Y] is Var[0221]
||<>Switch Operation: Switch[0018:Rock On Switch] ON
||<>
|<>Else Handler
||<>Switch Operation: Switch[0018:Rock On Switch] OFF
||<>
|<>End
|<>
<>Else Handler
|<>Switch Operation: Switch[0018:Rock On Switch] OFF
|<>
<>End
<>

Then repeat with the other switch (You'll need to change the variables).

EDIT: And to move the rock, just create a "Touched By Hero" event that Moves Away From Hero when activated. Also, make sure to create a Proceed With Movement command right afteer the Move Event.
Logged
Blog: The Gigaverse
Twitter: Initial Chaos

Offline Linkforce

  • The Original Master of the Mosey
  • Leader
  • *
  • Posts: 2,330
  • i love rpgs
(No subject)
« Reply #6 on: June 15, 2005, 05:42:53 PM »
Great, thanks for the help!   But when I get the rock onto the switch, it just freezes....and to make the door open I just use another switch right?
Logged

Offline WarxePB

  • Action Sue
  • Royal
  • *
  • Posts: 3,601
  • What killed the dinosaurs?
    • The Gigaverse
(No subject)
« Reply #7 on: June 15, 2005, 05:45:19 PM »
Hmm, if it freezes, you might want the switch "Rock On Switch" to activate a second page in the switch event that does nothing.

And yeah, with the other switch, just use the same code but different variables and switches.
Logged
Blog: The Gigaverse
Twitter: Initial Chaos

Offline Linkforce

  • The Original Master of the Mosey
  • Leader
  • *
  • Posts: 2,330
  • i love rpgs
(No subject)
« Reply #8 on: June 17, 2005, 01:57:59 AM »
Can you or someone thouroughly explain this, because I am quite stupid when it comes to Variables.  I just need to know what to change when I put that code into my second and third switch.
Logged

  • Print
Pages: [1]
« previous next »
  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • Need help with variables and such
 

  • SMF 2.0.10 | SMF © 2015, Simple Machines
  • XHTML
  • 2O11
  • RSS
  • WAP2
  • Simple Machines Forum