Hammerwatch Forum

Custom mapping and Mods => Editor Discussion => Topic started by: TheFreshPrince on June 27, 2014, 11:44:34 AM

Title: Is it possible to put a key in a crate?
Post by: TheFreshPrince on June 27, 2014, 11:44:34 AM
Hi there.
I am working on a map where I set up a trap and you need to find a key in a crate or fire traps will kill you.
Is it possible to hide a key behind a crate or in one?
Title: Re: Is it possible to put a key in a crate?
Post by: Hipshot on June 27, 2014, 01:40:43 PM
Hmm, there are several ways to spawn something from a barrel, I think in your case you should probably connect a ObjectEventTrigger to the barrel, set it to destroy and then when the barrel is destroyed, spawn a key with SpawnObject.
Title: Re: Is it possible to put a key in a crate?
Post by: TheFreshPrince on June 28, 2014, 10:24:40 AM
That unfortunately didn't work because I could get the ObjectEventTrigger to connect up to the Spawnobject.
But I did manage to make RectangleShape = Area Trigger = Spawn Object. Which works just as well seeing how you we need to be next to the crate to break it anyway.
Thanks for your help much appreciated.
Here's two pictures one of the one you recommended (I don't know what I was doing wrong) and the one I did.
Title: Re: Is it possible to put a key in a crate?
Post by: TheFreshPrince on June 28, 2014, 10:26:18 AM
I forgot to add attachments and didn't realise you can only add one. - Here's the just the one  ::)
Title: Re: Is it possible to put a key in a crate?
Post by: Hipshot on June 28, 2014, 10:42:00 AM
That unfortunately didn't work because I could get the ObjectEventTrigger to connect up to the Spawnobject.

Look at that (if you can't connect your event trigger to the spawn object): http://hammerwatch.com/forum/index.php?topic=2051.0
Title: Re: Is it possible to put a key in a crate?
Post by: TheFreshPrince on June 30, 2014, 08:28:03 AM
I apologise because I know this is going to get annoying for you.
But when I right click with nothing it does nothing.
And when I right click with nothing selected in scripting it says 'spawned script node' in the actions bar.
and obviously when I right click with something selected it spawns the object.
Title: Re: Is it possible to put a key in a crate?
Post by: Hipshot on June 30, 2014, 10:05:05 AM
Sorry, I might have thought this was more advanced than it really is.

You just want to spawn a key when a barrel is destroyed, nothing more? Then just use a ObjectEventTrigger and click on the little button that says Object and choose the barrel also, choose destroyed in the list, then use CTRL+ALT+LMB on a SpawnObject. Does that not work?
Title: Re: Is it possible to put a key in a crate?
Post by: TheFreshPrince on July 01, 2014, 09:05:21 AM
Finally worked!!  ;D
Thanks so much - I know how annoying these things can be for people trying to help.
This is actually a little embarrasing because I have been using the editor for a couple of weeks now  ???
Thanks - Kael