- Joined
- Mar 28, 2014
- Messages
- 299
- Reaction score
- 336
- First Language
- English
- Primarily Uses
- RMMV
So I have a plugin that allows actors to stay in place after attacks and not move back to their original home position and with the awesome help of people here, I figured out how to control where people end up based on where they are on the screen based on their coordinates and whatnot. but I've run into a small hiccup that I didn't think about until I started messing around with the idea of characters being anywhere on the battle screen. So... with Yanfly action sequences, you can you stuff like face target and whatnot to face whoever your current target is or face towards/away from your home/starting position in battle. I was wondering tho, is there a way to KEEP that position as long as the game know's you're in a certain spot.
SceneManager._scene._spriteset._actorSprites[0]._homeX tells the game where a said actor's X position is on the screen. and this... $gameTroop.members()[0]._homeX does so for enemy troops. I've been trying to find a way to basically tell the game, if an actor's homeX is less than any troop member's homeX (basically meaning they're on the other side of them... to stay facing that direction. but regardless of what I've tried, the code either doesn't work or they simply turn back around anyways. I'm not very strong with coding, but I'm slowly learning things having explored the forums a ton. but I can't seem to figure out what exact sequence of coding I'd need for this.
if (this.spritePosX() > pointX) {
this.spriteFaceBackward();
I feel like this is what I'm looking for tho... I think my issue is honestly getting this to stick AFTER a turn is over because at that point you no longer have a target... which I THINK is what pointX is representing. If anyone can point me in the right direction, I'd be immensely grateful. thanks everyone!
SceneManager._scene._spriteset._actorSprites[0]._homeX tells the game where a said actor's X position is on the screen. and this... $gameTroop.members()[0]._homeX does so for enemy troops. I've been trying to find a way to basically tell the game, if an actor's homeX is less than any troop member's homeX (basically meaning they're on the other side of them... to stay facing that direction. but regardless of what I've tried, the code either doesn't work or they simply turn back around anyways. I'm not very strong with coding, but I'm slowly learning things having explored the forums a ton. but I can't seem to figure out what exact sequence of coding I'd need for this.
if (this.spritePosX() > pointX) {
this.spriteFaceBackward();
I feel like this is what I'm looking for tho... I think my issue is honestly getting this to stick AFTER a turn is over because at that point you no longer have a target... which I THINK is what pointX is representing. If anyone can point me in the right direction, I'd be immensely grateful. thanks everyone!
