Why is this variable not setting?

DarknessFalls

Rpg Maker Jesus - JS Dev.
Veteran
Joined
Jun 7, 2013
Messages
1,393
Reaction score
210
First Language
English
I have the following:

When A battle with these guys is finished, the variable should increase to 1 or well add 1 to the existing value. that doesn't happen. ever. I am using Yanfly Engine Ace - Debug Extension v1.01 to find out whats going on. before a battle this variable is 0. after a battle this variable is 0. Nothing resets the variable unless you leave the map or the time runs out. Neither of which has happened yet.

The variable is initialized to 0 before the timer is started in an event that the player must step on. But - the player never steps on that even again so the variable is not being constantly reset.

Am I setting this wrong?

Its suppose to be, when you defeat and emerge victorious this variable increases by one.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
uhm, Conditions: Don't Run


so don't expect that to run, ever.
 
Last edited by a moderator:

DarknessFalls

Rpg Maker Jesus - JS Dev.
Veteran
Joined
Jun 7, 2013
Messages
1,393
Reaction score
210
First Language
English
Ok so.....That was not helpful. how am I suppose to get the variable to increase? these are random battles.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
You could select the Run at turn X for example, and put 0 and 0 so that it runs right at the start of the battle


but to run it at the end, there doesn't seem to exist a condition for that by default. I think there are some scripts out there that would allow you to.
 
Last edited by a moderator:

_Shadow_

Tech Magician Level:
Moderator
Joined
Mar 2, 2014
Messages
4,078
Reaction score
2,654
First Language
Greek
Primarily Uses
RMMZ
uhm, Conditions: Don't Run

so don't expect that to run, ever.
means "don't run from battle. Stay and fight"

It applies only once.

you must use another condition.

I cover these stuff in my tutorial game. Here...

CLICK ME.
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
means "don't run from battle. Stay and fight"
That is absolutely wrong - the condition "don't run" means "do not run/execute this event" - that is why it's the default (to prevent troop events from messing up if unused) and it has absolutely nothing to do with the escape command inside the battles.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Yep, I used to think it meant "choose to fight" as well, but had to look into it some more for a script I was writing a while ago.

Code:
    c = page.condition    if !c.turn_ending && !c.turn_valid && !c.enemy_valid &&       !c.actor_valid && !c.switch_valid      return false      # Conditions not set: not executed    end
So basically, if none of the condition boxes are checked (this is when it says Don't Run), it automatically returns false, saying the condition is not met.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Ok so.....That was not helpful. how am I suppose to get the variable to increase? these are random battles.
Nope.


edit ... darn, I've just come back and read this, and can't make sense of my reply. I think what happened was that I added some code after that, along with an explanation of why it won't ever run. But for some reason, this forum SOMETIMES just "loses" a good portion of a post when code is added. I should have paid more attention when I posted and I would have seen the code and explanation had been lost.
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
Its suppose to be, when you defeat and emerge victorious this variable increases by one.
Back to the topic, just in case the OP still needs help.
Your first problem was that you placed the wrong condition, it would never run because of this.


Unfortunately there is no "correct" condition - the only condition that would check for an enemy defeat (Enemy HP =0%) has unfortunately a lower priority than the death check, which means that for the last enemy the battle ends BEFORE the troop event can be executed on that condition.


You need to use an indirect way to solve this problem. There are several different ways to do this, but each of them has their own advantages and disadvantages.


To select the correct way we would need some more info on why you want to increase this count.


1) Is the count only for this specific troop, or do you count the victories over all troops? If you count all, is that in the same variable or one variable per troop?


2) How do you use that variable after the battle? what should it affect?


3) Is the count for only part of the game (a quest or a map for example) or will the count be used everywhere in the entire game?
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
This question has been asked numerous times, and I really don't know what all the fuss is about.


Make it run on the first turn, once only during the battle. It will increase at the start of battle. You DON'T have to wait until the last enemy is killed to increase it. If you win the battle, it will be incremented. If you lose the battle, the game will end and you'll have to reload from a save file prior to it being incremented.


The only time you would get an incorrect increment is if you allow the player to escape the battle, or if you're using some script that prevents game over when you lose a battle. If you check the "continue when loser" box (if your battles are evented) then in the When Lose condition you can decrement the variable again.
 

_Shadow_

Tech Magician Level:
Moderator
Joined
Mar 2, 2014
Messages
4,078
Reaction score
2,654
First Language
Greek
Primarily Uses
RMMZ
That is absolutely wrong - the condition "don't run" means "do not run/execute this event" - that is why it's the default (to prevent troop events from messing up if unused) and it has absolutely nothing to do with the escape command inside the battles.
Really? :-O

Gee seems that I  was more confused than I thought on that. Thanks for stating it. I must correct this to my game too.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,674
First Language
German
Primarily Uses
RMMV
Really? :-O


Gee seems that I  was more confused than I thought on that. Thanks for stating it. I must correct this to my game too.
It comes from the phrase "to run a program" - in most old interpreters, you needed the "run" command to start the loaded program. It's basically a relict from pre-PC computers. Examples are the Commodore C64 and all other computers from that generation (and earlier). It was the same with several programs in earlier DOS.systems on the PC and became forgotten and unused with the first Windows-Systems on PCs.
 

_Shadow_

Tech Magician Level:
Moderator
Joined
Mar 2, 2014
Messages
4,078
Reaction score
2,654
First Language
Greek
Primarily Uses
RMMZ
It comes from the phrase "to run a program" - in most old interpreters, you needed the "run" command to start the loaded program. It's basically a relict from pre-PC computers. Examples are the Commodore C64 and all other computers from that generation (and earlier). It was the same with several programs in earlier DOS.systems on the PC and became forgotten and unused with the first Windows-Systems on PCs.
Yes I know the command. :p

Had an Amiga and an Amstrad. ;)

Wow, is that the reason they did it that way? :p

Niiice! It feels now so nostalgic... 

Thanks for sharing that info.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
"run" is a standard term in programming that means "execute". I'm not sure the makers of RPG Maker had those old computers in mind when they decided to call that condition "don't run". That may be the origin of the term, but the meaning is now so widespread and well understood that it's doubtful many people know or care where it came from. So probably no intentional nostalgia there, on the part of the creators ;)
 

_Shadow_

Tech Magician Level:
Moderator
Joined
Mar 2, 2014
Messages
4,078
Reaction score
2,654
First Language
Greek
Primarily Uses
RMMZ
In any case, "Run" was the programming term and not the game option.

Got it. ;)
 

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

Latest Threads

Latest Posts

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,862
Messages
1,017,047
Members
137,569
Latest member
Shtelsky
Top