Niborius on 25/11/2018 at 13:59
Hi taffers :)
Basically I'm trying to do a simple trigger script where the player has to find 3 items and use it on a certain object in the world, which will trigger a script.
It sounds fairly simple but I have never done it and I can't figure out how to do it either. Any help is appreciated!
Unna Oertdottir on 25/11/2018 at 14:10
You need TrigWorldFrob script on the objects
Frobinfo: World Action--Script
CD the objects to a RequireAllTrap.
Niborius on 25/11/2018 at 16:04
Quote Posted by Unna Oertdottir
You need TrigWorldFrob script on the objects
Do you mean on all objects? So the 3 items and the world object?
Right now I got as far as making the world object frobbable but it only functions when I click on it without an item. I'm confused about how to make sure the world object 'knows' which items it needs, like how to connect them.
Thank you for the quick reply btw
Unna Oertdottir on 25/11/2018 at 16:21
I misunderstood, sorry.
First, you need a trigger. You might use S&R, a contact stim on the objects to trigger the "certain object" 3 times. The "certain object" is also acting like a trigger, so the receptron might frob a button each time.
Load tnhScripts
Put trapthreshold script on a marker (this is the counter)
design note: threshold=4;global=1
link the "certain object" or the button to the counter
link the marker (counter) to the qvartrap or whatever you need
Niborius on 25/11/2018 at 18:38
No worries :)
I got the script loaded and added the design note. I'm not sure which S&R to use in this case. There is 'Touch', but which effect should I give to that?
I linked the object (it's an alchemy table) to the counter, using CD, and linked that to the objective (that last one does work on its own because I've tested it with a simple button)
Unna Oertdottir on 25/11/2018 at 19:15
You better create and use a custom stim.
Just add a source on the table (contact)
Receptron on the other objects (contact) Contact Types: Collision
Effect: Frob object (a button)
Create the button first. This the trigger for the counter.
john9818a on 26/11/2018 at 00:41
One thing I would like to add: on the objects you carry, add Engine Features -> Frobinfo and under Tool Action select Script. On the table do the same thing except add Script to World Action.
Niborius on 26/11/2018 at 12:15
As of now my 3 objects have a custom Receptron AlchemyStim (I don't know if I needed to do anything with the Stim itself?)
Stimulus: AlchemyStim
Min & Max Intensity (I don't know what it does, I've set it to 7)
Effect: Frob Object > Button (it's physically in the world)
I can't seem to add "contact" to this one, it doesn't have a Propagator setting.
The Alchemy table has a Source AlchemyStim.
Propagator: Contact
Intensity 7
The items are linked to the table with a CD link (is this still necessary?)
The button is CD linked to the counter, which is CD linked to a door (for testing purposes)
But it's not doing anything. The 3 items and the table have the script "TrigWorldFrob
The Frobinfo's were already set exactly as john later added.
Niborius on 26/11/2018 at 16:54
Thank you for the great help,
I see where I got confused, I thought I had to frob the table with the 3 items, but I have to drop them on the table instead (didn't even think of this!). Mine works, sort of.. I can pick up the same item again and drop it another 2 times which will also activate the door. I need to make it so that the trapthreshold does a -1 to the global counter when an item is picked up again from the table.
Also, I noticed that in your demo, even though your threshold is set to 4 and global to 1, the door opens after dropping 2 keys on the table. Changing it to 5 works, but sounds risky?