Author Topic: Is it possible to put a key in a crate?  (Read 6310 times)

TheFreshPrince

  • Posts: 14
    • View Profile
Is it possible to put a key in a crate?
« 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?

Hipshot

  • Developer
  • Posts: 455
  • Level Designer
    • View Profile
Re: Is it possible to put a key in a crate?
« Reply #1 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.

TheFreshPrince

  • Posts: 14
    • View Profile
Re: Is it possible to put a key in a crate?
« Reply #2 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.

TheFreshPrince

  • Posts: 14
    • View Profile
Re: Is it possible to put a key in a crate?
« Reply #3 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  ::)

Hipshot

  • Developer
  • Posts: 455
  • Level Designer
    • View Profile
Re: Is it possible to put a key in a crate?
« Reply #4 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

TheFreshPrince

  • Posts: 14
    • View Profile
Re: Is it possible to put a key in a crate?
« Reply #5 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.

Hipshot

  • Developer
  • Posts: 455
  • Level Designer
    • View Profile
Re: Is it possible to put a key in a crate?
« Reply #6 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?

TheFreshPrince

  • Posts: 14
    • View Profile
Re: Is it possible to put a key in a crate?
« Reply #7 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