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
Trying to use CreateEntityAtArea
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#11
RE: Trying to use CreateEntityAtArea

You can't remove entities, but you can de-activate them, or set their health to 0 and let them break (if they are breakable).

If you want removable meshes you can use Add/RemoveAttachedPropToProp, but keep in mind the z parameter of that function is bugged (z rotation is used for both position and rotation and Z pos is ignored - you can work around this though) and no collision detection or physics is used for the attached bodies.

Note that if you are just wanting to remove and create one object - E.g. resetting it. You can try using "ResetProp" - this should teleport the prop back to it's starting position. It is usually sufficient if you want to create some form of dispenser to have a few entities and just juggle them with reset prop - this also lets you hard limit the number of entities pretty trivially.
(This post was last modified: 04-13-2012, 12:21 AM by Apjjm.)
04-13-2012, 12:18 AM
Find
FragdaddyXXL Offline
Member

Posts: 136
Threads: 20
Joined: Apr 2012
Reputation: 7
#12
RE: Trying to use CreateEntityAtArea

(04-13-2012, 12:18 AM)Apjjm Wrote: You can't remove entities, but you can de-activate them, or set their health to 0 and let them break (if they are breakable).

If you want removable meshes you can use Add/RemoveAttachedPropToProp, but keep in mind the z parameter of that function is bugged (z rotation is used for both position and rotation and Z pos is ignored - you can work around this though) and no collision detection or physics is used for the attached bodies.

Note that if you are just wanting to remove and create one object - E.g. resetting it. You can try using "ResetProp" - this should teleport the prop back to it's starting position. It is usually sufficient if you want to create some form of dispenser to have a few entities and just juggle them with reset prop - this also lets you hard limit the number of entities pretty trivially.
ResetProp works great!


Dark Seclusion Here
04-13-2012, 12:48 AM
Find
thetastyfish Offline
Junior Member

Posts: 18
Threads: 6
Joined: Feb 2013
Reputation: 0
#13
RE: Trying to use CreateEntityAtArea

Hi, I'm having the same issue as FragdaddyXXL. I'm trying to set it up so that when the player collides with "ScriptArea_7", an eagle statue spawns at "eagle_appear", but when I test it out, nothing happens.

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_7", "FUNCTION7", true, 1);
}

void FUNCTION7(string &in asParent, string &in asChild, int alState)
{
if(alState == 1)
{
CreateEntityAtArea("eagle_1", "eagle.ent", "eagle_appear", false);
}
SetLightVisible("PointLight_2", true);
SetLightVisible("PointLight_1", true);
}

I know that this is probably poorly written, but I've only been working with this for about a month, so I appreciate your patience. Again, I'm just trying to make an eagle statue appear at "eagle_appear", and it just isn't happening.
02-28-2013, 12:21 AM
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#14
RE: Trying to use CreateEntityAtArea

Did you read through all the posts in this thread? You need to make sure your statue is an entity type of some sort, not a staticprop type as those cannot be created

02-28-2013, 03:24 PM
Find




Users browsing this thread: 1 Guest(s)