Page 1 of 1

Enable/Disable Game Object

Posted: Wed Feb 03, 2016 1:23 pm
by bohnstudios
Is there a quick and dirty way to enable/disable game objects with Dialogue System in a conversation? I didn't see anything in the sequencer command reference/documentation (edit: it's there I just missed it). Obviously there's probably lots of different ways to do this with scripting and/or playmaker and other tools.

This could be very useful in a number of scenarios. One, for example, would be enabling a location marker on a map/mini-map later when a quest is assigned and disabling the marker when the quest is complete. It could also be useful in dialogue system cut scenes. It could also be used to remove an obstruction blocking a path after a level is complete...there's almost infinite uses for this. Once again, I'm not sure if something like this exists in the system by default. For my current, game there's a couple of ways I could do this, but they are all way more troublesome than if I could just drop in a sequencer or lua command. For example, I could use playmaker, a buggy mini-map asset, or create animations for each of my map markers and call an animation that moves the map marker into the map camera's view. Same thing could be done animating transparency...all of which would get the job done, but I'm looking for the best/most reliable workflow given that what I would be using it for is a task that will be done over, and over, and over.

Re: Enable/Disable Game Object

Posted: Wed Feb 03, 2016 1:39 pm
by Tony Li
Hi,

Use the SetActive() sequencer command. Developers use it for all kinds of purposes like this.

Specifically for mini-maps, the Dialogue System has dedicated third party support packages for KGFMapSystem, NJG MiniMap, and HUD Waypoint. (HUD Waypoint is a deprecated asset, but it still works fine.)

Re: Enable/Disable Game Object

Posted: Wed Feb 03, 2016 4:53 pm
by bohnstudios
Thanks Tony. Not sure how I missed that in the docs....it's clearly right there. My bad. lol

I haven't tried HUdWaypoint. I have the other two systems you mentioned. I couldn't really get them to work without errors though (non-dialogue system related). Other people might have better luck....they look really nice, but in my experience they didn't play nicely with other assets like Dialogue system does. If I remember correctly, they didn't even work out of the box in a blank project when I tried them. I know NJG has been updated since I tried it last. I think KGF was last updated in 2013.

I don't know if there's a 5 star map system on the asset store right now so I'm leaning towards keeping it really basic and not adding external code into the mix...I don't want to add assets (even if I already bought licenses) unless I absolutely need to.

Re: Enable/Disable Game Object

Posted: Wed Feb 03, 2016 8:03 pm
by Tony Li
NJG MiniMap wasn't Unity 5-compatible for a while, but it's been updated as you've said.

I'm using DMMap in a project. It works a little differently, and for my sci-fi project its more abstract output looks right. I haven't hit the point where I need specific Dialogue System integration for it; SetActive() has sufficed so far.

Re: Enable/Disable Game Object

Posted: Wed Feb 03, 2016 9:29 pm
by bohnstudios
Thanks for the tip. I checked it out and I'm definitely going to try out DMMap in a test project. I've noticed that "abstract" is more common for higher-end titles...probably because it's more legible for roads, doorways and such. Plus, the major GPS/map apps and websites don't use "earth view" by default...probably for the same reason. Good call. Can't wait to play your game btw.

Re: Enable/Disable Game Object

Posted: Thu Feb 04, 2016 9:58 am
by Tony Li
Here's another tip if you end up using DMMap. Make all of your level pieces (hallways, rooms, cave sections, etc.) into prefabs. DMMap works by "drawing" a polygon shape over each part of the map. It's kind of a hassle to draw the polygon. But if you draw it on a prefab, you only need to draw it once. DMMap automatically stitches together adjacent polygons.

I'll post on the forum when there's a playable version of my local co-op "sci-fi Gauntlet" game. I only spend one afternoon a month on it, so don't hold your breath for it. :-)

Re: Enable/Disable Game Object Mini Maps

Posted: Thu Feb 04, 2016 3:45 pm
by bohnstudios
That's good advice. I have to parent my meshes when I use simple mesh combine anyways so that's like a whole 2 seconds to prefab the parent. The manual method that DMMap does in the tutorial video looks easy enough, but potentially tedious if you have big levels and/or an open world. Nice!

Also, I'd be happy to help test your game and help get the word out when you're ready to publish it. I'll be sure to keep oxygen tanks on reserve in the meantime :lol: