Removing Points from a Control Variable 1 point at a time when walking

Beta4

Veteran
Veteran
Joined
May 15, 2015
Messages
72
Reaction score
1
First Language
English
Primarily Uses
So Im trying to get points deducted from a variable that i set up- lets call it AbilityPoints. And everytime the hero walks I want 1 ability points to deduct.


I have tried but it never deducts such as AbilityPoints -= Step(from game data) and it doesnt work, becuase i use a text box to display the ability points total after I walk for a bit and still stays the same. Can anyone help with my problem. thanks
 

KanaX

Just being a sleepy
Veteran
Joined
Apr 3, 2013
Messages
1,455
Reaction score
1,297
First Language
Broken English.
Primarily Uses
N/A
Could you please show us the command that you use to calculate your ability points?
 

Beta4

Veteran
Veteran
Joined
May 15, 2015
Messages
72
Reaction score
1
First Language
English
Primarily Uses
lets see


TextBox: Here you go hero I will give you 1000 ability points, just remember that when you start to walk you will loose them.


AbilityPoints = 1000


If :AbilityPoints >0


AbilityPoints -=Step(game data)


End
 
Last edited by a moderator:

KanaX

Just being a sleepy
Veteran
Joined
Apr 3, 2013
Messages
1,455
Reaction score
1,297
First Language
Broken English.
Primarily Uses
N/A
Can you show me a screenshot?
 

Beta4

Veteran
Veteran
Joined
May 15, 2015
Messages
72
Reaction score
1
First Language
English
Primarily Uses
Sorry took a bit to reply:


Screenshot (10).png
 

KanaX

Just being a sleepy
Veteran
Joined
Apr 3, 2013
Messages
1,455
Reaction score
1,297
First Language
Broken English.
Primarily Uses
N/A
Does it tell you that your Current Ability Points are always 0 or 1000?
 
Last edited by a moderator:

Beta4

Veteran
Veteran
Joined
May 15, 2015
Messages
72
Reaction score
1
First Language
English
Primarily Uses
Well you start as 0 but everytime you talk i would want it to give you another 1000 everytime you talk to the character. Or am I forgetting to set something...? You if you walk some it deducts points but when you talk to the character it adds another 1000 to whatever you have left after walking.
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,359
Reaction score
7,672
First Language
German
Primarily Uses
RMMV
The steps number is always the total number of steps since the game has started, it can't be reset.


And since it is triggered on action button, each action button will reduce the entire number (even steps that had been substracted the previous action button.
 

Beta4

Veteran
Veteran
Joined
May 15, 2015
Messages
72
Reaction score
1
First Language
English
Primarily Uses
So then there is no way to do this?
 

KanaX

Just being a sleepy
Veteran
Joined
Apr 3, 2013
Messages
1,455
Reaction score
1,297
First Language
Broken English.
Primarily Uses
N/A
There is. Now, I might be a little roundabout in the way I handle it because I'm not too familiar with MV but here's a set up:
 


You need a parallel process common event that will calculate your AP whenever you take a step. So I have a switch that will activate your common event. I give the player 1000 AP as you have, but then I store in a variable the number of the steps you have made so far.


Now this is the common event. After you activate it, it will always store in a variable your step count (not only once as the previous event) "#0001 Step Count = Steps".


Now, if your current Step Count is bigger than your previous one "If: Previous Step Count < Step Count" it will mean that you have taken a step and thus I tell your AP to lose 1 point "#0020 AP -= 1". And then I make the Previous Step Count and Step Count equal "#0020 Previous Step Count = Step Count" so that you will lose no more AP until you take another step.

I tested it and it should work fine. Perhaps Andar has a better plan.
 

Beta4

Veteran
Veteran
Joined
May 15, 2015
Messages
72
Reaction score
1
First Language
English
Primarily Uses
So I opened a new project because for some reason , i can talk to the character once but after that I cant talk talk to him again. Can you check out what i did wrong on the other settings? I also imaging if i wanted to pile up the Ability Points I could do Control Variable : #0020 AP += 1000 on line 6 correct of the first page?


Screenshot (13).pngScreenshot (14).png
 

KanaX

Just being a sleepy
Veteran
Joined
Apr 3, 2013
Messages
1,455
Reaction score
1,297
First Language
Broken English.
Primarily Uses
N/A
What you have done is make two pages in the same event. Common events can be accessed from Tools -> Database -> Common events. Commons Events will always work on every map, up until the moment you deactivate them. Cut everything from the second event page and paste it in a common event. Then delete the second event page.
 
Last edited by a moderator:

Beta4

Veteran
Veteran
Joined
May 15, 2015
Messages
72
Reaction score
1
First Language
English
Primarily Uses
I get in now. Thank you so much! I really appreciate all the patience and support you have shown me.
 

KanaX

Just being a sleepy
Veteran
Joined
Apr 3, 2013
Messages
1,455
Reaction score
1,297
First Language
Broken English.
Primarily Uses
N/A
Did you test it? Does it work? You are welcome. Try to get accustomed a bit more with the terminology and capabilities of RM, so you will be able to stay independent from now on!
 

Beta4

Veteran
Veteran
Joined
May 15, 2015
Messages
72
Reaction score
1
First Language
English
Primarily Uses
Oh I am. Works great! I do appreciate it :)
 

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

Latest Threads

Latest Posts

Latest Profile Posts

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'??
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

Forum statistics

Threads
105,857
Messages
1,017,018
Members
137,563
Latest member
MinyakaAeon
Top