Jump to content

Recommended Posts

Posted

Hi,

 

I would like to force a unit to head towards another waypoint, when the trigger is activated.

 

The unit is en route to waypoint 1; I want to have it move to waypoint 2 as soon the trigger's activated; even though the unit hasn't reached waypoint 1 yet.

 

can anyone help me please?

Posted

You can use "do script" with these 2 functions : https://wiki.hoggitworld.com/view/DCS_command_switchWaypoint and https://wiki.hoggitworld.com/view/DCS_func_setCommand

 

In the "do script" box copy/paste these lines (with your Wpt numbers and unit name) :

 

SwitchWaypoint = {

id = 'SwitchWaypoint',

params = {

fromWaypointIndex = number,

goToWaypointIndex = number,

}

}

Group.getByName('your unit name'):getController():setCommand(SwitchWaypoint)

Posted

You can also just trigger the action 'AI Task Push' to push a triggered action from the aircraft menu. Under triggered actions you'll find Perform Command - Switch Waypoint.

  • Like 1

 

 

Posted
You can use "do script" with these 2 functions : https://wiki.hoggitworld.com/view/DCS_command_switchWaypoint and https://wiki.hoggitworld.com/view/DCS_func_setCommand

 

In the "do script" box copy/paste these lines (with your Wpt numbers and unit name) :

 

SwitchWaypoint = {

id = 'SwitchWaypoint',

params = {

fromWaypointIndex = number,

goToWaypointIndex = number,

}

}

Group.getByName('your unit name'):getController():setCommand(SwitchWaypoint)

 

Thanks; but it doesn't work.

I calld the group that needs to switch "aggressors"; i edited your script to;

 

SwitchWaypoint = {

id = 'SwitchWaypoint',

params = {

fromWaypointIndex = 1,

goToWaypointIndex = 2,

}

}

Group.getByName('aggressors'):getController():setCommand(SwitchWaypoint)

 

Conditions are ok, a i also set a text display when trigger is activated; text gets displayed, but the agressors do not change course.

Posted

 

Thanks; but it doesn't work...

 

I tried quickly - if I don't mistake waypoint number starts from "0" in M.E. but from point "1" in script, so it's switch Wpt from 2 to 3 (instead 1 to 2), and it "works" ... I mean something happens, but it looks bugged effectively. Here a .miz exemple, the script is triggered at 8 seconds in mission.

 

(AI doesn't change heading from 1 to 2, but instead does a large turning route to 1 and then goes to 2)

test-switchWpt.miz

Posted

 

I tried quickly - if I don't mistake waypoint number starts from "0" in M.E. but from point "1" in script, so it's switch Wpt from 2 to 3 (instead 1 to 2), and it "works" ... I mean something happens, but it looks bugged effectively. Here a .miz exemple, the script is triggered at 8 seconds in mission.

 

(AI doesn't change heading from 1 to 2, but instead does a large turning route to 1 and then goes to 2)

 

Thank you so much for your help!! I'll have a go and I'll let you know!!

 

Thanks!!

 

 

OT: this was your 1000th post!!! congrats!!

Posted
Thanks Varry, but I've been useless to make the scripted function to work.

 

But it works flawlessly the way ChillNG described in his post - and it is simpler. Here an exemple (trigger is activating flag 1 at 8 seconds in mission - AI has advanced waypoint action to switchWpt when Flag 1 is true)

Thanks to him!

 

I thank you both!

 

Your script works: problem was the waypoint numbers. I works perfectly now, no sign of bug.

 

 

 

  • Recently Browsing   0 members

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