FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: GivePlayerDamage help and some explanation please!
Listen
When you write "void" then you specify that you want to make a function.
The function needs a name so it will be "void Function_1".
But what kind of function is this? Is it when you collide with something or is it when you touch something. That is how the program wonders.
So if it is a function when you collide with something then it is:
(string &in asParent, string &in asChild, int alState)
asParent = The first entity (Might be player)
asChild = The second entity (Might be an area) which the first entity collides with.
int alState = if the asParent is going inside asChild or away from asChild
Is it a function when you touch something? Very well:
(string &in asEntity)
asEntity = The entity that is being touched. There is only 1 thing that can touch, and that is the player. Therefor we don't need to specify what is touching.
Do you understand?
What is inside the function { INSIDE THESE } doesn't matter at all.
Here is a clear example:
void ThisIsACollideFunction(string &in asParent, string &in asChild, int alState)
{
What goes in here has nothing to do with the above.
GivePlayerDamage(Inside here is the properties for the "GivePlayerDamage")
}
Trying is the first step to success.
|
|
08-22-2012, 05:28 PM |
|