Can you spawn a hidden zone and then destroy it when it's no longer needed?
Trying to figure out how to temporarily hide an object.
Think I read something about this a while ago
But can't find it now
Can you spawn a hidden zone and then destroy it when it's no longer needed?
Trying to figure out how to temporarily hide an object.
Think I read something about this a while ago
But can't find it now
Yeah, it works just like any other spawnable, documented here: [url]http://berserk-games.com/knowledgebase/spawnable-objects/[/url]
did you think about hiding the thing without a zone? Like saving its position and doing obj.setPosition({0, -5, 0}) on it or something along these lines?Code:local newZone = spawnObject({type = 'FogOfWarTrigger'}) newZone.setPosition(...) -- etc.
Well, my object is a player log sheet, so the owner of the object needs to see it when it's hidden.
How do I set the color of this hidden zone to associate it with a specific player.
Does setting the colortint do this?
No, setValue does that
Code:zone.setValue('Green') --> zone changed to green color zone.getValue() --> 'Green'
Wow. That wasn't obvious.
Knowledge base doesn't mention that at all
Thanks!
I guess setValue/getValue has been changed from an Integer to a String
Knowledge base doesn't mention this
Last edited by Ajkiger1; 09-12-2017 at 04:23 PM.
Instead of "spawning" it.. you can use a hidden zone scaled to 0,0,0 and placed up high out of the way or something... and then just use the script to move it and scale it. That way the zone will have a known GUID at all times as GUIDs are applied on spawn.
I agree with tragic, if its on a set board. It is more convenient because you don't need to update your entity references, doesn't make a spawn object noise (I think it would) and doesn't take a frame to load in and setValue on (I'd have to experiment to check but my guess it it wouldn't be a perfect transition)
Thanks for the ideas.
I did implement a spawning solution - I noticed no spawn object noise when spawning it - the only thing I've spawned that makes no noise. I didn't worry about the GUID, I just searched for it using the tag = "Fog" and then checked the getValue for the proper color. Also, didn't have to wait a frame, spawned it and immediately setValue all in the same frame.
I do like the scale = {0,0,0} idea though.
Last edited by Ajkiger1; 09-15-2017 at 02:06 AM.
Nice =) Glad it worked so cleanly for you. I also appreciate you posting your experimentation results here, saves us (or at least me) the trouble of trying it all ourselves =D