Hi everyone,
I'm trying to create a skill used by enemies whereby the skill user will travel to its target (an actor), and then move back into its HOME position - taking the actor with them. The actor must then remain there for the battle until a certain condition will make them travel back.
The primary plugin I am dealing with here is YEP's Action Sequence Pack 2.
I'm trying to put this together, and here is my current model:
1) Enemy begins the skill.
2) At the beginning of the action sequence, a common event is executed that is supposed to store the enemy's X and Y values for their home position in two global variables (111: EnemyPosX and 112: EnemyPosY). The common event runs a simple script:
(These variables always return 0 when checked, so I'm already doing something wrong).
3) In the action sequence, the enemy then uses a MOVE command to move to the target.
4) After the movement, two more movement commands are used: one to get the enemy back to their home position, and another to get the target (the actor, in this case) to move approximately to the enemy's home position using a simple "MOVE target: user, FRONT BASE, 30" etc.
5) After all of this movement is complete, I run a secondary common event which is supposed to use the stored values / variables from earlier in this script:
But because the values are 0,0 the actor just ends up somewhere in the top left corner.
So, in addition to the issues with above process, I would really like to be able to store in global variables:
- The actor ID of the enemy's target
- The enemy ID of the user
- How to change the default way an actor faces so I can flip it, and then flip back again when they return
I would also really like a way for multiple enemies of this type to use the same skill, but if they do using the process I have outlined above, the variables will get all mixed up if the move is used more than once. What would be a better way to do it?
I'm trying to create a skill used by enemies whereby the skill user will travel to its target (an actor), and then move back into its HOME position - taking the actor with them. The actor must then remain there for the battle until a certain condition will make them travel back.
The primary plugin I am dealing with here is YEP's Action Sequence Pack 2.
I'm trying to put this together, and here is my current model:
1) Enemy begins the skill.
2) At the beginning of the action sequence, a common event is executed that is supposed to store the enemy's X and Y values for their home position in two global variables (111: EnemyPosX and 112: EnemyPosY). The common event runs a simple script:
Code:
var ex = target.spritePosX();
var ey = target.spritePosY();
$gameVariables.setValue(111, ex);
$gameVariables.setValue(112, ey);
(These variables always return 0 when checked, so I'm already doing something wrong).
3) In the action sequence, the enemy then uses a MOVE command to move to the target.
4) After the movement, two more movement commands are used: one to get the enemy back to their home position, and another to get the target (the actor, in this case) to move approximately to the enemy's home position using a simple "MOVE target: user, FRONT BASE, 30" etc.
5) After all of this movement is complete, I run a secondary common event which is supposed to use the stored values / variables from earlier in this script:
Code:
var ex = $gameVariables.value(111);
var ey = $gameVariables.value(112);
SceneManager._scene._spriteset._actorSprites[1]._homeX = ex;
SceneManager._scene._spriteset._actorSprites[1]._homeY = ey;
But because the values are 0,0 the actor just ends up somewhere in the top left corner.
So, in addition to the issues with above process, I would really like to be able to store in global variables:
- The actor ID of the enemy's target
- The enemy ID of the user
- How to change the default way an actor faces so I can flip it, and then flip back again when they return
I would also really like a way for multiple enemies of this type to use the same skill, but if they do using the process I have outlined above, the variables will get all mixed up if the move is used more than once. What would be a better way to do it?