<Battle Counter>
<5-7-09>
Summary<<It needs to add constant 1 to variable 0009 every time a
troop is defeated.>>
Features Desired
- Does not add 1 for every enemy defeated, only troop.
- Optional: Turn switch 145 on when variable 009 reaches 10.
- Optional: Turn switch 146 on when variable 009 reaches 50.
- Optional: Turn switch 147 on when variable 009 reaches 200.
- Optional: Turn switch 148 on when variable 009 reaches 9001.
Games its been in
- Thing Thing Arena 3 (When you unlock awards for killing a number of enemies, except I intend to do this with troops.)
Did you search?<<Yes, no results.>>
I doubted I would get any results if I did search, and I was right.
Quote from: Owlsey on May 07, 2009, 09:02:12 PM
I doubted I would get any results if I did search, and I was right.
have you tried eventing it?
it's not very difficult at all.
I have over 100 troops, and I don't want to have to event them all. If it really is so easy (which I don't doubt), then please just make it.
Why the switches? Any conditional that can check a switch can check a variable.
And yeah, why not event it? The script is easy too, but it's kind of pointless to write a script that would only be used by people who cannot event and therefore cannot possibly make a good game. I'll write this script because it will take 5 seconds and you took the effort to fill in the template, which is always a plus, but you really ought to learn how to event. This is simpler than almost any other event you could conceive of.
Place this code above Main and below all other custom scripts:
class Scene_Battle
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Battle Ends
# result : results (0:win 1:lose 2:escape)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_owlsey_ynotevnt_killcounter_52b4 battle_end
def battle_end (result)
# Add to counter if a victory
$game_variables[9] += 1
# Run Original method
modalg_owlsey_ynotevnt_killcounter_52b4 (result)
end
end
Thanks, that helped.
Quote from: Owlsey on May 07, 2009, 09:10:56 PM
I have over 100 troops, and I don't want to have to event them all. If it really is so easy (which I don't doubt), then please just make it.
translation:
I really don't feel like doing it, I realize it's easy, just do it for me.
anyway, request fulfilled, please add [resolved] to the topic title, I know it's easy, but I'm too lazy to do it.
Wouldn't he have to go back and add a variable increase to all 100 troops? That could take a bit of time.
Look, i'm not going to argue with you, I don't know RPGXP scripting yet. And I could do the same for 100 troops, but a script would prevent unintentional "glitches" where I forgot to do so, and I WILL make more troops. Rather just take 5 minutes to request here than 30 doing what you suggested.
Quote from: Irock on May 07, 2009, 09:33:16 PM
Wouldn't he have to go back and add a variable increase to all 100 troops? That could take a bit of time.
ctrl + c
ctrl + v
No duh. A script is still way faster.
Not everyone wants to double click on 100 different scattered items and paste something into each one of them.