Jump to content
jo spanner

Custom waypoints - setwaypointtype?

Recommended Posts

Hi,

I'm trying to create one of the waypoints added by LAMBS danger.fsm, inside a script.

The waypoint, when placed in the editor, comes out like this:

class Item3
{
  dataType="Waypoint";
  position[]={4315.8604,19.190001,7840.2637};
  type="lambs_danger_Retreat";
  script="\z\lambs\addons\wp\scripts\fnc_wpRetreat.sqf";
  class Effects
    {
    };
  showWP="NEVER";
  id=68;
};

My understanding for creating a waypoint is that you would do this:

_waypoint = _group addwaypoint [position somePosition,0];
_waypoint setwaypointtype "lambs_danger_Retreat";
_waypoint setwaypointscript "\z\lambs\addons\wp\scripts\fnc_wpRetreat.sqf";

But it does not work - it gives an enum error on the setwaypointtype. "Foreign error".

What am I doing wrong here? There must be a way to do this. Zeus can create these waypoints with the extended addon.

Share this post


Link to post
Share on other sites

Hi,

 

Might be a little late but I wanted to achieve almost the exact same thing for groups spawned via the "SpawnAI" module. Basically, the only thing that needs to be changed it:

_waypoint setwaypointtype "SCRIPTED";

 

This appears to tell the game to expect a reference to a script in the next line which you were already providing. In my particular example I put this in the expression field of the "SpawnAI" module to make endless waves of AI rush the enemy:

spawnedGroup = _this select 0;   waypoint = spawnedGroup addwaypoint [position attack1,0];  waypoint setwaypointtype "SCRIPTED";  waypoint setwaypointscript "\z\lambs\addons\wp\scripts\fnc_wpAssault.sqf";

 

Hope this is still helpful!

Share this post


Link to post
Share on other sites

Truly, there is no need to use specific waypoints. "scripted" type has no added value (it's an old fashion).

A simple "MOVE" does the trick. You just have to script the "on activation" field (editor) or in your addWaypoint script, in an sqf context (following the addWaypoint line) or even in the setWaypointStatements

 

Now, if you elaborate a custom (advanced) waypoint, you need to make a mod, scripting for cfgWaypoints class. It's different from your approach, if I'm right, as you try to modify an item from a mission.sqm.

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

×