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
-
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.
-
Just use "Event touch"?
-
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.
-
Turns out Yanfly made a script for event chasing- but I still would like to know about local variables.
-
I don't believe so
-
Well that's just silly.
-
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
-
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.