The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Confused with void Func_Name
DaAinGame Offline
Member

Posts: 90
Threads: 11
Joined: Mar 2012
Reputation: 4
#1
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)

Realm Of Another Chapter 1: http://www.frictionalgames.com/forum/thread-14142.html
Realm Of Another Chapter 2: Postponed
Adder Halls: 5%
(This post was last modified: 03-11-2012, 08:01 PM by DaAinGame.)
03-10-2012, 02:32 AM
Find


Messages In This Thread
Confused with void Func_Name - by DaAinGame - 03-10-2012, 02:32 AM
RE: Confused with void Func_Name - by Adrianis - 03-10-2012, 02:52 AM
RE: Confused with void Func_Name - by DaAinGame - 03-10-2012, 03:06 AM
RE: Confused with void Func_Name - by Adrianis - 03-11-2012, 04:33 AM
RE: Confused with void Func_Name - by DaAinGame - 03-11-2012, 08:00 PM



Users browsing this thread: 1 Guest(s)