Jump to content

Different instances of a Flg number in ME Action Flag and Do Script File Flag?


Recommended Posts

Posted

I am having problems addressing the same Flag number value set in a lua script (Do script file) and the same Flag number value accessed from the Mission Editor Do Script.

 

Do internal and external lua scripts create separate instances of the same Flag number and consequently return separate values??

 

For example, I "setUserFlag" 4001 = 1 in the lua script file and read it ("getUserFlag") in the do script box. I have debug messages in the lua file that say Flag 4001 = 1 while in the ME the do script value is returned as 4001 = 0.

klem

56 RAF 'Firebirds'

ASUS ROG Strix Z390-F mobo, i7 8086A @ 5.0 GHz with Corsair H115i watercooling, Gigabyte 2080Ti GAMING OC 11Gb GPU , 32Gb DDR4 RAM, 500Gb and 256Gb SSD SATA III 6Gb/s + 2TB , Pimax 8k Plus VR, TM Warthog Throttle, TM F18 Grip on Virpil WarBRD base, Windows 10 Home 64bit

Posted (edited)

Check you havnt accidentally type cast the scripts flag. DCS will accept both strings and integers as a flag name / number. I should clarify that the string '4001' would be a different flag to one set with 4001 as an integer.

 

Edit: A sample bit of code would be good so we can see exactly how you're doing it.

Edited by Steggles
  • Like 1

-16AGR- 16th Air Guards Regiment is always looking for pilots - http://www.16agr.com

 

EWRS - Early Warning Radar Script

 

Specs:

 

 

Gigabyte Sniper Z5-S

Intel i5-4670k 3.4GHz OC'd 3.9GHz w/ Thermaltake 120mm Water 3.0 Pro Liquid CPU Cooler

16GB RAM

Gigabyte GTX 1080

TM Hotas Warthog: SN: 06976

Saitek Pro Flight Combat Rudder Pedals

TrackIR5 with TrackClipPro & Oculus Rift

2x 28" 4k UHD Monitors (3840x2160 each) + 1280x1024

 

 

Posted
Check you havnt accidentally type cast the scripts flag. DCS will accept both strings and integers as a flag name / number. I should clarify that the string '4001' would be a different flag to one set with 4001 as an integer.

 

Edit: A sample bit of code would be good so we can see exactly how you're doing it.

 

Doohhhh!

 

Many thanks Steggles.

 

I read somewhere that getUserFlag and setUserFlag had to be cast to string using ('..var..'). Of course, I realise now that clashes with the integers in the ME flag numbers.

 

Works just fine now :)

klem

56 RAF 'Firebirds'

ASUS ROG Strix Z390-F mobo, i7 8086A @ 5.0 GHz with Corsair H115i watercooling, Gigabyte 2080Ti GAMING OC 11Gb GPU , 32Gb DDR4 RAM, 500Gb and 256Gb SSD SATA III 6Gb/s + 2TB , Pimax 8k Plus VR, TM Warthog Throttle, TM F18 Grip on Virpil WarBRD base, Windows 10 Home 64bit

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...