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
Help with script
chriiisss Offline
Junior Member

Posts: 3
Threads: 1
Joined: Feb 2012
Reputation: 0
#1
Help with script

Hi im new here in this forum and im pretty new to the this custom story editor and I think this is pretty funny, but i got this scripting problem that has been bothering me for a while.. I am trying to make a grunt appear when I pick up a certian key and make the kety fit into a door like they do in this tutorial: http://wiki.frictionalgames.com/hpl2/tut...[]=monster
I have followed and read the whole page a couple of times now and I still got problems..(There may be something I have missed. Im good at missing stuff I read)
This is the error I get:

FATAL ERROR: Could not load script file `MyMaps/Firstmap.hps`!
Main(7,3): ERR A function with the same name and parameters already exist.
Main(12,1): ERR A function with the same name and parameters already exist.

Main(23,3): ERR A function with the same name and parameters already exist.

Main(28,3): ERR A function with the same name and parameters already exist.

Main(14,3): ERR No matching signatures to `AddUseItemCallback(string@&,string@&,string@&, const bool)`


I know those first Errors seems kind of obvious but I have tried to do something about it by deleting some void OnStart just to check if that worked, but sadly it didnt.

Here is my script if you are considering to help Smile


////////////////////////////
// Run when entering map
void OnStart()
{
AddUseItemCallback("", "corridorkey_1", "keydoor_1", "UsedKeyOnDoor", true);
}
void OnStart()
{
AddUseItemCallback("", "corridorkey_1", "keydoor_1", "UsedKeyOnDoor", true);
SetEntityCallbackFunc("corridorkey_1", "OnPickup");
}
void OnStart()
{
AddUseItemCallback("corridorkey_1", "keydoor_1", "UsedKeyOnDoor", true);
SetEntityCallbackFunc("corridorkey_1", "OnPickup");
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("keydoor_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "keydoor_1", 0, false);
RemoveItem("corridorkey_1");
}
void OnStart()
{
AddUseItemCallback("", "corridorkey_1", "keydoor_1", "UsedKeyOnDoor", true);
SetEntityCallbackFunc("corridorkey_1", "OnPickup");
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("keydoor_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "keydoor_1", 0, false);
RemoveItem("corridorkey_1");
}
void OnPickup(string &in asEntity, string &in type)
{
SetEntityActive("gruntyboy_1", true);
ShowEnemyPlayerPosition("gruntybot1");
}

////////////////////////////
// Run when leaving map
void OnLeave()
{
}


Thx anyway Smile
(This post was last modified: 02-14-2012, 07:01 AM by chriiisss.)
02-14-2012, 06:56 AM
Find


Messages In This Thread
Help with script - by chriiisss - 02-14-2012, 06:56 AM
RE: Help with script - by Your Computer - 02-14-2012, 07:06 AM
RE: Help with script - by chriiisss - 02-14-2012, 07:09 AM
RE: Help with script - by Your Computer - 02-14-2012, 07:14 AM
RE: Help with script - by chriiisss - 02-14-2012, 09:15 AM



Users browsing this thread: 1 Guest(s)