Author Topic: Hit-Triggers for Levers  (Read 5564 times)

KptnKook

  • Posts: 45
  • Immersive or DIE!!!!!
    • View Profile
Hit-Triggers for Levers
« on: August 20, 2013, 03:28:54 PM »
Hey,

It seems that you can only check for a hit on defined breakables and enemies, but not on object like the trigger-lever..
What i would want, would be a hit area, so that the player can toggle levers on purpose by hit.

is there any other way, than creating a fully transparent breakable, and place it on top of the lever? if there is a nicer solution i would be glad to hear it. thanks for suggestions.

btw. which scriptline is defining an object as "hitable"? maybe i can add the line to the lever?

thanks!

Psyborg

  • Posts: 23
  • Maggot Crusher.
    • View Profile
Re: Hit-Triggers for Levers
« Reply #1 on: August 20, 2013, 03:37:38 PM »
I'm still really new at this and don't fully understand pretty much anything yet...

But, I created a secret room in my level by attaching a "ObjectEventTrigger" (OnHit) to a doodad, so when that doodad is hit, it destroys that doodad and spawns another doodad using "SpawnObject" that instead of being a wall, is the destroyed wall. I know you can do this with stages, but I'm not a good enough artist to create different stages of damage in my custom wall.

There's probably an easier and more direct way of doing this, but this is how I let the player hit a wall and open a passage...I'm pretty sure you could apply this to a trigger_button_wall doodad also, you'd just have to link the ObjectEventTrigger to a ChangeDoodadState I believe.

KptnKook

  • Posts: 45
  • Immersive or DIE!!!!!
    • View Profile
Re: Hit-Triggers for Levers
« Reply #2 on: August 20, 2013, 03:58:17 PM »
I simply took a breakable wall and put it over the lever. after that I hid the wall with "HideObject".
the area is now hitable and therefore checkable for hits. everytime this invisible wall gets hit, the lever under it toggles.

you can also make your own (invisible/)destructible object, by copying a doodad's .xml and editing it accordingly. Just be sure to set its  collision to true inside, so that a hit-script can be attached.

thanks for the reply!
« Last Edit: August 22, 2013, 08:00:53 PM by KptnKook »

Linaru

  • Moderator
  • Posts: 113
  • That Collectable coin is mine!
    • View Profile
Re: Hit-Triggers for Levers
« Reply #3 on: August 24, 2013, 12:24:01 PM »
i think in order to hit a doodad it must have a collision box, i know it can be done becaus ei made some custom archery target leavers.
-----------------------------------------------------------
Stabaddey Stabaddey Zap
-----------------------------------------------------------