[RMVX ACE] LIMITED NUMBER OF TIMES YOU CAN USE A SKILL (RESOLVED)

Posts

Pages: 1
unity
You're magical to me.
12540
Hello! :D

I wanted to make skills that the heroes gain via equipping certain equipment, but instead of using MP, they have a set number of uses and then they cannot be used again until you rest at an inn.

I had something similar in a XP project, but given that I knew zero scripting, I just made multiple copies of the same skill, with a different one for each number of uses left, and one that couldn't be used for when uses = zero, and checked it all with common events.

That seems a bit cumbersome, so I'm hoping to find a script or something similar that'll do the same thing. Yanfly's Skill Restrictions, using the <limited uses: x> tag, does basically what I want, except that it refreshes the uses after battle, and I want them to specifically refresh when the party rests.

Does anyone have any ideas how to do this? Could it be done by modifying the Yanfly script or is there a somewhat simple method that could make it work?

Thanks very much in advance! :DDD
Craze
why would i heal when i could equip a morningstar
15170

def on_battle_end
game_battler_on_battle_end_srs
reset_cooldowns
reset_times_used
end


find this and comment out or delete the reset_times_used line.

then call this at rests (using the in-event script code):


for i in 0..$game_party.members.size
$game_actor[$game_party.members[i]].reset_times_used
end


haven't actually tried this, lemme know if it works. i don't see why it wouldn't =P
unity
You're magical to me.
12540
That sounds like exactly what I need! I'll give it a try and report back! :DDD Thanks, Craze!
Max McGee
with sorrow down past the fence
9159
author=Craze

def on_battle_end
game_battler_on_battle_end_srs
reset_cooldowns
reset_times_used
end
find this and comment out or delete the reset_times_used line.

then call this at rests (using the in-event script code):


for i in 0..$game_party.members.size
$game_actor[$game_party.members[i]].reset_times_used
end

haven't actually tried this, lemme know if it works. i don't see why it wouldn't =P

oh man this is awesome ... if this works then nothing stops developers from having D&D style times per day skills :D
unity
You're magical to me.
12540
Sorry to say this after I got help, but I found a better script for what I'm trying to do. Here it is, for anyone interested. It will not only disable the skill after a certain number of uses, but it'll also keep track of how many charges you have left, which is really nice.

Sorry about that ^^;;;;;
Craze
why would i heal when i could equip a morningstar
15170
it took three minutes of my time, i ain't mad
unity
You're magical to me.
12540
Haha, cool, I'm glad ^_^ I just don't like wasting people's time XD
NeverSilent
Got any Dexreth amulets?
6299
author=unity
I had something similar in a XP project, but given that I knew zero scripting, I just made multiple copies of the same skill, with a different one for each number of uses left, and one that couldn't be used for when uses = zero, and checked it all with common events.

That seems a bit cumbersome


I... I would have done it exactly like that... Meh.

But nice to see you found a way to make this actually work better now, unity. It's a really interesting mechanic I always hoped to see more often.
unity
You're magical to me.
12540
author=NeverSilent
author=unity
I had something similar in a XP project, but given that I knew zero scripting, I just made multiple copies of the same skill, with a different one for each number of uses left, and one that couldn't be used for when uses = zero, and checked it all with common events.

That seems a bit cumbersome
I... I would have done it exactly like that... Meh.

But nice to see you found a way to make this actually work better now, unity. It's a really interesting mechanic I always hoped to see more often.

I know you're super skilled in doing cool things with events, NeverSilent :D In this case, it would have gotten super-complicated, as each skill is only supposed to show up if you have the right piece of equipment equipped, and if I used multiple skills to simulate the limited uses, I'm not sure how I would make both of those elements work together.

In my early XP days (and RPG 2000 days, on anything I worked on after starting Chase for Divinity), I had to get inventive with common events and multiple skills to simulate an effect of just one skill, but if a script can save me hours and hours of time and look better while doing it, I'll take the script ;)
NeverSilent
Got any Dexreth amulets?
6299
Thanks for the kind words, unity. But really, in this case, I would totally have gone with the script as well. They can make things so much easier and more elegant when used well - it's just the question of availability that poses a problem if one can't script.
Pages: 1