JarlFrank on 20/2/2017 at 20:24
So, I want to do a thing where a portal vanishes when you consume a certain item.
I have just built the porals with Bounds Triggers (thank you for telling me how, Unna Oertdottir!), and when you walk into them you get teleported.
I want them to stop teleporting you when you consume the item.
So I have created a DestroyTrap and linked the DestroyTrap to both BoundsTriggers with ControlDevice links, as well as to both MawPortal SFX so the player will see that the portals have vanished.
I have linked the consumeable item to the DestroyTrap with ControlDevice.
I consume the item, but nothing happens. The item is eaten, but the portals remain.
EDIT:
So I read destroytraps won't do anything, they just slay items, not remove them from game. So I set up a teleport trap in an inaccessible room, linked the consumable with CtrlDevice to the teleport trap, and the teleport trap to the Bounds Triggers and the portal SFX. It still doesn't work, consuming the item just consumes it!
Unna Oertdottir on 20/2/2017 at 20:50
Consumable
In the inventory:
Script: TrigInvFrob
Frobinfo: Inv Action: Script
Not in inventory:
Script: TrigWorldFrob
Frobinfo: World Action: Script
-->CD link to Destroy Trap with nvdeletetrap-script (load nvscripts)
->CD link to portal
JarlFrank on 20/2/2017 at 21:02
Thank you, Unna, that worked! :D
Daraan on 21/2/2017 at 15:12
Since it's an NVScipt you can streamline that a bit.
Quote:
NVDeleteTrap (NVTrap)
Targetable: default: &ControlDevice
This script deletes all ControlDevice-linked objects when it receives TurnOn.
This is in contrast to the standard destroy trap script TrapDestroy, which merely slays the objects rather than deleting them.
Note that an NVDeleteTrap will not delete itself even if it is specified as the target. Use NVDeleteTrapDeleteSelf=1 to have the trap delete itself after it has finished deleting other objects.
So you would only need to add the script on your consumable item and write in the (Editor->)DesignNote
NVDeleteTrapOn="FrobInvEnd"
And CD Link like Unna said above.