Frictional Games Forum (read-only)

Full Version: Area Dissapears after use
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi
I want to make a waterlurker,everything works but when the waterlurker kills me is the Area dissapeared and the waterlurker appears no more. What i have to do that the waterlurker appears again?

(Sorry for bad English Big Grin )
I'm not too sure on this, but you can try adding
CreateDataCache();
to your .hps. It's supposed to cache all of the textures and models until you tell it to destroy them.

(02-05-2012, 06:47 PM)JenniferOrange Wrote: [ -> ]I'm not too sure on this, but you can try adding
CreateDataCache();
to your .hps. It's supposed to cache all of the textures and models until you tell it to destroy them.
The Result
Fatal Error
.............................
...........................
main (7,17):Area_1'is not declared
The Script:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "Area_1", "Waterlurker", true, 9);
AddUseItemCallback("", "Hammer", "Gate", "Kaputt", true);
CreateDataCache(Area_1);
}
void Waterlurker(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("waterlurker_1", true);
}
void Kaputt(string &in asItem, string &in asEntity)
{
SetEntityActive("Kaputt", true);
SetEntityActive("Gate", false);
SetEntityActive("Box", false);
PlaySoundAtEntity("", "break_wood_metal3.snt", "Player", 0, false);
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

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



(02-05-2012, 07:01 PM)Shives Wrote: [ -> ]
(02-05-2012, 06:47 PM)JenniferOrange Wrote: [ -> ]I'm not too sure on this, but you can try adding
CreateDataCache();
to your .hps. It's supposed to cache all of the textures and models until you tell it to destroy them.
The Result
Fatal Error
.............................
...........................
main (7,17):Area_1'is not declared
The Script:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "Area_1", "Waterlurker", true, 9);
AddUseItemCallback("", "Hammer", "Gate", "Kaputt", true);
CreateDataCache(Area_1);
}
void Waterlurker(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("waterlurker_1", true);
}
void Kaputt(string &in asItem, string &in asEntity)
{
SetEntityActive("Kaputt", true);
SetEntityActive("Gate", false);
SetEntityActive("Box", false);
PlaySoundAtEntity("", "break_wood_metal3.snt", "Player", 0, false);
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
CreateDataCache(Area_1);

should be

CreateDataCache();


It doesn't works
The game is no more Crashing but on the second try nothing happens Sad
Can you post your script? Easier to help Smile

EDIT: Nevermind I saw you posted it before xD
Code:
AddEntityCollideCallback("Player", "Area_1", "Waterlurker", true, 9);
You should change the "true" to "false".
Because right now you're saying true to: "delete callback when used" you want that to be false.
It's not that the area is disappearing, it's that monsters disappear when they kill the player and can't be respawned. Therefore trying to re-activate the monster that killed the player isn't going to work. You have to dynamically create the monster or have it pre-exist in the level editor.
Oh I understood it as if the area disappeared and wouldn't work again. My bad
(02-05-2012, 11:29 PM)Ninami Wrote: [ -> ]Oh I understood it as if the area disappeared and wouldn't work again. My bad

Well, he should also consider passing in false for AddEntityCollideCallback in either case.
It doesn't work
Nothing happens

Pages: 1 2