Home
Help
Search
Calendar
Login
Register
Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
New forum theme up and running!
Charas-Project
»
Game Creation
»
Requests
»
RPG Maker Programming
»
If one event meets another
« previous
next »
Print
Pages: [
1
]
Author
Topic: If one event meets another (Read 2056 times)
Pythis
Setsujin - Dark Crystal
Acolyte
Posts: 435
I..am Pythiros and I will kill you..
If one event meets another
«
on:
September 04, 2005, 12:59:52 AM »
How do I make it so that if one event meets another something happens.
Logged
WarxePB
Action Sue
Royal
Posts: 3,601
What killed the dinosaurs?
(No subject)
«
Reply #1 on:
September 04, 2005, 01:11:51 AM »
Unfortunately, the only way to do this is in-game scripting or (if it's just random) coordinates.
First, you'll have to get the coordinates of both events. Create four variables (Event1-X, Event1-Y, Event2-X, Event2-Y), and create four Variable Operations that get the coordinates of the events (in the Variable Operation window, click Sprite, the event you want, and X/Y Coordinate (not Screen-Relative)). Then, create another Variable Operation that subtracts 1 from Event2-X. Create a Conditional Branch (Fork Condition) that checks if Event1-X and Event2-X are equal. If they are, activate the event. If not, add 2 to Event1-X, and check again. If not, subtract 1 from Event1-Y, and check if both Y coordinates are equal. If not, add 2 to Event1-Y, and check again. If none of those conditions are true, then the second event isn't close to the first.
Since that's sort of difficult to understand, here's what your code should look like:
<>Variable Operation: Var[0001:Event1-X] Set, Event 1 X Coord
<>Variable Operation: Var[0002:Event1-Y] Set, Event 1 Y Coord
<>Variable Operation: Var[0003:Event2-X] Set, Event 2 X Coord
<>Variable Operation: Var[0004:Event2-Y] Set, Event 2 Y Coord
<>Variable Operation: Var[0002:Event1-Y] -, 1
<>Branch if Var[0002:Event1-Y] is Var[0004] Equal
|<>(event)
|<>
<>Else Handler
|<>Variable Operation: Var[0002:Event1-Y] +, 2
|<>Branch if Var[0002:Event1-Y] is Var[0004] Equal
||<>(event)
||<>
|<>Else Handler
||<>Variable Operation: Var[0001:Event1-X] -, 1
||<>Branch if Var[0001:Event1-X] is Var[0003] Equal
|||<>(event)
|||<>
||<>Else Handler
|||<>Variable Operation: Var[0001:Event1-X] +, 2
|||<>Branch if Var[0001:Event1-X] is Var[0003] Equal
||||<>(event)
||||<>
|||<>End
|||<>
||<>End
||
|<>End
|<>
<>End
<>
Something like that, anyways.
Logged
Blog:
The Gigaverse
Twitter:
Initial Chaos
Meiscool-2
Sage
Posts: 7,030
If you support n00bs, you support communism.
(No subject)
«
Reply #2 on:
September 04, 2005, 01:12:36 AM »
Make four varibles. Two would be the first events X and Y, and second the other two would be the other event's x and Y. Then make a script to where if event 1 X= event 2 X and if eveny 1 Y= event 2 Y, the thing you want to have happen happens.
Logged
Most Recent:
________________________
Old Stuff:
Pythis
Setsujin - Dark Crystal
Acolyte
Posts: 435
I..am Pythiros and I will kill you..
(No subject)
«
Reply #3 on:
September 04, 2005, 04:23:07 AM »
niether work
Logged
WarxePB
Action Sue
Royal
Posts: 3,601
What killed the dinosaurs?
(No subject)
«
Reply #4 on:
September 04, 2005, 05:04:08 AM »
I forgot to mention that you need to set one of the events to "Parallel Process". Try it again, because it works for me.
Logged
Blog:
The Gigaverse
Twitter:
Initial Chaos
Print
Pages: [
1
]
« previous
next »
Charas-Project
»
Game Creation
»
Requests
»
RPG Maker Programming
»
If one event meets another