Jump to content
Sign in to follow this  
Bejmo

Need help with Seek and destroy waypoint in script

Recommended Posts

Hi all. I have been trying to get a spawned unit to Seek and destroy but am haveing no luck. I have a unit in the editor set with the SAD waypoint and they do just that. However my spawned unit gets into formation and dosn't move anywhere. I have this in my script.

_point1 = getmarkerPos "WPOF1";
_wp0 = GRPOF1R addWaypoint [ _point1, 100];
_wp0 setWaypointType "Seek And Destroy";
_wp0 setWaypointStatements ["true", ""];
_wp0 setWaypointSpeed "FULL"; 

Any ideas?

Also what would i add to get a spawned unit to enter an MG nest. I tried all kinds of move in as...... etc but couldn't crack it.

Share this post


Link to post
Share on other sites

_wp0 setWaypointType "SAD";

Watch my signature for to find the correct syntaxes for scripting commands..

;)

Share this post


Link to post
Share on other sites

Thanks mate i thought it had to be something simple LOL and thanks for the links checking them out now :)

---------- Post added at 09:11 AM ---------- Previous post was at 07:33 AM ----------

Ok that worked perfectly but. There's allways a but sory :rolleyes:With the other( cant make head nor tales of the script pages ) Basicaly what i am trying to do is make a script that can be used by multiple units. What i have is many road blocks and to keep FPS high i would like to have each of them spawned when the player gets close enough. So to do it with waypoints i would need a huge number of scripts because each MG nest would have to be named etc etc..

Now i know this is wrong but it will give an example of what i am trying to achieve

createMarker ["GRPBF1R", position SPBF1]; 
"GRPBF1R" setMarkerPos getPos SPBF1;

Sleep 2;

GRPBF1R = Creategroup West;

GRPBF1R createUnit ["I44_Man_A_Army_Ranger_NCO_M1Carbine", getMarkerPos "GRPBF1R", ["GRPBF1R"], 1, "FORM"];

{_x moveInDriver (nearestObject [_x, "LandVehicle"])} forEach (units (group this));

GRPBF1R allowfleeing 0;

Sleep 1;

exit

Any ideas apreciated. I am slowly learning about scripting but i have prescious little time and it is soooo confusing to a total noob.:bounce3

Ok i got the above to work a fiew times :( but now it dosn't. weird

Edited by Bejmo

Share this post


Link to post
Share on other sites

I need to figure out how to delete some crew from mg nests but leave the nests i have been using

{{deleteVehicle _x} foreach crew _x; deleteVehicle _x} foreach thislist 

Set in trigger OnAct

But as i said the mg nests dissapear to.:o

Share this post


Link to post
Share on other sites

Still having no luck with this . There is plenty on how to delete both vehivle and crew but not crew only. I tried removeing bits here and there but it just stufs the whole thing up. This has to be possible. If some one could just point me in the right direction.

Also i am having difficulty understanding how a lot of the scripts work and what some of the syntax means. Would it help if i knew some C++ or something as it would be easy enough to get some books and learn a bit. Just dont know what would be best to learn and then transfer over from.

Share this post


Link to post
Share on other sites

Try this:

Give your MG bunker a name, lets say mg1.

Then inside your trigger put this:

{deleteVehicle _x} forEach crew mg1;

How you call the trigger (BLUFOR present or something) is up to you.

Share this post


Link to post
Share on other sites

That won't work, it's odd as _x setdamage 1 will kill the crew.

Also if you use the following on a static gunner the gunner sits down, very odd.

{_x setdamage 1; deleteVehicle _x} forEach crew mg1;

Share this post


Link to post
Share on other sites

Maybe you first have to get them out of the bunker and then delete them ?

Share this post


Link to post
Share on other sites

The best I've come up with is to just setpos the crew to a trigger and then delete the units using thislist.

on act trig1

{{_x setpos getpos grave} foreach crew _x} foreach thislist

second trigger

anyone present

10 by 10

repeating

trigger named grave

on act

{deleteVehicle _x} foreach thislist

This gets around the naming problem that seems to prevent some commands not working.

Share this post


Link to post
Share on other sites

Cool thanks guys i will try tonight and report back :)

:( nope no joy. Will keep at it tho ;)

Edited by Bejmo

Share this post


Link to post
Share on other sites
Cool thanks guys i will try tonight and report back :)

:( nope no joy. Will keep at it tho ;)

Not that this is what your looking for, but i have a hunter script that works with a created group.

init.sqf

Hunters = compile PreprocessFile "Hunters.sqf";

Hunters.sqf

Create a named group via script.In this case the hunter group is named parasquad.The players group is named Xray.I call it like this null = [] spawn Hunters.sqf after the group is created.

 if (alive leader parasquad) then {

  while {leader parasquad distance leader xray > 10} do {

                  {_x doMove getPos leader xray} foreach units ParaSquad;

                  sleep 2;

                  {_x reveal leader xray} foreach units parasquad;

                            sleep 2;

        if (leader parasquad distance leader xray < 125 && leader xray distance leader parasquad > 100) then {

                            leader parasquad doTarget leader xray;
                            leader parasquad fire ["SmokeShellMuzzle", "SmokeShellMuzzle", "SmokeShell"];

                                                                               };
                                         sleep 1;  

                         if (leader parasquad distance leader xray < 100 && leader xray distance leader parasquad > 85) then {

                                                leader parasquad doTarget leader xray;
                                                leader parasquad fire ["HandGrenadeMuzzle", "HandGrenadeMuzzle", "HandGrenade_east"];

                                                                                             };
                                                                 sleep 1;

                                               if (leader parasquad distance leader xray < 100) then {

                                                            Parasquad setBehaviour "combat";
                                                            Parasquad setCombatMode "RED";
                                                            Parasquad setSpeedMode "full";
                                                            Parasquad setFormation "wedge";
                                                            //hint"combat roe";

                                                                          } 
                                                                          else
                                                                          {

                                                            Parasquad setBehaviour "aware";
                                                            Parasquad setCombatMode "yellow";
                                                            Parasquad setSpeedMode "normal";
                                                            Parasquad setFormation "wedge";
                                                            //hint"aware roe";               

                                                      };

                                                sleep 2;      

                };


 }; 

                 waitUntil {leader parasquad distance leader xray > 25};
                 null = [] spawn Hunters

The hunter group will change ROE based on how far they are away from group xray (players group), aswell as pop smoke and throw hand grenades based on group to group distance.

Share this post


Link to post
Share on other sites

OOh very handy thank you Iceman77 i will have a look at this on the weekend ; ) It will come in handy for shure. Nice to have some Gerry hunter groups working a bit more dynamicaly : )

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  

×