Hello,
I'm making Lotus script files by translating my omsi script files.
I'd declared "elec_busbar_main" and "elec_busbar_main_sw" in the {Public Vars} part of main script file.
This Variables must have used at 3 or more .pas files, so I think It have to be declared at {Public Vars} section.
And this is my Elec.pas script. (I also included this file by using {$I Elec.pas} code.)
- procedure Elec_Init;
- begin
- elec_V_battery := 1;
- elec_busbar_avail := true;
- elec_start_sound_P_imsi := -1;
- elec_busbar_main := false; < Here's "elec_busbar_main" work.
- elec_busbar_main_sw := 0; < Here's "elec_busbar_main_sw" work.
- end;
- procedure Elec_SimStep;
- begin
- if engine_n > elec_generator_minRPM then elec_V_generator := true else elec_V_generator := false;
- if (elec_busbar_main_sw = 1) then elec_V_battery := Max((elec_V_battery - (Timegap / elec_battery_duration)), 0); < Here's "elec_busbar_main_sw" work.
- elec_V_battery := Max(elec_V_battery, B2S(elec_V_generator));
- if (elec_V_battery >= elec_busbar_Vmin) and (elec_failure_general = false) then
- elec_busbar_avail := true
- else
- elec_busbar_avail := false;
- if elec_busbar_avail and elec_busbar_main_sw = 1 and not elec_failure_general then < Here's "elec_busbar_main_sw" doesn't work.
- elec_busbar_main := true < Here's "elec_busbar_main" doesn't work.
- else
- elec_busbar_main := false; < Here's "elec_busbar_main" doesn't work.
- end;
I used variable which already declared at {Public Vars} but It it not worked at importing script and error message "Unknown Identifier "elec_busbar_main"" has occurred.
When I delete the "doesn't work" parts, It was imported successfully. I just do not know why the variables in One files are taking different result.
I think I used variables properly (compare to example scripts), but error was occurred. So I wonder if my script is wrong, or there is other method to use Variables that I didn't know.
Maybe It is basic problem to you, Experts. But I spend more than 24 hours to fix this and did not succeed, So I ask your advice.
Thank you.