OZMT script.

  • How to make the 2 and 3 doors open separately, like the 1st door?

    Or is this not supported?


    And further. I animated the door opening buttons 1, 2, 3 and open / close all doors. The variable "A_CP_SW_Tueren" is responsible for opening and closing doors, how to make sure that one part of the buttons was responsible only for opening, and the other part - only for closing?

    https://pp.userapi.com/c851428…667/49020/fC0p3gcyDSE.jpg

  • I recommend you to create only one animation for one door each. Then you attach different variables to the animations. You don't need two variables for each closing and opening. Instead increasing the value means opening und decreasing means closing.

    Multiple procedures can have different consequences now: One procedure changes all values at the same time so all doors will be opened. Another procedure is for opening one particular door. The same with closing.

  • karadamir

    Changed the title of the thread from “Animation of doors, change in the script.” to “OZMT script.”.
  • The question is, is it possible to write a new variable in the script that is not in the standard variables?

    Just for example, I changed the functionality of the turn signals. Now to turn them on, you need to click on the button and turn off by clicking on the same button. Is it possible to make a shutdown on each side (right and left)?
    For example:


    Code
    1. Turning on:
    2. else if (id = 'IndicatorToLeft') then begin if Pushbutton_Press(_cockpit.TS_IndicatortoLeft, value)
    3. else if (id = 'IndicatorToRight') then begin if Pushbutton_Press(_cockpit.TS_IndicatortoRight, value)
    4. Shutdown:
    5. else if (id = 'IndicatorToLeft_OFF') then begin if Pushbutton_Press(_cockpit.TS_IndicatortoLeft_OFF, value)
    6. else if (id = 'IndicatorToRight_OFF') then begin if Pushbutton_Press(_cockpit.TS_IndicatortoRight_OFF, value)
  • In this case, you may be able to set the button as a normal switch "TSwitch" so that it is not spring loaded.?/


    However, I do not see any reason why you should limit yourself by using only standard variables. If there is no comparable variable, it should be fine if you create your own.

  • In this case, you may be able to set the button as a normal switch "TSwitch" so that it is not spring loaded.?/

    With "Pushbutton_Press," how is it that you clicked and immediately released back.

    Well, or do this: turn on the turn signal, the button is clamped; turn off the turn signal, the button returned to its original position. But for this kind of answer "PushbtnInOut_Set".

  • In continuation of the problem, which is described in the topic "OZMT team." Below I will describe exactly what the problem is.


    In short, the problem is that it refers to the wrong type of variable. I changed the main switch from a switch (for 3 actions) to a button (1-2 actions).

    I will show you examples from GT6N and what I have:


    Code: GT6N_cockpit (224:0)
    1. procedure Cockpit_OnButton_HighVoltageMainSwitch(var _cockpit: TCockpit; value: boolean; eventmode: TEventMode);
    2. begin
    3. if (eventmode = emOn) or ((eventmode = emToggle) and not PowerSupply.HV_MainRelay) then
    4. TurnSwitchTwoDirSpringloaded_Plus(_cockpit.SW_Hauptschalter, value)
    5. else if (eventmode = emOff) or ((eventmode = emToggle) and PowerSupply.HV_MainRelay) then
    6. TurnSwitchTwoDirSpringloaded_Minus(_cockpit.SW_Hauptschalter, value);
    7. Cockpit_TriggerSound(_cockpit, cesRotBtn, value);
    8. HintCheckReverser;
    9. end;


    Code: OZMT-10_cockpit (199:0)
    1. procedure Cockpit_OnButton_HighVoltageMainPushButton(var _cockpit: TCockpit; value: boolean; eventmode: TEventMode);
    2. begin
    3. if (eventmode = emOn) or ((eventmode = emToggle) and PowerSupply.HV_MainRelay) then
    4. PushbtnInOut_Set (_cockpit.TS_GV, value)
    5. Cockpit_TriggerSound(_cockpit, cesBtn, value); HintCheckReverser
    6. if (eventmode = emOff) or ((eventmode = emToggle) and PowerSupply.HV_MainRelay) then
    7. PushbtnInOut_Set (_cockpit.TS_GV, value);
    8. Cockpit_TriggerSound(_cockpit, cesBtn, value); HintCheckReverser end;

    How do I correctly describe that the main switch works on the button?

    Thanks in advance for your help!

  • Is this the latest version of the script? In the snippet you posted is nothing at 202:41. Anyway, you might check the types for the procedures and the variables in TCockpit. (You find them in stdelements.pas or techelements.pas)

  • Code
    1. procedure Cockpit_OnButton_HighVoltageMainPushButton(var _cockpit: TCockpit; value: boolean; eventmode: TEventMode);
    2. begin
    3. if (eventmode = emOn) or ((eventmode = emToggle) and PowerSupply.HV_MainRelay) then
    4. PushbtnInOut_Set (_cockpit.TS_GV, value)
    5. Cockpit_TriggerSound(_cockpit, cesBtn, value); HintCheckReverser
    6. if (eventmode = emOff) or ((eventmode = emToggle) and PowerSupply.HV_MainRelay) then
    7. PushbtnInOut_Set (_cockpit.TS_GV, value);
    8. Cockpit_TriggerSound(_cockpit, cesBtn, value); HintCheckReverser end;

    This procedure is a mess. I suggest, you read up on Pascal's if syntax. When you have multiple statements in an if block, you need to put these statements in a begin...end block. Also, you need to put a semicolon after every statement. What you probably want here is this:

    Also, typing this, I noticed that both if blocks contain exactly the same code. You can put them in a single block:

    Code
    1. procedure Cockpit_OnButton_HighVoltageMainPushButton(var _cockpit: TCockpit; value: boolean; eventmode: TEventMode);
    2. begin
    3. if (eventmode = emOn) or ((eventmode = emToggle) and PowerSupply.HV_MainRelay) or (eventmode = emOff) then
    4. begin
    5. PushbtnInOut_Set(_cockpit.TS_GV, value);
    6. Cockpit_TriggerSound(_cockpit, cesBtn, value);
    7. HintCheckReverser;
    8. end;
    9. end;

    This should be equivalent to:

    Code
    1. procedure Cockpit_OnButton_HighVoltageMainPushButton(var _cockpit: TCockpit; value: boolean; eventmode: TEventMode);
    2. begin
    3. if PowerSupply.HV_MainRelay or eventmode <> emToggle then
    4. begin
    5. PushbtnInOut_Set(_cockpit.TS_GV, value);
    6. Cockpit_TriggerSound(_cockpit, cesBtn, value);
    7. HintCheckReverser;
    8. end;
    9. end;


    Hope this helps. :)

  • Captain Vimes and Heidetorf, thank. It turns out, more true, then this script code?