Frictional Games Forum (read-only)

Full Version: Custom story slow Probaly code Help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello since I've changed my map it all went slow Sad
first a huge pile of stuff exploded. I seem (think) to fixed that but still my game is going very slow this only happen in my mod. It's going so slow it's as good as not playable it's moving like frame for frame please help.
this is my .hps file
PHP Code:
void OnStart(){
 
AddUseItemCallback("""Dungeonkey_1""Storage_1""UsedKeyOnDoor"true);
 
AddUseItemCallback("""Rustkey""DungeonDoor""Ultra"true);
 
AddUseItemCallback("""Bar""Breakable""BreakableWall"true);
 
AddUseItemCallback("""Tinder""Keybody_1""Body"true);
}
void Body(string &in asItemstring &in asEntity)
{
 
PlayMusic("19_drill.ogg"false0.70.110false);
 
SetEntityActive("Keybody_1"false);
 
SetEntityActive("Keybody_2"true);
 
SetEntityActive("Rustkey"true);
}
void BreakableWall(string &in asItemstring &in asEntity)
{
 
SetEntityActive("Breakable"false);
 
SetEntityActive("Broken"true);
 
SetEntityActive("Rock_1"true);
 
SetEntityActive("Rock_2"true);
 
SetEntityActive("Rock_3"true);
 
SetEntityActive("Rock_5"true);
 
SetEntityActive("Rock_6"true);
 
SetEntityActive("Rock_7"true);
 
RemoveItem("Bar");
}
void Ultra(string &in asItemstring &in asEntity)
{
SetLevelDoorLocked("DungeonDoor"false);
PlaySoundAtEntity("""unlock_door""DungeonDoor"0false);
RemoveItem("RustKey");
void UsedKeyOnDoor(string &in asItemstring &in asEntity)

 
SetSwingDoorLocked("Storage_1"falsetrue);
 
PlaySoundAtEntity("""unlock_door""Storage_1"0false);
 
RemoveItem("Dungeonkey_1");
}
void OnEnter()
{
 
SetEntityPlayerInteractCallback("Dungeonkey_1""ActivateMonster"true);
 
SetEntityPlayerInteractCallback("Tinder""Spawn"true);
 
SetEntityPlayerInteractCallback("Rustkey""Super"true);
}
void Spawn(string &in asEntity)
{
 
SetEntityActive("Corpse"true);
 
SetEntityActive("Slime1"true);
 
SetEntityActive("Slime2"true);
 
SetEntityActive("Slime3"true);
 
SetEntityActive("Slime4"true);
 
SetEntityActive("Slime5"true);
 
SetEntityActive("Slime6"true);
 
SetEntityActive("Slime7"true);
 
SetEntityActive("Slime8"true);
 
SetEntityActive("Slime9"true);
 
SetEntityActive("Slime10"true);
 
AddTimer("Scare"0.1f"Scare1");
}
void Scare1(string &in asTimer)
{
 
GiveSanityDamage(10true);
 
PlaySoundAtEntity("""react_scare.snt""Player"0false);
}
void ActivateMonster(string &in item)
{
 
SetEntityActive("Steve_1"true);
 
AddEnemyPatrolNode("Steve_1""PathNodeArea_1"0"Idle");
 
AddEnemyPatrolNode("Steve_1""PathNodeArea_2"0"Idle");
 
AddEnemyPatrolNode("Steve_1""PathNodeArea_3"0"Idle");
 
AddEnemyPatrolNode("Steve_1""PathNodeArea_4"0"Idle");
 
AddEnemyPatrolNode("Steve_1""PathNodeArea_5"0"Idle");
 
AddEnemyPatrolNode("Steve_1""PathNodeArea_6"0"Idle");
 
AddEnemyPatrolNode("Steve_1""PathNodeArea_7"0"Idle");
 
AddEnemyPatrolNode("Steve_1""PathNodeArea_8"0"Idle");
 
AddEnemyPatrolNode("Steve_1""PathNodeArea_9"0"Idle");
 
AddEnemyPatrolNode("Steve_1""PathNodeArea_10"0"Idle");
 
AddEnemyPatrolNode("Steve_1""PathNodeArea_11"0"Idle");
}
void Super(string &in item)
{
 
SetEntityActive("Drill"true);

I'm just going to guess that some entities you've placed are colliding inside something else which causes massive lag and might end up destroying things ending up in explosion sounds.
A script like that wouldn't slow down the performance of the game. Not sure what you did in your map, but you may want to read this: http://wiki.frictionalgames.com/hpl2/amn...erformance
Fixed it Smile (no idea how)