Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trying to use CreateEntityAtArea
Author Message
Apjjm Offline
Super Moderator

Posts: 482
Joined: Apr 2011
Reputation: 49
Post: #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 all posts by this user Quote this message in a reply
FragdaddyXXL Offline
Member

Posts: 136
Joined: Apr 2012
Reputation: 7
Post: #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 all posts by this user Quote this message in a reply
thetastyfish Offline
Junior Member

Posts: 18
Joined: Feb 2013
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Adrianis Offline
Senior Member

Posts: 632
Joined: Feb 2012
Reputation: 27
Post: #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 all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)