Jump to content

trigger.misc.getUserFlag crash


Bushmanni
 Share

Recommended Posts

When I call trigger.misc.getUserFlag it just fails to execute without any error messages. It will also stop execution of a function it is contained in. In attached mission I have a trigger that sets a flag after time is more than 5s and other that outputs text when the flag is set. When I run it nothing happens.

SSE test getFlag.miz

DCS Finland: Suomalainen DCS yhteisö -- Finnish DCS community

--------------------------------------------------

SF Squadron

Link to comment
Share on other sites

No bug, the triggers are not setup correctly. Change the first first trigger to continuous or make it a once> lua predicate> Display message.

 

Right now is Once>Time More 1> Do Script. This will always do nothing as the flag is set true at 5 seconds into the mission. This script is only evaluated once.

The right man in the wrong place makes all the difference in the world.

Current Projects: Scripting Wiki, Something...

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread), SLMOD, IADScript, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

  • 2 weeks later...

I got my mission working but I don't know what the problem was. Debug message right before getUserFlag did execute and other debug message right after it didn't or any other line inside the function. After changing some stuff in other functions both debug lines executed.

DCS Finland: Suomalainen DCS yhteisö -- Finnish DCS community

--------------------------------------------------

SF Squadron

Link to comment
Share on other sites

OK, I might have some clue of what's going on but it's quite a strange thing.

 

Steps to replicate this strange occurrence:

1. Pick blue coalition Huey from list, fly 1km from base, land and eject

2. Note the unit names and ids of the spawned soldiers in the debug message

3. Pick another Huey and ram the soldiers to see their names in debrief window.

4. Instead of having the names assigned and shown in the message, the names are what id's were. Somehow the variable values have jumped from one variable to another!

 

Before I added the loop to pick an unused unit id, the last soldier had his name correctly assigned. After adding the id picker, also the last soldier had id as his name. Something like this happened also with my radio triggers (which actually was the original problem related to flags) as with one version of the code smoke trigger executed pick up routine and the problem went away with an unrelated change somewhere else in the code (but didn't fix the getUserFlag just yet, that required some more unrelated code changes).

 

The strangely behaving function begins from line 450 in the script.

DCS Battlefield beta 5 test.miz

DCS Finland: Suomalainen DCS yhteisö -- Finnish DCS community

--------------------------------------------------

SF Squadron

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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