The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Tutorials and Eventing => Topic started by: Arrow on June 06, 2013, 10:06:58 PM

Title: Events - Local Variables
Post by: Arrow on June 06, 2013, 10:06:58 PM
Is there a way to, like local switches, create local variables for an instance?

I'm going to have events appear the game map to represent enemies, ala (of course) Earthbound, Tales of Symphonia, etc.

Instead of making 1000 variables for every individual object's X and Y position, it would make more sense to compare an event's location compared to the player's locally.

Is this possible? Am I missing something and overcomplicating this?

Inquiring minds need to know.
Title: Re: Events - Local Variables
Post by: &&&&&&&&&&&&& on June 06, 2013, 10:24:08 PM
Just use "Event touch"?
Title: Re: Events - Local Variables
Post by: Arrow on June 06, 2013, 10:32:41 PM
Doesn't work that way.

Event touch, with the system I'm attempting to produce, will not function unless the player walks into the event, and not the other way around. Furthermore, that does not provide the event with other necessary information.

I am attempting to craft a way to give the event a sight range. It wanders aimlessly until the player comes within a certain number of pixels. When that occurs, it takes on a type of movement pattern native to its designation. If the player then moves outside of a SECOND range, then the event walks home.
Title: Re: Events - Local Variables
Post by: Arrow on June 06, 2013, 11:25:28 PM
Turns out Yanfly made a script for event chasing- but I still would like to know about local variables.
Title: Re: Events - Local Variables
Post by: IAMFORTE on June 07, 2013, 01:48:14 AM
I don't believe so
Title: Re: Events - Local Variables
Post by: Arrow on June 08, 2013, 06:10:22 AM
Well that's just silly.
Title: Re: Events - Local Variables
Post by: &&&&&&&&&&&&& on June 08, 2013, 06:22:38 AM
lots of higgamo jig, eh? ruffinilly uppnof, i say. Rottin nothing loking fo the way out he sai. oi, boit ol.

Can you do math? I mean, can RMVXA do maths? Like...
Monster one's Y = Var[mon1y]
Monster one's X = Var[mon1x]
Player's Y = Var[playy]
Player's X = Var[playx]

Then do like... Var[mon1y] - Var[playy] = Var[mon1Distance]

If  Var[mon1Distance] > 10 THEN nothing
If  Var[mon1Distance] = 10 THEN towards player
If  Var[mon1Distance] < 10 THEN enemy specific action

or something.

also.

word.

and period. or in this case, two words... now broken sentence. what the hell am i even doing
no period

pleasekillme.jpg
Title: Re: Events - Local Variables
Post by: IAMFORTE on June 08, 2013, 02:05:29 PM
What he said ^ Maybe have a set number of XY variable pairs per map that represent monster and player locations, then you just update them on map transfer.