[ian-reeds-games] Re: skill mod function

  • From: "Allan Thompson" <allan1.thompson@xxxxxxx>
  • To: <ian-reeds-games@xxxxxxxxxxxxx>
  • Date: Sat, 24 Aug 2013 11:34:18 -0400

Is it my birthday already? Christmas? Cause there is all these gifts….grin.

Thanks for your hard work!

al 

 

From: ian-reeds-games-bounce@xxxxxxxxxxxxx 
[mailto:ian-reeds-games-bounce@xxxxxxxxxxxxx] On Behalf Of abigail prescott
Sent: Saturday, August 24, 2013 10:16 AM
To: ian-reeds-games@xxxxxxxxxxxxx
Subject: [ian-reeds-games] skill mod function

 

Hi, I’ve been working on a script that will let you change the damage inflicted 
by an skill depending on unit stats. I haven’t tested all of it, and I might 
have forgotten to include some features that would improve how it works, but it 
seems like it works...

https://dl.dropboxusercontent.com/u/94819755/skill%20mod.zip

 

Here’s a folder with the script to put into the scripts folder, an attack skill 
file from my map that will hopefully help demonstrate how to use the event and 
a file to help explain a slightly more complicated parameter you can set.

The script file is called skill mod, the skill file is called attack, and the 
other one is the help file.

I’ll add some more examples if people want them, I just haven’t written them 
yet and I wanted to send this out.

This function should allow you to take different amounts of damage depending on 
either the stats of the unit using the skill, the unit the skill is being used 
on, or both. You can use the stats in formulae to calculate how much damage 
should be taken.

Parameters:

s_mod: the stat of the unit using the skill (known as the source_unit) that 
modifies the damage

t_mod: the stat of the unit the skill is being used on (known as the 
target_unit) that modifies the damage taken

affected: the stat that is affected, so health if the skill is an attack

multiplyer: this is a number that the modifier is multiplied by. If you want 
the modifier to be divided instead, use 1/number you want to divide by.

add: this is a string (meaning it is in quotes), but it should either be a 
number, a range (like 0r5 for a number from 0 to 5) or a dice roll (like 2d6 
for a roll of two six-sided dice), the script turns it into a number

compare: a formula in quotes that you might want to use if you are using s_mod 
and t_mod. E.g: “t_mod-s_mod” if you want to subtract the source_unit’s stat 
from the target_unit’s stat.

message: this is explained in the help file as it is a bit more complex

 

Basically, after the game gets all these values, it works out the value of mod 
(if only s_mod is used and not t_mod then mod is s_mod and vice versa, if both 
s_mod and t_mod are used, then mod is the result of the formula in compare). 
Then it multiplies mod by the multiplyer (if you use a decimal or fraction so 
it’ll divide, remember the number will be rounded) and adds add. This number is 
called damage. Damage is then taken from the point you specified for the 
affected argument.

 

This doesn’t only have to be used for offensive skills, I intend to write some 
examples of how to use it for other kinds of skills.

 

Sorry if this isn’t very well explained, but I never was the best at explaining 
things like this, and doing it by email is harder. It’s also too hot today, I 
think I’m going to take a break and have some icecream! I have the feeling I’m 
leaving something out, but I can’t remember it so hopefully it isn’t important.

 

Abi

Other related posts: