Jump to content
Geno Craft

Randomly Learn Skills When Using Normal Attack

Recommended Posts

There is a mechanic in Touhou Gensoumaroku ~ Devil of Decline where when you use your normal attack, there is a chance using a random skill instead, the skill then is learned permanently. The skills depend on your weapon type(sword, axe, spear) and can only be learned if the enemy has a high enough level. Is there a script that allows me to do this in my game?

Share this post


Link to post
Share on other sites

Hey Geno,

 

You could use the snippet found here:

http://www.rpgmakercentral.com/topic/17187-common-event-before-damage-script-mod-help/

 

This will allow you to run a common event before damage if you put the appropriate note tag in the skill.

With this solution, you would need an atk skill for your enemies and a separate one for the player.

 

How the common event should work is up to you based on what your needs are. At minimum it should do the following:

1. Randomize a variable so that only the right % of atks will proc learning a skill

2. IF the randomizer hits, then have it check the actor ID taking action, the actor level, the actor weapon type equipped, and the target ID

3. Set another randomizer to select which skill will be learned

4. IF the skill is not learned yet, then FORCE ACTION use of the skill and have the actor learn the skill

5. IF the skill is learned, then do nothing or have it roll again for a different skill

 

That is the general idea at least.

 

This is not a sophisticated solution, but you won't need to do much scripting with this approach.

The main issues you might have are: script calling the correct ID's, targeting, and that it would be a cumbersome set of checks.

 

Hope this helps!

~ Dinhbat3

Edited by dinhbat3

Share this post


Link to post
Share on other sites

You can try this script:

 

https://www.dropbox.com/s/tiarbxi9kuurnjg/battle_learn.rb?dl=0

 

In a weapon, you need to put this <skill 12 23>

 

where 12 is the id of the skill you can learn

and 23 is the chance to learn the skill (in percent, only reads integer)

 

It may need polish in terms of message display but it seems to work

Share this post


Link to post
Share on other sites

Hey Geno,

 

You could use the snippet found here:

http://www.rpgmakercentral.com/topic/17187-common-event-before-damage-script-mod-help/

 

This will allow you to run a common event before damage if you put the appropriate note tag in the skill.

With this solution, you would need an atk skill for your enemies and a separate one for the player.

 

How the common event should work is up to you based on what your needs are. At minimum it should do the following:

1. Randomize a variable so that only the right % of atks will proc learning a skill

2. IF the randomizer hits, then have it check the actor ID taking action, the actor level, the actor weapon type equipped, and the target ID

3. Set another randomizer to select which skill will be learned

4. IF the skill is not learned yet, then FORCE ACTION use of the skill and have the actor learn the skill

5. IF the skill is learned, then do nothing or have it roll again for a different skill

 

That is the general idea at least.

 

This is not a sophisticated solution, but you won't need to do much scripting with this approach.

The main issues you might have are: script calling the correct ID's, targeting, and that it would be a cumbersome set of checks.

 

Hope this helps!

~ Dinhbat3

That's great, it'll surely help a lot! Though, I don't really know how to check which actor is attacking and how to make Force Action target the right enemy...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted