Frictional Games Forum (read-only)

Full Version: Trying to use CreateEntityAtArea
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Can't get that statue to spawn. Setting the entity active does not work for this entity.
The wiki description is a little vague. Here's my code:


Code:
void OnStart()
{
    AddEntityCollideCallback("Player", "ScriptArea_1", "TriggerArea", true, 1);
}
void TriggerArea(string &in asParent, string &in asChild, int alState)
{
    if(alState == 1)
    {
PlayMusic("break_glass_bottle3", false, 0.8f, 0.1f, 5, true);
        CreateEntityAtArea("deformed_man_2", "deformed_man", "SpawnEntityArea", false);
    }
}

I want to know:
What kind of area does an entity spawn at?
[Image: Editotttest.png]
If you bothered rigging up that screenshot, why haven't you tried it and found out yet?

I made that level to teach my self new things. I was like, "Alright, I saw this function called CreateEntityAtArea, lemme see if I can figure out how to use it." And when I tried multiple things (different areas, different names, etc.) and couldn't get it to work, I gave up and headed to the internets. So I wrote up the question, pasted my code, and took a screenshot of what my concoction looked like (maybe it would provide clues?).
I'm guessing the statue is a static prop type of entity and those can't be turned on/off with script (if I recall correctly). Try using another entitiy and see if that works, if so then make a copy of the statue and edit it with the model editor to set it to be another type in user variables.
(04-10-2012, 02:36 PM)jens Wrote: [ -> ]I'm guessing the statue is a static prop type of entity and those can't be turned on/off with script (if I recall correctly). Try using another entitiy and see if that works, if so then make a copy of the statue and edit it with the model editor to set it to be another type in user variables.
Yeah, I noticed that too. Activation/Deactivation doesn't effect those. But I was thinking Creation would.

So, can anyone clear up what exactly this function does?

Creates an entity, not a static object. Tongue

Ignore this post, I'm an idiot. Let's see if I can delete it.
I just tried to create an entity (normal 'ol dynamic storage box) at a playerStart area when I flipped a switch. No luck. Anyone use this function???
You're supposed to create them at Script areas, not PlayerStart or PosNode areas.
(04-12-2012, 10:44 PM)Your Computer Wrote: [ -> ]You're supposed to create them at Script areas, not PlayerStart or PosNode areas.
AH!! Finally! Thank you. There wouldn't be a hidden RemoveEntity function by any chance?

It keeps creating new ones with the flip of the switch without removing old ones. Does every one of those have the same name as the first one created? Or do they take care of it by just adding _# to the name (companionCube2, companionCube2_1, etc.)? Not a real important question, just curious.
Pages: 1 2