Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Regions in RMXP?

What I missed a lot about good old warcraft editor was the regions/locations you can create to use with triggers. Is there any easy way you can do this in RMXP?
I want a region to be created on the player that is 1 square toward the direction he is facing, then updating it whenever he moves. I know you can do this with location variables. Then if you come close to an object that can be interacted, a picture shows up with the X button saying an action available.
Hmm... then I suppose you run a check to see if there is any events in the variables of the location, right. I would like comment the object and use a code to get the comment and then displaying what you can do with that object in the picture. My problem is how do you ask whether an event is in the location whether with events or scripting? And how do you make a script get a comment?
Thanks!
 
You can check the SDK, it has a method to read a comment from event.

Now to check if there is a event, you would need to check the position of the events in that map, and check if they math with the "region", so for that you could either run a loop through all the events in the map and check its x,y (easy).

Or you could create a array with all the events access by their position in the map, and update the array anytime the event moves. its not difficult, but its no easy as well.

Tell me if you need further help.
 
Alright ill check the SDK out and try it.
Hmm wouldnt running a loop through all the events in the map sound like overkill and lag the game? you mean like putting a loop on all the events in the game? :O
the other method you wrote maybe will make a lot of lag too, it doesnt seem really clean you know?
When you have a X,Y variable already in front of the player, all you need to do is checking if that X,Y has an event.... it doesnt have to involve all events. Maybe the SDK comment thing can do that conditional check.
could you elaborate on those methods? I'm really new with rm and ruby.
Thanks
 
Its overkill if there are many events if you do the first aproach, ther is no other way to do it.

You wither run a loop, whenever the player moves, or you change a array with the events position, which is very speedy, thats the way I did my ABS, and Pathfinding. So I am pretty sure it doesnt lag.
Try seing how the player interacts when you Press Input::C, I don't have RMXP at hand, so I can't say for sure, but using the array instead of the loop it will not add any lag at all to the game. And I am pretty sure of it.

------------------------

If you care to wait, I can make you that script snippet for you later today or so, since I am busy right now, and don't have RMXP here.
 
Are you trying to make something happen if the event is in front of the player? (directly in front, like one tile away?)
Because that's built into the system with the "Player Touch" trigger.
Or do you mean 2 tiles in front of the player? I could be reading this entirely wrong....
 
Thanks guys... I solved my problem with events..! Do you know of a way to use common events or something with this to make it more streamline across the game and less effort required? I.e. how do you improve this? Because right now there will be a lot of tweaking involved for each and every event because of the diffrent facing conditions each event will need to have. And a script like my initial idea would be much much more steamline and easier to tweak, if only its possible somehow.

ss20090903024707.png


ss20090903024645.png


ss20090903025443.png


ss20090903024656.png
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top