HAVING A WEAPON DEAL DAMAGE BASED ON SPIRIT STAT?
Posts
Pages:
1
How would I go about doing this?
Seeing all those fractured pieces of code they give aren't helping!
If someone would please make me just a basic coding for a staff that deals fire damage based on the Spirit stat,(not Strength), I will monkey with it and start to figure it out.
Thanks in advance!
- Beakmantheapparentlynotverygoodatcoding
Seeing all those fractured pieces of code they give aren't helping!
If someone would please make me just a basic coding for a staff that deals fire damage based on the Spirit stat,(not Strength), I will monkey with it and start to figure it out.
Thanks in advance!
- Beakmantheapparentlynotverygoodatcoding
State your maker.
Also, assuming we're talking VX, this needs to be scripted - unless you wanted a skill with the same function. They have a very large selection of fine VX scripts over at rpgmakervx.net (or whatever it's called). I'm sure Yanfly or KGC covered this in one of their scripts.
Also, assuming we're talking VX, this needs to be scripted - unless you wanted a skill with the same function. They have a very large selection of fine VX scripts over at rpgmakervx.net (or whatever it's called). I'm sure Yanfly or KGC covered this in one of their scripts.
With my limited scripting knowledge, I've managed to find a way for you. I'm assuming you're still asking about VX.
Open the script editor (F11 or under tools). Then, look for a script named "Game_Battler" and Ctrl+F for "def make_attack" (or look for line 642).
You will then see:
Replace it with:
That adds one line of code that checks if your attack is using the element with the ID number of 17 and modifies your damage (also making it so that the previous line doesn't matter). You can change the 17 to whatever you want. You can also modify the calculations too.
Then, open the database. Click on the system tab and create an element 17 (or the number you picked, or rename an already existing one). Name it something like "Magic Staff" or something to remind you of what it's for.
After that, create your weapon and under the elements section, check the fire element and the element you just made.
Since by default only the most effective element will be used when calculating damage, to avoid your "Magic Staff" element accidently making your attack stronger than intended, you should probably set every monster's resistance to it to F. This is assuming you'll always be using at least 2 elements on the weapons using this element. If not, don't do this or the monsters will be healed from every hit (F is -100%).
Open the script editor (F11 or under tools). Then, look for a script named "Game_Battler" and Ctrl+F for "def make_attack" (or look for line 642).
You will then see:
def make_attack_damage_value(attacker)
damage = attacker.atk * 4 - self.def * 2 # base calculation
damage = 0 if damage < 0 # if negative, make 0
damage *= elements_max_rate(attacker.element_set) # elemental adjustment
damage /= 100
Replace it with:
def make_attack_damage_value(attacker)
damage = attacker.atk * 4 - self.def * 2 # base calculation
damage = attacker.spi * 4 - self.def * 2 if attacker.element_set.include?(17)
damage = 0 if damage < 0 # if negative, make 0
damage *= elements_max_rate(attacker.element_set) # elemental adjustment
damage /= 100
That adds one line of code that checks if your attack is using the element with the ID number of 17 and modifies your damage (also making it so that the previous line doesn't matter). You can change the 17 to whatever you want. You can also modify the calculations too.
Then, open the database. Click on the system tab and create an element 17 (or the number you picked, or rename an already existing one). Name it something like "Magic Staff" or something to remind you of what it's for.
After that, create your weapon and under the elements section, check the fire element and the element you just made.
Since by default only the most effective element will be used when calculating damage, to avoid your "Magic Staff" element accidently making your attack stronger than intended, you should probably set every monster's resistance to it to F. This is assuming you'll always be using at least 2 elements on the weapons using this element. If not, don't do this or the monsters will be healed from every hit (F is -100%).
W00t!
Thanks man!
Now that I've *seen* an orignal line of code, and the effect it had, I am starting to get it...
I'm going to try to turn my guy into a werewolf. Super strong, but can't use magic. You lose control of them, too.
Maybe I'll have it trigger when he's hit by dark damage...
EDIT: I thought I had typed that I was using VX...
Sorry guys!
Thanks man!
Now that I've *seen* an orignal line of code, and the effect it had, I am starting to get it...
I'm going to try to turn my guy into a werewolf. Super strong, but can't use magic. You lose control of them, too.
Maybe I'll have it trigger when he's hit by dark damage...
EDIT: I thought I had typed that I was using VX...
Sorry guys!
post=92520
With my limited scripting knowledge, I've managed to find a way for you. I'm assuming you're still asking about VX.........
This is exactly the way I would have explained it. I love elements.
To bypass the funky/stupid element system, go get some Mithran scripts on rpgmakervx.net and set up multiplicative damage for element rates. That way, having a 100% damage element (spirit-based damage weapon tag) and 200% damage element (fire) will mean you do (1.0 x 2.0) damage... further meaning that you'll still do 200% damage.
Pages:
1















