Jump to content
Sign in to follow this  
tapull

Need help with coding Waypoint script

Recommended Posts

Hi im triying to setup a waypoint "on-activation"-script for the task to liberate 3 villages. I want it to check when triggered if there is still enemy units in the trigger area. When there are none left its liberated : which means it should add +1 to liberated villages (3 villages in total). But my script doesnt seem to work. Please i need help. Happy New Year btw !

Screenshots : file:///C:/Users/taras/Downloads/script%20help/problem.PNG

Condition

!((count (units group thisList) > 0) && {(side _x == east) || (side _x == resistance)} count (units group thisList) > 0) 

 

On activation

_taskName = "Liberate Villages"; 
_villageName = "Pavlokhov"; 
 
if (!(taskState [_taskName, _villageName])) then { 
    taskSetState [_taskName, _villageName, true]; 
 
    _liberatedVillages = 0; 
    { 
        if (taskState [_taskName, _x]) then { 
            _liberatedVillages = _liberatedVillages + 1; 
        }; 
    } forEach ["Pavlokhov", "Novoshny", "Solnevny"]; 
 
    hint format ["%1 Villages Liberated! Move on.", _liberatedVillages]; 
}; 

 

Share this post


Link to post
Share on other sites

check out the syntax for https://community.bistudio.com/wiki/setTaskState. It looks like youre not giving it the arguments it wants. in your case it would be something like _taskName taskSetState "COMPLETED"; Im not sure what you're doing with that array you're passing: [_taskName, _villageName] doesnt mean anything in this context.
 

Also consider using https://community.bistudio.com/wiki/Arma_3:_Task_Framework. its much cleaner than the simple task stuff for most applications

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×