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
Script bug
onv Offline
Member

Posts: 51
Threads: 12
Joined: Feb 2012
Reputation: 2
#1
Script bug

Here's my script :


////////////////////////////
// Run when entering map
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Hurt", true, 1);
AddEntityCollideCallBack("Player", "ScriptArea_2", "HammerScare", true, 1);
AddEntityCollideCallBack("Player", "ScriptArea_3", "MonsterPath", true, 1);
}

void Hurt(string &in asParent, string &in asChild, int alState)
{
GivePlayerDamage(5.0f, "BloodSplat", false, false);
SetMessage("Messages", "One", 4.0f);
AddEntityCollideCallBack("Player", "ScriptArea_4", "Hurtagain", false, 1);
}

void HammerScare(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
SetEntityActive("stone_hammer_move_1", true);
AddPropImpulse("stone_hammer_move_1", -5000, 0, 0, "world");
StartPlayerLookAt("stone_hammer_move_1", 3.1f, 5.0f, "");
AddTimer("timer01", 1.0f, "TakeDamage");
}

void Hurtagain(string &in asParent, string &in asChild, int alState)
{
GivePlayerDamage(5.0f, "BloodSplat", false, false);
}

void TakeDamage(string &in asTimer)
{
GivePlayerDamage(10.0f, "BloodSplat", false, false);
PlaySoundAtEntity("scare01", "player_falldamage_max.snt", "Player", 2.0f, false);
}

void MonsterPath(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
StartPlayerLookAt("servant_grunt_1", 3.0f, 6.0f,"");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "Run");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddTimer("timer02", 4.0f, "EnemyDeath");
}

void EnemyDeath(string &in asTimer)
{
SetPlayerActive(true);
StopPlayerLookAt();
FadeEnemyToSmoke("servant_grunt_1", false);
}

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

}

When i try to launch the map , it says :

No matching signature with AddEntityCollideCallback......
Can someone check my script , and report anything wron in it ?

Thanks


Also , is there a software that can "verify" the .hps file , so when there's an error , it tells it to you. (I already know the XMLValidator , but it only work for the extra_english.lang file.)
02-12-2012, 03:37 PM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#2
RE: Script bug

You capitalized the "B" last 2 AddEntityColideCallback's

Use these instead:

AddEntityCollideCallback("Player", "ScriptArea_2", "HammerScare", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "MonsterPath", true, 1);


And no there is no such thing, although you can use notepad ++ and change the language to c++, much easier to identify problems. You can also check out developer mode : http://wiki.frictionalgames.com/hpl2/amn...evenvguide

02-12-2012, 03:41 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#3
RE: Script bug

The only stable program to verify an HPS file is the game itself. However, MulleDK19 was working on something like that, but no public release yet.

Tutorials: From Noob to Pro
02-12-2012, 06:02 PM
Website Find




Users browsing this thread: 1 Guest(s)