Jump to content

"trigger.action.marktoall" visibility syntax problem


strikers_blade

Recommended Posts

My apology for the newbie 101 question here. I am trying to put a markToAll on the F10 map as soon as my "tank" is activated.

The spawning is working as it should. Problem is the mark appears regardless if the "tank" has been spawned or not.

 

The way I understood is if the "tank" is not on the map,  mission1:isExist() == false.

Where am I wrong?

 

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

local function softmenu()
    Spawnsoft = SPAWN:New( "tank" )
    Spawnsoft_Group = Spawnsoft:Spawn()   
end

 

mission1 = Group.getByName( "tank" )

 

if mission1 and mission1:isExist() then
  local Vec3 = mission1:getUnit(1):getPosition().p
  local GroupID = mission1:getID()
 trigger.action.markToAll( 1, "Mission #1", Vec3, GroupID )
end

My systems:

 

Windows 10 64 bits

I7-8700k

32.0 GB RAM

500Gb SSD

Asus ROG 2080ti

HP Reverb

 

Windows 10 64 bits

I7-6820HQ CPU @ 2.70Ghz

32.0 GB RAM

500Gb SSD

Nvidia Quadro M4000M

TrackIR 5

Link to comment
Share on other sites

Do you call this script later or at the mission start?

 

You do something like:

 

ONCE > some condition is true > DO SCRIPT (here you input all the above code)

 

or you call the SPAWN function and the mark on different triggers?

 

Give us  more details, maybe attach de mission or a screenshot

 

Link to comment
Share on other sites

25 minutes ago, dark_wood said:

Do you call this script later or at the mission start?

 

You do something like:

 

ONCE > some condition is true > DO SCRIPT (here you input all the above code)

 

or you call the SPAWN function and the mark on different triggers?

 

Give us  more details, maybe attach de mission or a screenshot

 

My apology @dark_wood .

I load 3 scripts at the mission start; Moose, MIST and my TargetMenu (which include the EWRS - Thanks Bob7hebuilder).
From there, I spawn the tank from the F10 menu and the script goes from there (line 728 of the targetmenu.lua)

 

test_marktoall.miz

My systems:

 

Windows 10 64 bits

I7-8700k

32.0 GB RAM

500Gb SSD

Asus ROG 2080ti

HP Reverb

 

Windows 10 64 bits

I7-6820HQ CPU @ 2.70Ghz

32.0 GB RAM

500Gb SSD

Nvidia Quadro M4000M

TrackIR 5

Link to comment
Share on other sites

From your code, the main issue is that mark script is not inside softmenu() function.

Right now, when mission start, DCS read your lua file and execute the code - placing the mark

 

Try to place the mark code inside your function, this way it will be called when you click the F10 comm menu.

 

Or, if you need them separated, place mark script inside a new function, then call it with a scheduler, like you do on line 781 (timer.scheduleFunction(ewrs.displayMessageToAll....)

This way, you scheduler will call the new function each 60 seconds (for example) and check if the condition is true - if yes, add the mark

 

Hope it helps you 🙂

Link to comment
Share on other sites

2 minutes ago, dark_wood said:

From your code, the main issue is that mark script is not inside softmenu() function.

Right now, when mission start, DCS read your lua file and execute the code - placing the mark

 

Try to place the mark code inside your function, this way it will be called when you click the F10 comm menu.

 

Or, if you need them separated, place mark script inside a new function, then call it with a scheduler, like you do on line 781 (timer.scheduleFunction(ewrs.displayMessageToAll....)

This way, you scheduler will call the new function each 60 seconds (for example) and check if the condition is true - if yes, add the mark

 

Hope it helps you 🙂

Are you %$#@%$# kidding me?!  man, that was so newbie on my part !!!
Thanks @dark_wood . I am retreating to my basement in shame now 😞

  • Like 1

My systems:

 

Windows 10 64 bits

I7-8700k

32.0 GB RAM

500Gb SSD

Asus ROG 2080ti

HP Reverb

 

Windows 10 64 bits

I7-6820HQ CPU @ 2.70Ghz

32.0 GB RAM

500Gb SSD

Nvidia Quadro M4000M

TrackIR 5

Link to comment
Share on other sites

  • Recently Browsing   0 members

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