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

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

Yes, I guess that makes sense.

So that is what the message is kind of doing, that you are talking about?

 

So are the arguments in those scripts variables too? I noticed that in craig’s 
docs, the {0} and {1} was used inside the quotes that seem to represent either 
the unit a skill is being used on and the  unit actually doing the skill. So 
are those variables to?

 

Just wondering.

al

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

 

Yes, things with quotes around them are strings, and these are usually words, 
though sometimes you might have a number or even some code as a string. There 
are some cool functions that can turn strings into whole numbers, decimals, or 
even a line of code that can be executed. That’s what I did with the message in 
the skill mod, which is also why it’s more complicated.

 

A good example of the differences between string and int variables is if you 
have two variables called string1 and string2, with the values “1” and “2”. 
Then you had two variables called int1 and int2, with the values 1 and 2. With 
the first two variables, if you added them together, you would get “12”, or 
“21” if you changed them round. With the second pair, you would get 3.

 

 

Abi

 

 

From: Allan Thompson <mailto:allan1.thompson@xxxxxxx>  

Sent: Saturday, August 24, 2013 10:00 PM

To: ian-reeds-games@xxxxxxxxxxxxx 

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

 

Huh?

Does this have anything to do with string cheese? I love stringcheese…

 

Actually, You mean quotes have to be around the variables that are words, 
right? Numbers don’t? 

Or, I guess if a number is something you want on the screen then I guess that 
would need quotes. But don’t quote me on that, grin.

al

 

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

 

Thank you. Now I have a clearer idea of things. So if I tell you that an 
parameter is a string variable or an int, you’ll know what I mean, so I don’t 
need to explain about quotes every time.

 

Abi

 

 

From: Allan Thompson <mailto:allan1.thompson@xxxxxxx>  

Sent: Saturday, August 24, 2013 7:55 PM

To: ian-reeds-games@xxxxxxxxxxxxx 

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

 

You mean like string cheese? I love that stuff! Then there is silly string that 
comes in a can…I don’t think that would work  in a programming setting. 

I do remember some things. 

I  remember variables. They could hold words or numbers. String  and int has 
something to do with that I think, although until you said it I had forgotten 
all about it.

 

I remember having to number each line of code.

I remember if, then kind of stuff in basic.

 

These things like arguments and events and all that, are totally beyond  
anything I ever learned. I am in my early forties so what I knew back then 
might not really be applicable now. 

 

Honestly, I remember the most playing with that graphic interface where you 
just plug graphic  edit boxes and buttons and stuff onto a blank window or 
template. There was some kind of code to go with it, but I can’t remember  
right now what it was. Modules maybe? 

Sorry, that is about all I can think of.

Like I said, I failed these classes. I finally had to give up, and switch 
directions.

 

al

 

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

 

So the words string and int mean nothing to you? At least not in a programming 
context, if you didn’t know what a string was out of context, I’d be quite 
worried.

 

Abi

 

 

From: Allan Thompson <mailto:allan1.thompson@xxxxxxx>  

Sent: Saturday, August 24, 2013 6:55 PM

To: ian-reeds-games@xxxxxxxxxxxxx 

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

 

Ok, so I am sarcasm deficient, grin. Or is that sarcasm disabled? Sarcastically 
challenged, grin…

 

Actually, I did take a number of programming classes in the past. That was 
years ago.

I did in fact flunk them. I  remember some kind of window with all sorts of 
controls you can put into the window and make it say “Hi” and the like, but 
that was more like point and click then programming anything. I did have a 
little BASIC in High School on apple 2e computers with greenscale monitors. 
That was a trip. 

 

Ironically, I ended up becoming much more fascinated in building computers and 
fixing their issues then actually telling them what to do. You would think that 
I would have realized that was something I liked to do, but  programming was 
such a big deal with lots of potential…

 

So in short, you might as well consider me nearly clueless. Consider me totally 
off the street wondering what all this stuff is, cause that is exactly how I 
feel. 

 

al

 

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

 

But it’s you who didn’t notice the sarcasm, not me.

 

I have read it, which is why I decided to try writing some examples. The 
problem is that I also like learning by looking at code and experimenting, but 
because I’m limited to writing emails and not being there in person, I can’t 
exactly go through it with you learning what things you do understand and what 
you don’t. Examples should work if I put some comments in to explain what 
things do, but it would be so much easier if I could actually see what you were 
doing. Just out of interest, do you know anything about programming at all? 
That’ll give me a better idea of what needs explaining and what doesn’t.

 

Abi

 

 

From: Allan Thompson <mailto:allan1.thompson@xxxxxxx>  

Sent: Saturday, August 24, 2013 6:12 PM

To: ian-reeds-games@xxxxxxxxxxxxx 

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

 

Hi Abi,

Lol, the birthday, it was just an expression. Then again maybe sarcasm doesn’t 
come across on email that well, grin. 

I suggest that maybe you should take a look at Craig’s documentation. He does a 
great job explaining and giving lots of examples. It is in the documentation 
folder in the data for TB  folder.

 

Personally, I have a hard time sitting and being taught thru books or being 
told what to do. 

I am very much a hands on, see how it is done and then do it based on that. It 
is why school was always so hard for me. If I can’t immediatly  use it for 
practical purposes, I end up just losing it.

But if I can mess with examples that work, I have a chance at eventually 
understanding and using it myself. 

Everyone is different, but that is kind of how I do things. 

I just keep practicing something till I got it, but it takes time for me to get 
it. Sometimes I run out of patience  cause I just don’t understand it, and it 
gets dropped till I can focus on it again. Sometimes that helps too.

 

al

 

 

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

 

Well possibly, I don’t know when your birthday is. I’m not sure how well that 
last script will work because there is a lot of different things to keep track 
of and it still isn’t completely customiseable, but I’m mostly worried about 
people understanding what to do with it (especially the message thing). Do you 
think it makes sense? Or should I try to explain things differently?

 

Abi

 

 

From: Allan Thompson <mailto:allan1.thompson@xxxxxxx>  

Sent: Saturday, August 24, 2013 4:34 PM

To: ian-reeds-games@xxxxxxxxxxxxx 

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

 

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: