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
Question about basic scripting.
Emiel97 Offline
Junior Member

Posts: 4
Threads: 2
Joined: Mar 2015
Reputation: 0
#1
Question about basic scripting.

Need help with something, how do i combine code?

I want the following two scipts/codes in the same .hps file:



void OnStart()
{
GiveItemFromFile("lantern", "lantern.ent");

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


void OnStart()

{
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");
}



I tried multiple things, watched multiple tutorials and browsed multiple topics, but still couldn't find what i was looking for!

Help IS appreciated. Thanks!
03-11-2015, 08:56 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 Emiel97 - 03-11-2015, 10:22 PM



Users browsing this thread: 1 Guest(s)