Message use in Rules.

foulkn

New member
According to the TrainzScript Message Reference one can use messages from and to Rules, but every time I try to commit I get the error 'function Post Message not declared'.

My object is currently :
class xControl isclass ScenarioBehavior

I do not see ScenarioBehavior in the object hierarchy so I am not sure if it is the proper object to descend from.
Needing to do a timed message back to the Rule.

Is their a specific include I need to use to do messaging?

Do I need to do the Router.PostMessage directly?


tks
EHay
 
ScenarioBehavior is indeed the proper class to use.

You can find examples of the usage of PostMessage() in the asset Central Portal Control and the Router variant in Clean up derailed trains.

Driver command WaitForRandom uses another form: object.PostMessage().

In the Router form the source and destination terms are integer object ID's, while in the regular form they are the objects themselves.

Hope this helps

Trevor
 
Back
Top