Resetting steps taken? Is it possible?

Status
Not open for further replies.

Manofdusk

Veteran
Veteran
Joined
Apr 26, 2014
Messages
211
Reaction score
39
First Language
English
Primarily Uses
 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.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,668
First Language
German
Primarily Uses
RMMV
Input.press?:)A)
The engine only accepts the predefined key (those that are available on a gamepad) as input.
For full keyboard input, you'll need a script for extended input, it's not possible by default.

$game_party.steps = 0
You'll never be able to do this (unless you modify the engine) as the party steps are always the steps since gamestart.
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.

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.
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,
 

Manofdusk

Veteran
Veteran
Joined
Apr 26, 2014
Messages
211
Reaction score
39
First Language
English
Primarily Uses
 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.
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
you could make it check if a key is pressed and if so check if the player's X/Y position really changed...
 

Manofdusk

Veteran
Veteran
Joined
Apr 26, 2014
Messages
211
Reaction score
39
First Language
English
Primarily Uses
 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.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,975
Members
137,563
Latest member
cexojow
Top