Programming & Scripting

View unanswered posts | View active topics


Post a new topicPost a reply
Previous topic | Next topic 

  Beginner BeginnerMember since: 19.10.2011, 11:02Posts: 15 Likes: 0
 

 Post Topic: Layer Hiding/Showing by Code?
PostPosted 15.02.2012, 17:01 
Hallo,

I want to hide/show different layers by code. Did anyone do this before? Or do the Crytek staff can help me with this, because I don't find anything in the documentation about this.

thanks
Sebastian

User avatar   Trained Modder Trained ModderMember since: 18.02.2009, 10:55Posts: 254 Likes: 0
 

 Post Topic: Re: Layer Hiding/Showing by Code?
PostPosted 15.02.2012, 21:14 
I3DEngine.h
Code:
  // Show/Hide objects by layer (useful for streaming and performance)
  virtual void ActivateObjectsLayer(uint16 nLayerId, bool bActivate, bool bPhys, const char * pLayerName) = 0;


Havnt tryed it, but perhaps it helps.


Best regards,

Blue
  Beginner BeginnerMember since: 19.10.2011, 11:02Posts: 15 Likes: 0
 

 Post Topic: Re: Layer Hiding/Showing by Code?
PostPosted 16.02.2012, 17:16 
Hi,

thanks for your answer.
I tryed it but it didn't worked yet. You have to provide a 'layerId' and a 'LayerName'. But I don't know how to get the LayerId.. I just tried with 0, but nothing.
Also I found a function in EntitySystem
Code:
   // Enable entity layer
   virtual void EnableLayer(const char* layer, bool isEnable, bool isSerialized = true) = 0;

But it doesn't work.

Maybe someone get this working ?

Thanks
Sebastian
  Uber Modder Uber ModderMember since: 19.09.2009, 09:30Posts: 1814Location: Finland Likes: 4
 

 Post Topic: Re: Layer Hiding/Showing by Code?
PostPosted 17.02.2012, 14:11 
Quote by EBM_Sebastian:
Hi,

thanks for your answer.
I tryed it but it didn't worked yet. You have to provide a 'layerId' and a 'LayerName'. But I don't know how to get the LayerId.. I just tried with 0, but nothing.
Also I found a function in EntitySystem
Code:
   // Enable entity layer
   virtual void EnableLayer(const char* layer, bool isEnable, bool isSerialized = true) = 0;

But it doesn't work.

Maybe someone get this working ?

Thanks
Sebastian


The "layer" is the layer's name you set in Sandbox. Like, gEnv->pEntitySystem->EnableLayer("Mission_01_AI", true, true); etc.
  Beginner BeginnerMember since: 19.10.2011, 11:02Posts: 15 Likes: 0
 

 Post Topic: Re: Layer Hiding/Showing by Code?
PostPosted 20.02.2012, 11:28 
I know that, but it didn't work for me.
Did it work for you ?

best regards,
Sebastian
  Beginner BeginnerMember since: 30.10.2011, 16:49Posts: 10 Likes: 0
 

 Post Topic: Re: Layer Hiding/Showing by Code?
PostPosted 09.06.2012, 17:32 
It works if you put a nonconnected Engine:LayerSwitch node with that layer in editor.