The RPG Maker Resource Kit

RMRK RPG Maker Creation => Requests => Script Request => Topic started by: Owlsey on May 07, 2009, 08:52:19 PM

Title: [RESOLVED] Kills Counter
Post by: Owlsey on May 07, 2009, 08:52:19 PM
<Battle Counter>
<5-7-09>




Summary
<<It needs to add constant 1 to variable 0009 every time a troop is defeated.>>

Features Desired

Games its been in

Did you search?
<<Yes, no results.>>

Title: Re: Kills Counter
Post by: tSwitch on May 07, 2009, 08:55:17 PM
Quote from: Owlsey on May 07, 2009, 08:52:19 PM
Did you search?
<<No>>

Will I help?
<<No>>
Title: Re: Kills Counter
Post by: Owlsey on May 07, 2009, 09:02:12 PM
I doubted I would get any results if I did search, and I was right.
Title: Re: Kills Counter
Post by: tSwitch on May 07, 2009, 09:08:49 PM
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.
Title: Re: Kills Counter
Post by: 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.
Title: Re: Kills Counter
Post by: modern algebra on May 07, 2009, 09:17:39 PM
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.
Title: Re: Kills Counter
Post by: modern algebra on May 07, 2009, 09:21:47 PM
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
Title: Re: Kills Counter
Post by: Owlsey on May 07, 2009, 09:28:44 PM
Thanks, that helped.
Title: Re: Kills Counter
Post by: tSwitch on May 07, 2009, 09:30:39 PM
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.
Title: Re: Kills Counter
Post by: 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.
Title: Re: [RESOLVED] Kills Counter
Post by: Owlsey on May 07, 2009, 09:46:15 PM
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.
Title: Re: Kills Counter
Post by: tSwitch on May 07, 2009, 10:10:34 PM
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
Title: Re: [RESOLVED] Kills Counter
Post by: Owlsey on May 07, 2009, 11:45:31 PM
No duh. A script is still way faster.
Title: Re: [RESOLVED] Kills Counter
Post by: Irock on May 08, 2009, 05:41:12 AM
Not everyone wants to double click on 100 different scattered items and paste something into each one of them.