Creating own trigger object

  • Hi, I would like to ask, if there is any chance to create own trigger object or scenery object which communicate with vehicle. I've read about it here and I've tried create my own object, but without any possitive result. I've used script procedures like it is mantion in lexicon but it's not working. Thanks for your answer.

    Best regards
    Mikes

  • Mikes

    Changed the title of the thread from “Creating onw trigger object” to “Creating own trigger object”.
  • Hi,

    It is not possible to create your own trigger (as well as the small green cube in the map editor).

    However, it is possible to create a scenery object that can communicate with the vehicle via the trigger using a script. This procedure is also used to implement train protection in Lotus. The procedure for this is described in this encyclopaedia article: Trigger (only available in German)

    Ja äh, hier irgendwas mit Dingen und so...

  • Hi,

    thanks for respond.

    I tried it, what did you describe above, but without any result. It would be great, if i define my problem at the first place, but hey, why does make it the easy way when there is harder way, right? ;) So here we are.

    I've created scenery object with script which includes only one function - OnReceiveTriggerStringSend (In my scenerio it should just send a string, which is set in editor - like a point on the track, something like ETCS, to the vehicle when it is above the trigger), then I attached this scenery to the trigger object - like it is stated in Lexicon article.

    Vehicle is set the same way, how it is described - senzor is added and the script includes function SendMessageToTriggerReceiveAnswer. But I still don't get that string to the vehicle. I am totally clues where i have a error vv° I hope i descriped my problem understandably.

    So the question what should be asked, does someone know what i should do differently or how to set it up, to make it works?

    Thanks for any answer.

    Best regards

    Mikes

  • HI,

    it would be helpful if you could show the respective functions from the script (vehicle & scenery object). Then I could see if I can find a problem with it.

    Ja äh, hier irgendwas mit Dingen und so...

  • Hi,

    yea sure. ;)

    for object - whole code:

    and in vehicles script is mention this:

    Code
    1. procedure OnEnterLeaveTrigger(triggerid: string; entering: boolean; sensorindex: integer);
    2. begin
    3. AVV_MIB_data := SendMessageToTriggerReceiveAnswer(Self, 'MSGTOTRIGGER', 'AVV', 0);
    4. end;

    I know, that doesn't follow the "STANDARDIZATION" as is written in Lexicon, but this functions are specific and right now it isn't much more than testing :)


    Best regards

    Mikes

  • I can't directly recognise any error in the script. It looks exactly the same for me.

    What occurs to me now:

    - Have you added the vehicle trigger in the content tool?

    - Were you able to make sure that the scenery object and the trigger are linked correctly?

    Ja äh, hier irgendwas mit Dingen und so...

  • Hey :)

    -if you meant with 'vehicle trigger' Sensors, yea I have it.

    -I did it same way as it is described it, I click left click on my object to select it and then right click on the trigger and choose "Assign trigger to selected object".


    Best regards

    Mikes

  • I don't have many ideas left. You could add tests to the script to see if certain functions are called at all. You could also see if the standard calls work better.

    Ja äh, hier irgendwas mit Dingen und so...

  • To be honest, me either, but I have been trying different stuff and I found interesting thing. I used for testing base map Diorama - from open source. I placed some triggers inside a track - like there were placed by dev and edited few vehicle script lines to get some feedback. Interesting thing is, that trigger that I placed, vehicle ignores (same trigger settings like by dev), but triggers which ones were already there - placed by dev, vehicle doesn't ignore. So I tried connect my scenery object to the original trigger and try it. Vehicle recorded trigger but unfortunately did not get any string from the connected object - of course it depends if it is really connected, but there is no way how to find it out.

    So i guess there ends my effort.

    Anyway, thank you so much for yours answers.

    Best regards

    Mikes

  • Newly created posts will remain inaccessible for others until approved by a moderator.

    The last reply was more than 60 days ago, this thread is most likely obsolete. It is recommended to create a new thread instead.

    The maximum number of attachments: 5
    Maximum File Size: 500 kB
    Allowed extensions: bmp, cfg, ini, jpeg, jpg, lct, ldl, llg, lob, log, lpmtl, lptmt, ltx, pas, pdf, png, railtrack, rar, txt, veh, wav