Charas-Project

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

Login with username, password and session length
 

News:

New forum theme up and running!



  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • X & Y's makes me go insane crazy.
« previous next »
  • Print
Pages: [1]

Author Topic: X & Y's makes me go insane crazy.  (Read 3769 times)

Offline Red Fox

  • All men play on ten!
  • Leader
  • *
  • Posts: 2,034
X & Y's makes me go insane crazy.
« on: July 03, 2008, 05:57:04 PM »
I got this monster walking around in a map and when the player gets into the first three squares from the monster it should start following him.

This is the code I got so far:
<>Loop
 <>Variable Oper: [0001:Hero X] Set, Hero X Coord.
 <>Variable Oper: [0002:Hero Y] Set, Hero Y Coord.
 <>Variable Oper: [0004:Monster X] Set, Monster 1 x Coord.
 <>Variable Oper: [0005:Monster Y] Set, Monster 1 Y Coord.
 <> Wait: 0.1 Sec
 <>
: End Loop
<>

And

<>Branch if Var [0001:Hero X] is V[0004] Equal
 <>Switch Operation: [0002:Monster Seen you] ON
 <>
: Else Handler
 <>Branch if Var [0001:Hero Y] is V[0005] Equal
  <>Switch Operation: [0002:Monster Seen you] ON
  <>
 :End
 <>
:End
<>

But this code gets the whole row and I just wants the first three squares from the monster. I guess I will have to add or subtract some number somewhere but math isn't my strong side.

Help would be appreciated.


On a sidenote: The recomended tutorials doesn't work.
Logged
Your signature was awful, too. What the hell were you thinking?

Offline Felix-0

  • And we'll never be
  • Royal
  • *
  • Posts: 3,563
  • (royals)
Re: X & Y's makes me go insane crazy.
« Reply #1 on: July 03, 2008, 06:09:08 PM »
 :o
whoa...I'm working on this RIGHT now...it sounds intuiging


NOTE: I messed around with it for a bit.....
It would be easier to keep it how it is...if the enemy is moving then issues appear...
they need to be in spots that you can't get behind..or else the event get's activated from behind the person
« Last Edit: July 03, 2008, 06:50:57 PM by Felix-0 »
Logged
------------------------------------------------------------
Hence nothing remains except for our regrets...
------------------------------------------------------------

Offline karlc

  • Member
  • Associate
  • *
  • Posts: 188
  • ?
Re: X & Y's makes me go insane crazy.
« Reply #2 on: July 03, 2008, 06:30:02 PM »
cool!
i have a similar question
how do u make it so that an event will hapen if the hero is 1 square away from the monster from  any direction.
for now ill try to work with  your code!
« Last Edit: July 03, 2008, 06:35:36 PM by karlc »
Logged
http://i11.photobucket.com/albums/a187/karlconsing/gotenks3.gif

Offline Fisherson

  • Jedi Sentinel of the Charasian Cluster.
  • Royal
  • *
  • Posts: 4,200
  • Just call me Fish.
Re: X & Y's makes me go insane crazy.
« Reply #3 on: July 03, 2008, 06:39:06 PM »
Okay he's aking for help not writing a tutorial,so post if you have
some advice,please.I'm not mad at you guys ,it's jest anoying when pepole
post un-usefull infromation when your looking for help.

Whoops sorry jest saw your post Kalrc.
« Last Edit: July 03, 2008, 06:41:00 PM by Fisherson »
Logged

Offline Bluhman

  • Global Moderator
  • Royal
  • *
  • Posts: 4,977
Re: X & Y's makes me go insane crazy.
« Reply #4 on: July 04, 2008, 03:32:30 AM »
You know, I've actually done this successfully. Let me get my script, just a mo.

Ok, what you want instead of that is to also do a difference variable between hero and monster x and y, by subtracting one from the other. Perform four different conditional branches that make sure that the X and Y differences are between -3 and 3. If all of them are true, commence the chase!
« Last Edit: July 04, 2008, 03:36:09 AM by Bluhman »
Logged

Offline Felix-0

  • And we'll never be
  • Royal
  • *
  • Posts: 3,563
  • (royals)
Re: X & Y's makes me go insane crazy.
« Reply #5 on: July 04, 2008, 03:52:35 AM »
oh yea Variable range!!!
I forgot about that!
 :bend: Nice job Bluhman...
Logged
------------------------------------------------------------
Hence nothing remains except for our regrets...
------------------------------------------------------------

Offline Red Fox

  • All men play on ten!
  • Leader
  • *
  • Posts: 2,034
Re: X & Y's makes me go insane crazy.
« Reply #6 on: July 04, 2008, 08:35:30 AM »
Thank you Bluhman you saved my game.
Logged
Your signature was awful, too. What the hell were you thinking?

Offline karlc

  • Member
  • Associate
  • *
  • Posts: 188
  • ?
Re: X & Y's makes me go insane crazy.
« Reply #7 on: July 04, 2008, 04:15:57 PM »
im sorry i don't quite understand what bluhman is saying
can someone explain it please?
Logged
http://i11.photobucket.com/albums/a187/karlconsing/gotenks3.gif

Offline A Forgotten Legend

  • Your neighborhood box of colors
  • Royal
  • *
  • Posts: 4,428
    • Website
Re: X & Y's makes me go insane crazy.
« Reply #8 on: July 06, 2008, 03:42:33 PM »
I did it this way on VX.  Its basically the same as it would be on 2k3.


(Common Event - Parallel Process)
Player X = Var. Player X
Player Y = Var. Player Y


(Event - Parallel Process)
>Event 1's X = This Event's X
>Event 1's Y = This Event's Y
>Conditional Branch: Player Y = Event 1 Y
-->Conditional Branch: Player X </= 11 (The X cord. farthest away from the event that I want it to see)
-->DO STUFF HERE
-->Branch End
>Branch End



I just copied this event, and gave any new event's I've made different variables.  Though, I used the same Variable if it was on a different map.
« Last Edit: July 06, 2008, 03:44:29 PM by A Forgotten Legend »
Logged

Offline karlc

  • Member
  • Associate
  • *
  • Posts: 188
  • ?
Re: X & Y's makes me go insane crazy.
« Reply #9 on: July 06, 2008, 10:24:49 PM »
i tried it and it didnt work. maybe i did it wrong
Logged
http://i11.photobucket.com/albums/a187/karlconsing/gotenks3.gif

  • Print
Pages: [1]
« previous next »
  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • X & Y's makes me go insane crazy.
 

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