Step Issues

Status
Not open for further replies.

crashnburn

Villager
Member
Joined
Dec 10, 2013
Messages
11
Reaction score
0
Primarily Uses
I am trying to calculate the amount of steps taken after an event. I have the process down and I know it will work, BUT I can't get my variable to be anything besides 0. I am setting up my variable by game data - other - steps. I have tried setting it up by script with $game_variables = $game_party.steps, which does return the number of steps, but later when I do calculations it errors out. I'd really like to get the Game Data - Other - Steps working do to ease of use. Anyone have any thoughts as to why this is happening.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Show us the event - take a screenshot of it (the entire event window, not just the event commands) and post it here so we can see what you've done.


Your script call is wrong. But let's see if we can figure out why your Control Variables isn't working.


Have you added or changed any scripts?


Do you realize that you can't just say Control Variables [1: Steps] = Game Data > Other > Steps in one place and it will ALWAYS refer to the steps? It only sets the variable to what the steps are at the time the Control Variables command is run. So you should do that call just before you want to test the value, not at the start of the event BEFORE you want to count the number of steps.
 
Last edited by a moderator:

Baka-chan

☆*:.。. o(≧▽≦)o .。.:*☆
Veteran
Joined
Dec 19, 2012
Messages
490
Reaction score
148
First Language
German
What's how your control variables should look like:







Of course you need to change everything that has nothing to do with "Control Variables" so it fits your event! The example above is just for testing purpose.
 

crashnburn

Villager
Member
Joined
Dec 10, 2013
Messages
11
Reaction score
0
Primarily Uses
Shaz - it will be a couple of days before I can upload a screen shot. Laptop charger broke new one is on its way. I have only added a quest script. I do realize that setting it will only work temporarily.

Baka-chan - that is very similar to what I have done. I have set up my variables the same way.

I have an on action event that sets two variables to the current amount of steps and flips a control self switch. Then I have a parallel process that sets var1 to the current steps then subtracts var1 from var2 to get the amount of steps taken. If > X do something. But whenever it sets the variables it sets them to 0. I have pressed F9 and manually changed Var1 as soon as I step it resets to 0.
 

Baka-chan

☆*:.。. o(≧▽≦)o .。.:*☆
Veteran
Joined
Dec 19, 2012
Messages
490
Reaction score
148
First Language
German
Shaz - it will be a couple of days before I can upload a screen shot. Laptop charger broke new one is on its way. I have only added a quest script. I do realize that setting it will only work temporarily.

Baka-chan - that is very similar to what I have done. I have set up my variables the same way.

I have an on action event that sets two variables to the current amount of steps and flips a control self switch. Then I have a parallel process that sets var1 to the current steps then subtracts var1 from var2 to get the amount of steps taken. If > X do something. But whenever it sets the variables it sets them to 0. I have pressed F9 and manually changed Var1 as soon as I step it resets to 0.
There are two problems in your statement:

1. When does the parallel process change the steps inside var1? If it's before the player has even started walking since you counted the steps then it will be the same amount as var 2 and if var 1 = var 2 then var 1 - var 2 = 0

You have to stop the steps at some other time/event that doesn't start right after you just started counting!

2. If you do var 2 - var 1 then your outcome will be negative and it should be the other way around since you want to display a positive number in your text.
 

crashnburn

Villager
Member
Joined
Dec 10, 2013
Messages
11
Reaction score
0
Primarily Uses
1. That is how I want it. If I haven't moved I want it to show 0. As it loops it will reset var1 to current and when steps are taken it will change the 0 to however many are taken.

2. It is set to var1 - var2, sorry if I put that wrong before.

The main thing here though is that the variable is not getting set to steps. During my testing I had two variables set up on an action triggered event. Var1 was set like you have in your screen shot, var2 was set using the script I posted in my first post. Var2 retrieved the steps var1 did not. When I can get on my laptop I will try removing my quest script and see if that is causing the issue.
 

Baka-chan

☆*:.。. o(≧▽≦)o .。.:*☆
Veteran
Joined
Dec 19, 2012
Messages
490
Reaction score
148
First Language
German
Ok, then only screenshots of the events can help now.
 

crashnburn

Villager
Member
Joined
Dec 10, 2013
Messages
11
Reaction score
0
Primarily Uses
I will post them as soon as I can. Thank you guys for the pointers I really appreciate it.
 

crashnburn

Villager
Member
Joined
Dec 10, 2013
Messages
11
Reaction score
0
Primarily Uses
Alright! I borrowed a charger and got pictures. Here is an example of what I'm talking about. I also removed the quest script.


Sent from my LG-LS970 using Tapatalk 4

uploadfromtaptalk1394315385065.jpg

uploadfromtaptalk1394315400567.jpg

uploadfromtaptalk1394315416181.jpg
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Well, that will only run once, since it's set to player touch. I'd like to see the actual event you're struggling with, not just a quick demo you created (though that's a good idea to do for the purposes of troubleshooting).
 

crashnburn

Villager
Member
Joined
Dec 10, 2013
Messages
11
Reaction score
0
Primarily Uses
OK I will get more screen shots as soon as I can, currently not near my computer. These do show the problem though. Even if it only runs once it never sets the variable to the steps unless I use actual code as shown. I crossed that event twice, var1 unchanged and var2 changed.
 

crashnburn

Villager
Member
Joined
Dec 10, 2013
Messages
11
Reaction score
0
Primarily Uses
Ok so I copied my event from the previous screen shots into a new game and the variable updated as it should. I am assuming that some how the code that sets game data - other - steps, has been altered. Does anyone know where this section is in the scripts?
 

crashnburn

Villager
Member
Joined
Dec 10, 2013
Messages
11
Reaction score
0
Primarily Uses
Nvm I figured it out, well sort of... After the new game worked I decided to copy and paste all the game objects scripts over and now it works as it should.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
crashnburn, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


Just edit your last post and add the extra info.


The code would not have been altered unless you'd altered it.


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 Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,859
Messages
1,017,030
Members
137,566
Latest member
Fl0shVS
Top