WaitForEvent and RaiseEvent Tutorial?

sernie73

New member
Hi Folks,

my English is not the best, but I try my best now.
Is there any tutorial in the net what explains the use of "WaitForEvent" and "RaiseEvent"? I have an oil-producing facility and an oil-consuming facility. My thoughts are: When the consuming one is below 1000 tons, the RaiseEvent should be activated, let's say switching from 0 to 1 or so. The WaitForEvent should react now and send a ship from the producer to the consumer to fill him up again and setting the "switch" back from 1 to 0.
I hope I've explained what I want. In this problem I try to use these two rules, but nothing happens. Also the Try-and-error method didn't help me. Or do I have to use other rules to solve it? I've searched for months now, but there is no tutorial to find how to use these rules.
By the way: I'm using TRS2007, the German version of TRS 2006.

Ernie from Germany
 
Hi Ernie,

I think you and I had the same idea. Back some weeks ago http://forums.auran.com/trainz/showthread.php?t=50217 I was trying to narrow down a design to efficientrly feed any industry. Why? because I don't like looking at my logs train going back to the forestry industry with half load or more of logs.

So if you and I would come out with a good design we may implement a new rule. Coding is the easy part but a good design is the hardest part. We either can code it or ask someone more advanced player for help.

There is one rule already available from Auran "Resource Check" that would greatly simplify things. We would need to attach to the industry (or designate) a train(s) to serve as a busboy, in this case, a bustrain, that when the resource being controlled goes below some pre-established limit, the new rule would dispatch the train to bring back more stuff. Otherwise, the train would be sitting on some siding just waiting.

I am not sure if I got your idea correctly or I explained mine enough (in the above thread I got such a simplistic response that either he or she didn't get my idea or I didn't explain it clearly).

Please let me know.

Cheers from Florida, USA.
------------------------------------
By the way, when are we going to be able to shutdown train engines when they are idle? seems that the real world is coming to my virtual world, i hate wasting fuel!
 
Last edited:
Hi ffccnn,

Yes, you got my problem. You do it with logs, I do it with oil (I use Ianz Trainz content for it). If you can find someone who does the programming, that will be fine. But don't count on me. I still use VBasic and Excel-Makros for my own purpose, ant that's it :hehe:. I'm no programmer, I'm a user.

But you gave me another idea. Recource-Check, there should be a way to solve my problem. Recource-Check produces a Waybill, Waybill activates a train or a ship to fill up the consumer. It's only an idea, but I will try it out in the next days.

You see, even if I can't help with constructing a new rule, I got a new idea. Thx a lot.

I'll reply in the next days.

Ernie from Germany.
 
Hi ffccnn,

I have it!! My Dad had the solution for my problem. He has nothing to do with Trainz, but I told him my problem and he said: "Why not using a simple signal?" :o

THAT'S IT !!!!! On my Mars-routes I am using this construction in a single-track-section, where one train blocks the signal at the opposite side of the section, so that the opposite train never can drive into the single-track when the first one is entering it (I hope I explained it correct).

In my case the consumer blocks the signal, when it it filled more than 80%, and it gives it free, when the amount is lower than 15%. As I have with 2007 the German version of Trainz, I only can say that I use "Recourcen-Überprüfungs-Regel" (Check-Recources?) <kuid:-18:1208> and "Set Signal Rule" <kuid2:47662:20001:2>. the first one says "If consumer >80% then block signal (set to ALERT)", the second one "If consumer <15% then set signal to AUTOMATIC". It is that easy! I still believe, people who are not envolved have the simpliest but best ideas. Like my Dad. :)

Ok, this problem has a solution. I tried it out at once and it works perfectly. But my wish to know more about WaitForEvent and RaiseEvent is not satisfied. I'm still looking for a manual or any instructions for them. :(

Ernie from Germany
 
Hi Ernie
I use WaitforEvent and RaiseEvent. The best way I can describe there use is to give an example. You can raise upto a maximum of 20 events.
Example: Train 1 is in a siding waitingforevent 1, Train 2 pulls into the station, unloads, uncouples and moves to track mark and then RaiseEvent 1 and waitforevent No 2. train 1 now follows commands to move and couple to trains 2 coaches, moves out the station and after passing a track mark RaiseEvent 2. Train 2 then follows commands to move to a track mark in the siding and WaitforEvent 1.
Hope this makes sense. If I can help anymore please ask.
 
Hi odgee,

your discription is okay, I can see how you use them. It is the way, like I wanted to use it also. But something strange else happens here. I have activated both rules, I also can call them when making my orders for a driver. Drive to somewhere, wait seconds, and so on, everything works fine. But when I choose "WaitForEvent>" or "RaiseEvent>", nothing appears in the queue. The ">"-sign tells me, there should be another list to choose, like "Drive to Trackmark>" or so. But no list appears, and so the "WaitForEvent>" is ignored and doesn't show up in the driver-queue.

The thing what I need is a manual or any description for these rules. For me it seems I forgot anything to activate before I can use them. Like you have to use the "InputTable"-rule before an turntable can be managed.

Okay, maybe someone will write a manual for me (not only for me :)). I'm waiting and still searching the www for it.

Thx for help
Ernie from Germany
 
Hi Ernie

Attached is a sceen shot of what the RaiseEvent command should be like. It gives you the option of raising an event between 1 and 20. The WaitFor Event is the same. The train that raises the event will carry on to the next command. If you insert a WaitForEvent command the train will wait until the event is raised .
odgee201002160002.jpg
 
Hi odgee

Your pic declares very good, what my problem is and what works fine at your TRS. What version of Traiz do you use? It realy looks good. I like the blue/darkblue style.

I also includes a pic now. As you see, Wait For Event is highlighted, but nothing else appears. The same happens with Raise Event. I really don't know why. As I mentioned before, I had the same effect while using turntables. But since I use the Input Table, everything works fine with them.

Meanwhile I solved my problems with Triggers, Check Trigger, Check Recources and Set Signals. It works very fine, I'm satisfied, even it is not easy to create.

Ernie the German

ps.: Sorry, pic-upload doesn't work. I try to fix this.
 
Back
Top