so I have a way to have actors and enemies not return to their original home positions in battle. but it's a double edged sword lol. people can wander off too far in any direction, going off screen. sooo, my question is... is there a way to check the positions of everyone in battle and if they were to go past a certain point of the screen, basically have an action make them jump back to a different location? the action I'd know how to do... but I'm not sure how to get the positions. and if I have them, would I have a common event check them after every turn in a variable or something? any suggestions would be helpful. thanks everyone!
Keeping Actors in certain spots...
Javascript/Plugin SupportHmm, does that edge of the screen move?
I ask, since I see 2 possibilities that should be quite easy to achieve - one is a region event (check Yanfly's channel) - so an actor might wander off to a reqion that triggers an even causing the actor to move into a different/preprogrammed location.
However if the edge is moving, then you don't want static regions, in that case you could create a paralel event for each actor that checks his location and trigger a branch when certain requirements are met. Not sure, here, but I think it should be possible to create 'distance' as a requirement.
I ask, since I see 2 possibilities that should be quite easy to achieve - one is a region event (check Yanfly's channel) - so an actor might wander off to a reqion that triggers an even causing the actor to move into a different/preprogrammed location.
However if the edge is moving, then you don't want static regions, in that case you could create a paralel event for each actor that checks his location and trigger a branch when certain requirements are met. Not sure, here, but I think it should be possible to create 'distance' as a requirement.
does that stuff work during battle? essentially my actors and enemies don't have to return to their starting position and I didn't want them going off screen potentially... but I wasn't aware some like that would work during a battle? or am I confused or something lol
ahh, sorry, I didn't realize you meant in battle.
I think there was a way to anchor players in battle, but I have no idea. This doesn't happen in my game 🙁
I think there was a way to anchor players in battle, but I have no idea. This doesn't happen in my game 🙁
Is a a question specific to a particular plugin you are using? Or are you simply asking how it should be done in javascript?
Someone basically made a plugin for me where how normally during Yanfly action sequences, actors go back to whatever there set home position is... this makes wherever that move ends them, their new home position. meaning if you aren't careful, enemies and actors can end up in really weird places. tho I've found a way around that. just always have a set point or points for them to end up at after attacks end. usually actors jump back to a position anyways in my game. so this looks fine enough.
basically what I wanna know how to do is see if there's a way to track the end position of a move if I DON'T tell the actor/enemy to hop back to a certain spot. If I know that say an enemy was pushed back to 400 x but I feel that's too far back... then is there a way to check if they're past 400 x on the screen? I would then use like an if else statement to put them automatically back to a certain point on the screen.
Sorry if this isn't making sense... I essentially want to be able to let the game know "hey, they're too far in this direction and are about to go off screen, have them jump back to this point"... the reason for this is so I can let things happen naturally in battle without me ALWAYS needing to set predetermined landing points after ever move.
But yeah, I'm basically asking with Javascript codes, is it possible to track actors and enemies positions on the screen and be able to have a way to control event or statements with said information.
basically what I wanna know how to do is see if there's a way to track the end position of a move if I DON'T tell the actor/enemy to hop back to a certain spot. If I know that say an enemy was pushed back to 400 x but I feel that's too far back... then is there a way to check if they're past 400 x on the screen? I would then use like an if else statement to put them automatically back to a certain point on the screen.
Sorry if this isn't making sense... I essentially want to be able to let the game know "hey, they're too far in this direction and are about to go off screen, have them jump back to this point"... the reason for this is so I can let things happen naturally in battle without me ALWAYS needing to set predetermined landing points after ever move.
But yeah, I'm basically asking with Javascript codes, is it possible to track actors and enemies positions on the screen and be able to have a way to control event or statements with said information.
This recent thread has a script to get the x or y I guess.
forums.rpgmakerweb.com
Show picture above actor's battler
Hey there, This can be too simple, but I haven't figured out how to do It. I would like to display a picture above actor's battler coordinates (obviously in battle). I haven't found a plugin that could help me yet, so I appreciate any effort! Cheers ~
forums.rpgmakerweb.com
Yes you can track objects on the screen. The property is pretty straightforward, it's called
I'm sorry, I'm not too good with Yanfly plugins since I usually code my own plugins and don't use a lot of third party plugins. Perhaps someone else knows a way to do what you're looking for for your Yanfly battle plugins. Until we know if this has to do with a specific Yanfly plugin, or you need to modify the code yourself, or to make a request for someone to do it for you, I won't move the thread (since all those situations would mean a different subforum).
x and y, the hard part would be identifying the sprite object itself and changing the position at the right moment in the code. Unless Yanfly has a way to modify the position through eventing or notes, or another method, the only way to achieve that is through the code. I'm sorry, I'm not too good with Yanfly plugins since I usually code my own plugins and don't use a lot of third party plugins. Perhaps someone else knows a way to do what you're looking for for your Yanfly battle plugins. Until we know if this has to do with a specific Yanfly plugin, or you need to modify the code yourself, or to make a request for someone to do it for you, I won't move the thread (since all those situations would mean a different subforum).
This helped me figure it out actually! so basically with SceneManager._scene._spriteset._actorSprites[0]._homeX, I will always know where my actor ends up. as a test, I had it set in a variable. I called the variable in an if... else statement at the end of a Yanfly action sequence. from there you can say, if the actor is past say... 700X by the end of the action, have them jump back to a certain point automatically, and if not... stay put. Thanks everyone! this is extremely helpful!
@zerobeat032 I take it your inquiry has been fully answered?
Yes, this thread can be closed. I think I can figure out from here how to do this for enemies as well as I've found the code I'd need in another thread.
Alright, perfect!
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
Original thread: https://forums.rpgmakerweb.com/threads/keeping-actors-in-certain-spots.117451/