I've been making great strides in my tactical movement template. However, I can't seem to figure out how to get my characters transported from point to point.
I have variables set up for the location of each event and can transfer a player to those locations via an event. However, I'm faltering a bit at this point.
after the initial transportation, the Unit 1 Switch is turned on and the character is transported to the Unit 1 X, Unit 1 Y location on the map. Then, I need a way to activate the other switches.
I have considered 3 ways to go about it (but I haven't gotten any of them to work)
Option 1: Use code to "bind" keys 1-0 so that, when you press them, the teleport and party change occurs (unfortunately, I keep getting an unexpected integer error when I try that. I'm assuming this:
Input.press?:)A)
doesn't accept numbers (example: 1 instead of A).
Option 2: Set Act Variables and subtract the number of steps taken from the act variable. When it reaches 0, change the switch and ACT. Unfortunately, I can't figure out how to set steps taken to 0.
I've tried:
$game_party.steps = 0
but that throws an error (unexpected =)
Option 3: Set the transports to a timer... unfortunately, when I try that, the autorun event freezes me up and the parallel process just causes the timer to indefinitely reset.
If I could remember how to screenshot the problem (I knew but forgot), I'd attach it.
could anyone help me? Maybe there's a simpler method that I'm just not seeing.
Resetting steps taken? Is it possible?
● ARCHIVED · READ-ONLY
-
-
The engine only accepts the predefined key (those that are available on a gamepad) as input.Input.press?:)A)
For full keyboard input, you'll need a script for extended input, it's not possible by default.
You'll never be able to do this (unless you modify the engine) as the party steps are always the steps since gamestart.$game_party.steps = 0
What is usually done is to store the current steps into a variable, and then later make a substraction into a second variable to calculate the difference in the number of steps between the current time and the time the last steps were stored.
Check Galv's timer script for this - autoruns cannot count time (as they block player movement) and while parallel process can count time (for example, +1 per frame) they would also cause a lot more lag. So you're better off with using a script to create new timers,Option 3: Set the transports to a timer... unfortunately, when I try that, the autorun event freezes me up and the parallel process just causes the timer to indefinitely reset. -
Then I'll need to use steps somehow. The problem is that the variable needs to be a precise number. Each "unit" has an ACT variable that needs to count down towards 0 with each step. When it hits 0, the transfer needs to occur.
Is there a way to perform an action each time the player takes a step (like maybe an on_player_step command)? That would be the easiest way.
Otherwise, I'll need a different way to accomplish it... and right now I'm drawing a blank. -
you could make it check if a key is pressed and if so check if the player's X/Y position really changed...
-
I found a workaround.
I set up a parallel process that sets the player's current X and Y positons to variables. Then, in an autorun event, I set up the initial positions of the unit X and Y positions.
Then I used a 3rd parallel process to determine if the current X or Y variable is greater or less than the Unit X or Y variables. If it is, it reduces ACT by 1 and then sets the Unit X and Y variables to the Current X and Y variables. -
Magnifying glass please?
Seems a bit of a long way to go about it. But if it works ...
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.