Frictional Games Forum (read-only)

Full Version: Waterlurker not reacting to triggers?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So I got this map with water... and yes... it is liquid... Secondly, I have to Waterlurkers in there with the names "water1" and "water2" (without quotes)... Then I have an script area called "Waterlurk" But for some reason...these monster are already triggered as soon as I spawn in the map, which is what I dont want ofcourse.... My script is here.... Do you see what the problem is?

Script:


void OnEnter()
{
PlayMusic("ambience.ogg", true, 2, 2, 0, true);
PlaySoundAtEntity("","general_rain_long.snt", "Player", 0, true);
}

void OnStart()
{
AddEntityCollideCallback("Player", "Monster_Quest_Area", "GetMonsterQuest", true, 1);
AddEntityCollideCallback("Player", "Monster_Complete_Area", "FinishMonsterQuest", true, 1);
AddEntityCollideCallback("Player", "Bridge_Quest_Area", "GetBridgeQuest", true, 1);
AddEntityCollideCallback("Player", "Bridge_Complete_Area", "FinishBridgeQuest", true, 1);
AddEntityCollideCallback("Player", "Damn_Quest_Area", "GetDamnQuest", true, 1);
AddEntityCollideCallback("Player", "Damn_Complete_Area", "FinishDamnQuest", true, 1);
AddEntityCollideCallback("Player", "Torch_Quest_Area", "GetTorchQuest", true, 1);
AddEntityCollideCallback("Player", "Torch_Complete_Area", "FinishTorchQuest", true, 1);
AddEntityCollideCallback("Player", "waterlurk", "Func01", true, 1);
AddEntityCollideCallback("Player", "waterlurk2", "Func02", true, 1);
}

void Func01(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("water1", true);
}

void Func02(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("water2", true);
}

void GetMonsterQuest(string &in asParent, string &in asChild, int alState)
{
AddQuest("monsterquest", "MonsterQuest");
}
void FinishMonsterQuest(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("monsterquest", "MonsterQuest");
}
void GetBridgeQuest(string &in asParent, string &in asChild, int alState)
{
AddQuest("bridgequest", "BridgeQuest");
}
void FinishBridgeQuest(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("bridgequest", "BridgeQuest");
}
void GetDamnQuest(string &in asParent, string &in asChild, int alState)
{
AddQuest("damnquest", "DamnQuest");
}
void FinishDamnQuest(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("damnquest", "DamnQuest");
}
void GetTorchQuest(string &in asParent, string &in asChild, int alState)
{
AddQuest("torchquest", "TorchQuest");
}
void FinishTorchQuest(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("torchquest", "TorchQuest");
}

void OnLeave()
{
SetupLoadScreen("LoadingText", "hope", 0, "hope.jpg");
}
I would try deactivating them from the script.

SetEntityActive("water1", false);

SetEntityActive("water2", false);



in void OnStart()
(12-10-2011, 02:47 PM)ZyLogicX Wrote: [ -> ]So I got this map with water... and yes... it is liquid... Secondly, I have to Waterlurkers in there with the names "water1" and "water2" (without quotes)... Then I have an script area called "Waterlurk" But for some reason...these monster are already triggered as soon as I spawn in the map, which is what I dont want ofcourse.... My script is here.... Do you see what the problem is?

Script:


void OnEnter()
{
PlayMusic("ambience.ogg", true, 2, 2, 0, true);
PlaySoundAtEntity("","general_rain_long.snt", "Player", 0, true);
}

void OnStart()
{
AddEntityCollideCallback("Player", "Monster_Quest_Area", "GetMonsterQuest", true, 1);
AddEntityCollideCallback("Player", "Monster_Complete_Area", "FinishMonsterQuest", true, 1);
AddEntityCollideCallback("Player", "Bridge_Quest_Area", "GetBridgeQuest", true, 1);
AddEntityCollideCallback("Player", "Bridge_Complete_Area", "FinishBridgeQuest", true, 1);
AddEntityCollideCallback("Player", "Damn_Quest_Area", "GetDamnQuest", true, 1);
AddEntityCollideCallback("Player", "Damn_Complete_Area", "FinishDamnQuest", true, 1);
AddEntityCollideCallback("Player", "Torch_Quest_Area", "GetTorchQuest", true, 1);
AddEntityCollideCallback("Player", "Torch_Complete_Area", "FinishTorchQuest", true, 1);
AddEntityCollideCallback("Player", "waterlurk", "Func01", true, 1);
AddEntityCollideCallback("Player", "waterlurk2", "Func02", true, 1);
}

void Func01(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("water1", true);
}

void Func02(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("water2", true);
}

void GetMonsterQuest(string &in asParent, string &in asChild, int alState)
{
AddQuest("monsterquest", "MonsterQuest");
}
void FinishMonsterQuest(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("monsterquest", "MonsterQuest");
}
void GetBridgeQuest(string &in asParent, string &in asChild, int alState)
{
AddQuest("bridgequest", "BridgeQuest");
}
void FinishBridgeQuest(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("bridgequest", "BridgeQuest");
}
void GetDamnQuest(string &in asParent, string &in asChild, int alState)
{
AddQuest("damnquest", "DamnQuest");
}
void FinishDamnQuest(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("damnquest", "DamnQuest");
}
void GetTorchQuest(string &in asParent, string &in asChild, int alState)
{
AddQuest("torchquest", "TorchQuest");
}
void FinishTorchQuest(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("torchquest", "TorchQuest");
}

void OnLeave()
{
SetupLoadScreen("LoadingText", "hope", 0, "hope.jpg");
}
First of all, check if your waterlurkers are active. If yes, turn them into un-active in your lever editor.
I hope that it would solve the problem.


Rather than attempting to deactivate the waterlurkers, why not just delete the ones in the map and create them through the script?
(12-10-2011, 03:48 PM)Your Computer Wrote: [ -> ]Rather than attempting to deactivate the waterlurkers, why not just delete the ones in the map and create them through the script?
That seems like a bit more work than necessary =\

Just set them inactive in the level editor, and when the player walks through "Waterlurk", add a callback function with these in it:
//___________________________

void CALLBACKNAME(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("water1", true);
SetEntityActive("water2", true);
//Fill in the enemies' pathnode info here, using your information.
}
Sounds like a map cache issue to me. Close Amnesia, delete the map cache, then re-launch and see if it works. If that fails, go with Your Computer's suggestion, just make sure you create a water lurker in an isolated area that the player will NEVER get to (disable its triggers too) so that the entity is cached when the map is launched. If you don't do this, the player will get some lag when the water lurkers are created by the script.

Script line would be

CreateEntityAtArea("water1", "water_lurker.ent", "aSpawnLurker", false);

I'd suggest making a second area to spawn the second lurker at, in case some physics shenanigans goes down when they spawn on top of each other. Easy as that.
(12-10-2011, 06:04 PM)Statyk Wrote: [ -> ]That seems like a bit more work than necessary =\

Technically, it's the same amount of work.

(12-10-2011, 08:54 PM)palistov Wrote: [ -> ]just make sure you create a water lurker in an isolated area that the player will NEVER get to (disable its triggers too) so that the entity is cached when the map is launched. If you don't do this, the player will get some lag when the water lurkers are created by the script.

I wonder if you can get around that with GiveItemFromFile("waterlurker", "water_lurker.ent").
@Your Computer, seeing as it's not an inventory item, I'm not even quite sure what that would do O_O

I don't know if the game loads an into the cache when called by this. Would be pretty easy to test for though, if I was curious enough XD