Programming & Scripting

View unanswered posts | View active topics


Post a new topicPost a reply
Previous topic | Next topic 

User avatar   Beginner BeginnerMember since: 02.06.2008, 20:40Posts: 15Location: Tampa, Florida Likes: 0
 

 Post Topic: [C++] Entity Spawning
PostPosted 01.07.2008, 19:49 
I can currently spawn a tank entity by using the SpawnEntity method. I set the SEntitySpawnParams object to what I want and then call the method. It works well.

I found that the tank class (well the one I'm using.) is US_tank. This seems to set the proper .lua files for the tank and it spawns everything the tank needs.

Now I am trying to spawn a tree but when it is spawned in the SandBox the Class is GeomEntity and the problem is that if I spawn a bench it's Class is also GeomEntity. In the SpawnEntity function it doesn't seem to take in any variables that would let me specify that I want it to be a tree or what type of tree it is.

Is there a way that the game differentiates between different GeomEntities? Or is there a different function that I need to use to spawn a GeomEntity?


One other thing. If I am going to be populating a large area of trees and want to use Brushes instead of a large number of entities can I do that in C++? If so, can you please give me a starting point to working with the brushes in C++.

Thank you.


Last edited by Tarkill on 01.07.2008, 20:07, edited 1 time in total.

User avatar   Beginner BeginnerMember since: 02.06.2008, 20:40Posts: 15Location: Tampa, Florida Likes: 0
 

 Post Topic: RE: [C++] Entity Spawning
PostPosted 14.07.2008, 17:02 
***Bump****

Anyone know?? ?(
User avatar   Uber Modder Uber ModderMember since: 28.11.2007, 19:14Posts: 1162Location: Belgium Likes: 0
 

 Post Topic: RE: [C++] Entity Spawning
PostPosted 14.07.2008, 18:23 
Code:
yourEnt->LoadGeometry(0, "path/to/model")


And I don't think you can spawn brushes.
User avatar   Beginner BeginnerMember since: 02.06.2008, 20:40Posts: 15Location: Tampa, Florida Likes: 0
 

 Post Topic: RE: [C++] Entity Spawning
PostPosted 10.09.2008, 15:12 
Quote:
Originally posted by ins
Code:
yourEnt->LoadGeometry(0, "path/to/model")


And I don't think you can spawn brushes.


Thank you for your input INS. This works well and I can now spawn GeomEntities. I can set flags to make them cast shadows and interact with wind but I walk right through them in the game. Looking through the code I can not find how to make the trees solid. Is there a flag I am not seeing or a different property I need to set to make the tree solid?

Thanks.
User avatar   Uber Modder Uber ModderMember since: 28.11.2007, 19:14Posts: 1162Location: Belgium Likes: 0
 

 Post Topic: RE: [C++] Entity Spawning
PostPosted 10.09.2008, 21:13 
Perhaps you should experiment with SEntityPhysicalizeParams

(didn't test anything)
Code:
// pEnt is your IEntity pointer
SEntityPhysicalizeParams params;
params.type = PE_STATIC;
pEnt->Physicalize(params);
User avatar   Beginner BeginnerMember since: 02.06.2008, 20:40Posts: 15Location: Tampa, Florida Likes: 0
 

 Post Topic: RE: [C++] Entity Spawning
PostPosted 10.09.2008, 22:11 
Quote:
Originally posted by ins
Perhaps you should experiment with SEntityPhysicalizeParams

(didn't test anything)
Code:
// pEnt is your IEntity pointer
SEntityPhysicalizeParams params;
params.type = PE_STATIC;
pEnt->Physicalize(params);


Thanks for the quick response ins. I have tried the above and it does not seem to work. I also tried PE_RIGID and it didnt work either. I will keep trying though.
  Beginner BeginnerMember since: 25.10.2011, 13:21Posts: 3 Likes: 0
 

 Post Topic: Re: [C++] Entity Spawning
PostPosted 05.08.2012, 18:11 
Hi!

I just ran into the same problem in CryEngine 3 and I was wondering, if you managed to make the entity solid?


edit: ok, nevermind. Seems like I found a workaround in my case.
Code:
params.pClass = gEnv->pEntitySystem->GetClassRegistry()->FindClass("BasicEntity");


Did the trick for me. But only that's for Cryengine 3 of course and not really a great solution ;)