Jump to content
Sign in to follow this  
Tesaigo

Weapon using MP/TP for each attack

Recommended Posts

Hello!

I'm using an ABS and I would like the weapons to spend a value/percentage of the actor's MP/TP for each attack. I was planning to rename the MP/TP as "Energy" or "Stamina" and each attack made would spend some Energy/Stamina. It would be really cool if I could set specific values for each weapon separately, because there will be weapons heavier than others, meaning bigger costs to Energy/Stamina. You can take the Dark Souls series as reference for how the system would work.

So, can anyone help me do this? Maybe some explanation about how setting this on the database or maybe a script, whichever is easier.

Thanks in advance!

 

PS: Oh, and I'm using Falcao Pearl ABS 3.0 if that makes any difference.

Share this post


Link to post
Share on other sites

So, this should be pretty easy. You need to make a variable for stamina and set it to x (whatever max stamina will be) then just remove y from that variable whenever a weapon is used. (You could use the existing MP/TP system but you'll probably benefit from defining stamina yourself so you don't encounter any conflicting methods.)

A couple of things to note though:

-You'll need to restore stamina, either with items that add to the stamina variable or a parallel process that adds to the variable then waits for a passive regen.

-You'll need to create a hud to display the stamina info to the player. This can be done via eventing if you're really uncomfortable with scripting.

-You'll need to create a check and outcome for when the stamina is below the necessary amount to use. A stamina bar is meaningless if the player can keep doing stuff when its depleted.

-You'll need to add a check of what weapon is equipped to decrease the stamina variable by different amounts.

 

You'll probably need to do the last two in the script itself. Don't worry, should just be a couple of if statements. 

Let us know how you get on.

Share this post


Link to post
Share on other sites

So, this should be pretty easy. You need to make a variable for stamina and set it to x (whatever max stamina will be) then just remove y from that variable whenever a weapon is used. (You could use the existing MP/TP system but you'll probably benefit from defining stamina yourself so you don't encounter any conflicting methods.)

A couple of things to note though:

-You'll need to restore stamina, either with items that add to the stamina variable or a parallel process that adds to the variable then waits for a passive regen.

-You'll need to create a hud to display the stamina info to the player. This can be done via eventing if you're really uncomfortable with scripting.

-You'll need to create a check and outcome for when the stamina is below the necessary amount to use. A stamina bar is meaningless if the player can keep doing stuff when its depleted.

-You'll need to add a check of what weapon is equipped to decrease the stamina variable by different amounts.

 

You'll probably need to do the last two in the script itself. Don't worry, should just be a couple of if statements. 

Let us know how you get on.

 

Thanks for the answer! So, how can I set weapons to remove a value from a variable? I mean, I can reproduce the whole process with skills, including creating the variable, storing a Stamina value in it, removing a value each time a skill is used (through common events), creating items that restore Stamina and etc, but how can I do that with weapons? I'm a little confused...

Share this post


Link to post
Share on other sites

To remove the value you need to find the attack process in the ABS you're using and add the variable change to that method. I don't use other people's scripts so I cant go into greater detail but when you find the method it will be as straightforward as just adding a line ~'variable --= x' (I'm going to trust that you know enough to not literally write that x3 ). Try just doing that first.

 

The second step is to then add a check for what weapon the player has equipped so that you can alter the variable by different amounts. Fortunately there is an existing script call that does just that. You'll have to Google the exact syntax yourself (I'm at work :3 ) but if you search for something like 'player equip script call' you'll probly find it. (You could also go right to the source and search for the methods in the script editor).

Then its just using that script call for if statements and putting the different variable amounts as outcomes. You'll be placing these if statements in the same place in the ABS script as above.

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×