TTLG|Thief|Bioshock|System Shock|Deus Ex|Mobile
Results 1 to 6 of 6

Thread: Removing Sources From Object With a Switch

  1. #1
    New Member
    Registered: Jun 2020

    Removing Sources From Object With a Switch

    Hi guys! I'm an absolute newbie here, so be patient, please.
    I have a rotating wheel that goes on and off via a switch. The wheel is supposed to be on when the mission starts and to cause damage to the player (but only while spinning).

    Switch > JointsState > AnimS On
    Wheel > Sources > WeaponStim > Contact.

    Result: it works, but the wheel keeps causing damage even when it's turned off.

    So I've tried looking into Ominous Bequest Gold (it has a scepter that shocks you if you frob it, until you slash a certain wire with your sword), and my set-up was:

    2 Wheels, 2 TeleportTraps, a Button, a Switch, an Inverter:

    TelTrap1 > CDLink to Wheel 1
    TelTrap2 > CDLink to Wheel 2

    Switch > CDLink to Inverter
    CDLink to TelTrap1
    CDLink to Teltrap2
    Properties: Script > TrapRelay
    Trap Control Flags > NONE...
    JointsState > ON -NONE - NONE...

    Button > CDLINK to Switch
    Properties: TweqJointsState > NONE...

    Result: The wheel works, but no damage at all.

    I've tried "countless" combinations of the latter set-up, with very weird results. I know there must be a solution hiding somewhere, only I don't have the knowledge to flush it out.

    Where am I going wrong? Any suggestion would be greatly appreciated!
    Last edited by Federico; 13th Jun 2020 at 07:18.

  2. #2
    Registered: May 2002
    Location: Texas
    I'm not sure if you want to be able to turn the wheel back on again so... Use two wheels at the same time except make the "damage" wheel slightly larger than the other wheel. When the lever is frobbed, have a destroy trap destroy the "damage" wheel. Also remove the ambient hacked property from the "damage" wheel so that you don't have twice as much wheel rotating sound being played.

  3. #3
    Registered: Apr 2011
    I would do this with just the one wheel. Make it start/stop with TweqOnOff, as usual. And put the stim source on a metaproperty, and also add/remove the metaproperty from the wheel appropriately.

    Edit: probably just follow Yandros's advice below for the metaproperty, and skip the rest of this post.

    You could maybe use TrapMetaProp for that. But I'd just use squirrel: put this "HurtyWheel" script on the wheel, and then it will add/remove the "M-WheelDamage" metaproperty from itself when it gets TurnOn/TurnOff:
    class HurtyWheel extends SqRootScript
        function OnTurnOn() {
            if (! Object.HasMetaProperty(self, "M-WheelDamage")) {
                Object.AddMetaProperty(self, "M-WheelDamage");
        function OnTurnOff() {
            Object.RemoveMetaProperty(self, "M-WheelDamage");
    Edit: I should probably add instructions in case you've never used a squirrel script before:

    1. "script_load squirrel" in Dromed
    2. create a subfolder of your mission's folder called "sq_scripts"
    3. create a text file (with Notepad or whatever) in that subfolder, called "whatever.nut" (I usually name it for the mission, but the name is not important, only the .nut extension is)
    4. paste the script above into the file and save.
    Last edited by vfig; 21st Jun 2020 at 15:36.

  4. #4
    Desperately Dodgy Moderator
    Registered: Nov 2001
    Location: France
    I would just put the source on a metaprop and just use NVMetaTrap to add/remove it.

  5. #5
    Registered: Apr 2011
    Quote Originally Posted by Yandros View Post
    I would just put the source on a metaprop and just use NVMetaTrap to add/remove it.
    Thanks, I knew there'd be a solution to adding/removing the metaprop using NVScript (which I'm completely ignorant of).

  6. #6
    New Member
    Registered: Jun 2020
    Great, it works! Thanks everybody. I gave it a MetaProperty and then used NVMetaTrap.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts