Download

How to check if the structure is a spawn emmiter. "green/red model"

Hi,

Do anyone know how i can check if the structure im placing out is in the spawn emitter mode ??
I Noticed that when you place out a structure it will normaly trigger its evens (Begin Play on spawn, End Play on destroyed")

Now this is all nice and usefull. ***EXCEPT ***that the events is also fireing when the structure is in “spawn emmiter mode”. (dont know a better word for it)

So how can i check if the structure is in this mode. ?
I tried to use GetMaterial and do a comparison whith the Material on the structure. but this always returns false.

Anyone got an idea how to solve this?

Bump.

I really need to find a way if the structure is “spawm emitting”… im using the term spawn emitting. because i dont know what else to call it.

When you are about to place out a structure. its green or red. based on if its allowed to be placed or not.
This model uses the same mesh as your structure when its placed.
The only differance is that it uses another material while its not fully placed out… (green / red)

You may ask. why do you need to check if the structure is spawn emitting?

Basically because. if you make a graph on your structure that does something with the event “Begin Play”
This event will be executed while its spawn emitting.
So the event “Begin Play” will be executed 2 times.
One time when its spawn emitting and one more time when its placed out.

Now. i need to prevent that the code in my event (Begine Play) is executed if the structure is in spawn emitter mode.
I also tried to use a Get Named Material. and check that with my Material name, but using the function “Get Named Material” alway crashes the dev kit.

Anyone got an idea how i can do this??

collision check? its a particle effect type in gate or door or something in devkit and look through its assets cant open the kit atm waiting on stupid update to fix… i assume this is what ur on about

Thats not much help gankey69.

After several day of messing around i still cant figure this out.
Would any Developers shed a light on how to add in a logical code to prevent the Begine Play, (End Play/ Destroyed) Events from beening executed while the structure is Pre placed out (Emitting).

I was thinking about using a variable that defines if its passed the Begine Play variable once, I and also tried to get the material. since its obviouse that another material instance is beening used during Pre Placement.
But since the actor gets destroyed before the final structure is placed the referance to the variable is also destroyed, i can also not use the GetMaterial function without crashing the dev kit.

Why is this a BIG problem!
Simply because when you strart to have more complex buildings which has animations, particles effects, sound, colision boxes thats starts func A,B,C etc and this is controled by a graph logic you get weird unvanted behavioure during pre placement. .
And the natrual place to init your logic would be in the Begin Play event since its the event that is executed when the actor gets spawned.

If its not possible at the moment.
Could you atlest make some sort check box in the blueprint for the spawn emitter template setting. “Ignore Events on Placement”

So I had a chat with Arkman/nuxil and I found a solution for your issue. Haven’t read the thread at all, but he told me that this is a thread where my solution would fit. So forgive me if that is not the answer you are looking for.

http://pastebin.com/bAWkzSje

The delay is important since the material assign script (where ever that is located) is firing after the beginplay is firing. So without delay it would not work.

Thank you so much Kenturrac…
After almost 1 month i got an answer that i can use :smiley: