Page 1 of 1

"or ||" question

Posted: Wed Feb 08, 2006 10:55 pm
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?

Posted: Wed Feb 08, 2006 11:04 pm
by jv_map
Neither construction is possible :(

Posted: Thu Feb 09, 2006 1:22 am
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?

Posted: Thu Feb 09, 2006 3:50 am
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!

Posted: Thu Feb 09, 2006 8:10 am
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?

Posted: Thu Feb 09, 2006 9:51 am
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 .

script

Posted: Thu Feb 09, 2006 11:47 am
by tltrude
The script is just a text file. You can copy it to a floppy disk and work on it all week.

Posted: Thu Feb 09, 2006 8:03 pm
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!

Posted: Thu Feb 09, 2006 11:41 pm
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?

Posted: Fri Feb 10, 2006 4:01 am
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.

Posted: Fri Feb 10, 2006 9:31 am
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 .

Posted: Fri Feb 10, 2006 2:54 pm
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!