Confused with void Func_Name
Being new to the scripting language I really want to learn but am having a extremely hard time grasping one part of the new language. I searched the forums and didn't come up with a thread relating directly to this but if there is one i apologize for posting this. Otherwise:
Basically, I cannot tell what comes after void. For example, I know that it is void Func_name() but i do not know what to put in the (). What I'm currently trying to do is make a Grunt poof after a timer of 45 seconds expires. Here's the script.
void OnStart()
{
AddUseItemCallback("", "key_1", "castle_1", "UsedKeyOnDoor", true);
AddUseItemCallback("", "key_2", "castle_7", "UsedKeyOnDoor1", true);
AddUseItemCallback("", "key_3", "castle_2", "UsedKeyOnDoor2", true);
SetEntityPlayerInteractCallback("key_2", "spawn_func", true);
}
void spawn_func(string &in item)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 4, "");
AddTimer("Fade", 45, "Fade");
}
void Fade (WHAT GOES HERE?)
{
FadeEnemyToSmoke(servant_grunt_1, true);
}
So far, I've managed to make it where I'm at through other guides, but even so I still don't understand how i can tell what goes in the (). (I also don't know if i scripted the timer correctly so can someone please check that for me?)
Also, as helpful as people are, I'd rather not have to rely on people every time I run into this problem. If somebody can give me a link or a good explanation on how to learn what to put there, I would appreciate it. Sorry if i seem uberly nooby at this, it's just that this coding language is just so different from what I learned. (LUA)
(This post was last modified: 03-11-2012, 08:01 PM by DaAinGame.)
|