Jump to content

Recommended Posts

Posted

Hello gents, quick question if I may. I am trying to play a bit with this function called units_in_moving_zones. Now, I believe this works just fine but it does not render the expected result. Basically, just to test it, I have added a function to see if the said flag is indeed set to true. In the beginning I thought that's not true but I added another trigger to check flag 11 value and this was true. However, the scheduled function it always show value 0 for flag 11. I understood that the function will launch a continuous process until you stop it. How does this work or am I doing something wrong here?

 

local flagValue = trigger.misc.getUserFlag("11")
mist.flagFunc.units_in_moving_zones
{
   units = {'[g]Ranger'},
   zone_units = {'[g]Foe'},
   flag = "11",
   radius = 30,
   interval = 5
}

mist.scheduleFunction(trigger.action.outTextForCoalition,{coalition.side.BLUE,"Flag is now " .. flagValue,5,true},timer.getTime() + 10, 10)

[sIGPIC]OK[/sIGPIC]

Posted

Your test setup is actually what is flawed.

 

local flagValue = trigger.misc.getUserFlag("11")
mist.scheduleFunction(trigger.action.outTextForCoalition,{coalition.side.BLUE,"Flag is now " .. flagValue,5,true},timer.getTime() + 10, 10)

 

So what that is doing is it is grabbing the value of "flagValue" just initially so the message will always be the same. If you ran the trigger.misc.getUserFlag('11') as part of the function, then it would run that function each time it was going to display the message.

 

mist.scheduleFunction(trigger.action.outTextForCoalition,{coalition.side.BLUE,"Flag is now " .. trigger.misc.getUserFlag("11"),5,true},timer.getTime() + 10, 10)

 

Having done a quick test the mist.flagFunc.units_in_moving_zones is working correctly.

  • Like 1

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

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Posted

Thanks Grimes, not sure why I believe I did that as well, but just to be sure, will do that again. I have no doubt function is working as expected, tested it separately, just tought to have some checking in case I'll need this kind of scenario

[sIGPIC]OK[/sIGPIC]

  • Recently Browsing   0 members

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