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
Question about basic scripting.
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#4
RE: Question about basic scripting.

Well they don't work, because you have split the callbacks in 2 different void OnStart()

The script is supposed to look like this:
PHP Code: (Select All)
void OnStart()
{ 
GiveItemFromFile("lantern", "lantern.ent");

for(
int i=0;i< 10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");

AddUseItemCallback("", "key_1", "locked_door1", "UsedKeyOnDoor", true);
SetEntityCallbackFunc("key_1", "OnPickup");
}


void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("locked_door1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "locked_door1", 0, false);
RemoveItem("key_1");
}

void OnPickup(string &in asEntity, string &in type)
{
SetEntityActive("monster_brute", true);
ShowEnemyPlayerPosition("monster_brute");
} 

Notice that there is only 1 "void OnStart()"

Trying is the first step to success.
(This post was last modified: 03-11-2015, 10:12 PM by FlawlessHappiness.)
03-11-2015, 10:12 PM
Find


Messages In This Thread
Question about basic scripting. - by Emiel97 - 03-11-2015, 08:56 PM
RE: Question about basic scripting. - by Emiel97 - 03-11-2015, 09:42 PM
RE: Question about basic scripting. - by FlawlessHappiness - 03-11-2015, 10:12 PM
RE: Question about basic scripting. - by Emiel97 - 03-11-2015, 10:22 PM



Users browsing this thread: 1 Guest(s)