"or ||" question

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
HDL_CinC_Dragon
Brigadier General
Posts: 574
Joined: Mon Dec 22, 2003 8:32 pm

"or ||" question

Post by HDL_CinC_Dragon »

does this work:

Code: Select all

($trigger_01 || $trigger_02) waittill trigger
...
...
or would:

Code: Select all

($trigger_01 waittill trigger|| $trigger_02 waittill trigger)
...
...
my MOHAA nor my MOHAABT work on this computer and the computer that it does work on i have to travel to get to (can only get to on weekends) so i need to ask this here instead of test it myself... please help?
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Neither construction is possible :(
Image
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

you can have 2 triggers in the same space, but you have to condition each trigger seperatley.

What are you trying to do?
User avatar
HDL_CinC_Dragon
Brigadier General
Posts: 574
Joined: Mon Dec 22, 2003 8:32 pm

Post by HDL_CinC_Dragon »

I have an elevator with a trigger on the elvator and a trigger on one of the floors. I want both triggers to be able to activate the thread. any help without having 2 seperate threads would be much helpful!
Image
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

Make 2 triggers, Connect 1 trigger to a switch that is connected to a elevator.
Now connect the second trigger to a switch on a one of the floors.
One trigger have a set thread to move up or whatever u want it to do, And have the second trigger set thread to go down ect...
When i say connect, I mean target.
Sound kinda what your looking for?
Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

I would use setthread to start the thread that runs the elevator and forget about waittill trigger . As soon as the thread runs you turn off the trigger until the elevator gets to where it is going .
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

script

Post by tltrude »

The script is just a text file. You can copy it to a floppy disk and work on it all week.
Tom Trude,

Image
User avatar
HDL_CinC_Dragon
Brigadier General
Posts: 574
Joined: Mon Dec 22, 2003 8:32 pm

Post by HDL_CinC_Dragon »

Beret:
The only problem with that one is i want to be able to have it so the elevator can be called from the bottom floor when it is at the top, if im reading correctly, your suggestion wouldnt let me do that.

bdbodger:
i think ill try that one, thanks!
Image
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

Couldnt you add somthing like,
If origin is xxx xxx xxx go up, Else if origin xxx xxx xxx Then go down?
Image
User avatar
HDL_CinC_Dragon
Brigadier General
Posts: 574
Joined: Mon Dec 22, 2003 8:32 pm

Post by HDL_CinC_Dragon »

I could but thats not the problem, the problem is having more than one trigger activate the thread. I may have found my answer though, ill get back to you guys on this little issue.
Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Use level variables to keep track of what floor the elevator is on . By useing the setthread key on several triggers and haveing the setthread keys point to the same thread you can have as many triggers as you want running the same thread . Just remember that every time a trigger starts a new thread an old thread could be running . That is why you need to use level variables not only to keep track of what floor the elevator is on but also possibley do other things as well . What you maybe should do is name all the triggers the same , with the same targetname that way doing something like this

$mytrigger nottriggerable

will turn off all the triggers with that targetname at once then when the elevator gets to where it is going

$mytrigger triggerable

will turn them all back on again . The triggers can be given different keys like one trigger can have the key floor and value 1 and another trigger can have the key floor and value 2 . In the thread started by setthread self is the trigger that started the thread . You can use that in the thread too like self.floor for example to see what the floor key on that trigger is set to .
Image
User avatar
HDL_CinC_Dragon
Brigadier General
Posts: 574
Joined: Mon Dec 22, 2003 8:32 pm

Post by HDL_CinC_Dragon »

i know about the nottriggerable and the triggerable statement.

I thought that you couldnt have two seperate triggers with the same targetname... if you can then im definatly going to do that. Thanks!
Image
Post Reply