Jump to content
Sign in to follow this  
jw custom

Ultra Simple Patrol Script

Recommended Posts

what's new in version 1.1 ?

edit: and what will happen to missions which used the older version, now that there is a new argument and units using the old version wont have a value for that argument?

Edited by Quagmire

Share this post


Link to post
Share on other sites

When I use this, we are at the unit/s location, then we all disapear and go to a random spawn point. What can I delay. or do, to stop 'seeing' that?

How can I set things such as the squad formation?

EDIT: No one? I know it is 'simple', but I need to at least be able to set formation. I have tried multiple things, but no go.

Edited by CyOp

Share this post


Link to post
Share on other sites
hehe, guess I'm the only person in this thread who doesn't have ace installed. :p

Since ACE makes the game about a million times better you're probably the only person in the world using Arma without ACE. :)

Share this post


Link to post
Share on other sites
hehe, guess I'm the only person in this thread who doesn't have ace installed. :p

I dunno... I only run it when I have to. :D

Share this post


Link to post
Share on other sites
what's new in version 1.1 ?

I added a 6th argument, Chance of Excisting, you simply set in percentage how big a chance for the group/unit to excist. Setting 6th argument to 100 (100%) means that the group/unit will always exist.

edit: and what will happen to missions which used the older version, now that there is a new argument and units using the old version wont have a value for that argument?

Nothing will happen to those missions as they still are using the old script version where the 6th argument isn't present :)

But if you use the new version you'll have to edit the execution commandline wherever you used it.

Share this post


Link to post
Share on other sites

You could also make the last parameter optional, ex:

_chance=1;
if (count _this > 5) then
{
  _chance = (_this select 5)/100;
};

Share this post


Link to post
Share on other sites

Script updated, see details in first post :)

Found an error, script will be updated in a few minutes!

---------- Post added at 04:12 PM ---------- Previous post was at 04:04 PM ----------

Fixed!

Share this post


Link to post
Share on other sites

JW, I know the script is suppose to be simple, and I appreciate that. However, can you make it so formation can be set? I use this for myself, as a member of a squad, and the Squad Leader calls for a staggered column, but the formation is always a single column. (Not too healthy in open terrain.)

Also, I am not worried about the visible 'teleport thing'. I can live with that. Although, it would be nice to get rid of that. (The squad spawns, then we visibly 'teleport' to the random location. Kind of kills the immersion at the very start of the mission.

Share this post


Link to post
Share on other sites
JW, I know the script is suppose to be simple, and I appreciate that. However, can you make it so formation can be set? I use this for myself, as a member of a squad, and the Squad Leader calls for a staggered column, but the formation is always a single column. (Not too healthy in open terrain.)

.

There's parameter for formation in newest version.

Also, I am not worried about the visible 'teleport thing'. I can live with that. Although, it would be nice to get rid of that. (The squad spawns, then we visibly 'teleport' to the random location. Kind of kills the immersion at the very start of the mission.

This script is not ment to be executed on player units or groups with players in, it's for AI.

If you wanna randomly place a group with yourself or other players in you should do it from init.sqf so it's done before you actually ingame. This is not what this script is about :)

Share this post


Link to post
Share on other sites

Thanks. I understand it was for AI, but I was using it for me because I don't know how to script. It would still be nice to get rid of the visible teleport somehow.

If a base is designed with a patrol radius for a squad, and the squad is visible, they can be seen teleporting. Of course, I can hide the squad/s from LOS of the player upon mission start. (If I am in their radius, which so far I always am, sometimes they pop up in front of my face, too. I guess it would take too many 'if's and 'else's to cure both. :) )

Again, I know the script is suppose to be 'light weight', too. And, anyway, thanks again for it.

Share this post


Link to post
Share on other sites

Thanks a lot JW, really nice work, and the performance is really smoth with this script.

Are you thinking of making this script compatible with vehicles? Cars, tanks and choppers? I would really apreciate that.

Thanks

_neo_

Share this post


Link to post
Share on other sites

Just thought I'd let ya know if u havnt figured it out yet that the start Marker is not working. This is your script I donwloaded

[_grp, 1] setWaypointPosition [getMarkerPos [u]_patrolMarker[/u], [u]_patrolRadius[/u]];
_iniPos = getWPPos [_grp,1];
{_x setpos _iniPos;} forEach units group _unit;
[_grp, 1] setWaypointPosition [getMarkerPos _patrolMarker, _patrolRadius];

I changed it to:

[_grp, 1] setWaypointPosition [getMarkerPos _[i][u]centerMarker[/u][/i], [u][i]_spawnRadius[/i][/u]];
_iniPos = getWPPos [_grp,1];
{_x setpos _iniPos;} forEach units group _unit;
[_grp, 1] setWaypointPosition [getMarkerPos _patrolMarker, _patrolRadius];

This works much beter ;)

PS dont for get to change _patrolRadius to _spawnRadius. this has to be done before the _iniPos = getWPPos [_grp,1]; or else you will spawn AI with Marker2, radius2.

Edited by Mikey74
left something out

Share this post


Link to post
Share on other sites
Just thought I'd let ya know if u havnt figured it out yet that the start Marker is not working. This is your script I donwloaded

[_grp, 1] setWaypointPosition [getMarkerPos [u]_patrolMarker[/u], _patrolRadius];
_iniPos = getWPPos [_grp,1];
{_x setpos _iniPos;} forEach units group _unit;
[_grp, 1] setWaypointPosition [getMarkerPos _patrolMarker, _patrolRadius];

I changed it to:

[_grp, 1] setWaypointPosition [getMarkerPos _[i][u]centerMarker[/u][/i], _patrolRadius];
_iniPos = getWPPos [_grp,1];
{_x setpos _iniPos;} forEach units group _unit;
[_grp, 1] setWaypointPosition [getMarkerPos _patrolMarker, _patrolRadius];

This works much beter ;)

It's working fine the way it is:

nul = [this, 500, "Marker1", "Marker2", 500, "AWARE", 100, "LIMITED", "FILE",0] execVM "USPS.sqf";

_centerMarker = Marker1

_patrolMarker = Marker2

Also with the change you made which is unnecessary you should also change the other _patrolMarker below it else it would be even more unnecessary :p

Marker1 & Marker2 can be same name which is what i use, only reason for to different markers would be to have units spawn around one and then walk towards and patrol around the other :)

Share this post


Link to post
Share on other sites

Not sure If Im explaining myself well, becuase I understood the premise of the program and how it works. :D It was working fine but one thing.. I noticed that when I changed my 1st numbers for marker1 for example on the radiues for marker1 I went from your 600 to 5.... it still spawned them to the marker2 at a 600 radius. Thus the reason I changed it. It works much beter now. At least for me it does. They spawn where I want them to spawn rather then spawning on the patrol marker, IE Marker2. They now spawn with the spawning marker, IE marker1. Its Just it wasnt working right the 1st time. ;)

P.S. I wanted units coming from another marker (marker1) to patrol the patrol marker (marker2) to simulate attacks on the town at random areas. This is how I discovered it was flawed. Just tring to help, not try to be smart or embaress nobody. Sorry If I did.

Edited by Mikey74

Share this post


Link to post
Share on other sites
Not sure If Im explaining myself well, becuase I understood the premise of the program and how it works. :D It was working fine but one thing.. I noticed that when I changed my 1st numbers for marker1 for example on the radiues for marker1 I went from your 600 to 5.... it still spawned them to the marker2 at a 600 radius. Thus the reason I changed it. It works much beter now. At least for me it does. They spawn where I want them to spawn rather then spawning on the patrol marker, IE Marker2. They now spawn with the spawning marker, IE marker1. Its Just it wasnt working right the 1st time. ;)

P.S. I wanted units coming from another marker (marker1) to patrol the patrol marker (marker2) to simulate attacks on the town at random areas. This is how I discovered it was flawed. Just tring to help, not try to be smart or embaress nobody. Sorry If I did.

Your absolutely right, i got it mixed when i started to use setWaypointPosition to get a random position, doh!

Thanks for letting me know, it will get fixed on next update ;)

Share this post


Link to post
Share on other sites
Thanks a lot JW, really nice work, and the performance is really smoth with this script.

Are you thinking of making this script compatible with vehicles? Cars, tanks and choppers? I would really apreciate that.

Thanks

_neo_

Sorry i missed this post.

Yes i'm working on adding vehicle support, right now i seem to have it working with helo's.

Share this post


Link to post
Share on other sites
Originally Posted by JW Custom

Your absolutely right, i got it mixed when i started to use setWaypointPosition to get a random position, doh!

Thanks for letting me know, it will get fixed on next update

You are welcome. Glad to help. :)Thanks for the script :D

Share this post


Link to post
Share on other sites

hey man, love this script! but the new 1.3 is wrong some how, sorry! i really loved 1.2 if you still have it? this new 1.3 has all the units running everywhere! and even all cluttered together, i didnt even change anything! just used you sample one and thats how it was, all the other ones before was perfect! any ideas?

Thanks ... ps; i did leave you messages on the download page, any idea on how to get air and armor groups patrolling too? thanks

Share this post


Link to post
Share on other sites
hey man, love this script! but the new 1.3 is wrong some how, sorry! i really loved 1.2 if you still have it? this new 1.3 has all the units running everywhere! and even all cluttered together, i didnt even change anything! just used you sample one and thats how it was, all the other ones before was perfect! any ideas?

I'm sure what your problem is... is that the units are running? If thats the problem then change the parameter "FULL" to "LIMITED" and they will walk.

nul = [this, 200, "patrolMarker", "patrolMarker", 200, "AWARE", 100, "FULL", "FILE",0] execVM "USPS.sqf"

Thanks ... ps; i did leave you messages on the download page, any idea on how to get air and armor groups patrolling too? thanks

Yes vehicles are supported in next version :)

Share this post


Link to post
Share on other sites
I'm sure what your problem is... is that the units are running? If thats the problem then change the parameter "FULL" to "LIMITED" and they will walk.

nul = [this, 200, "patrolMarker", "patrolMarker", 200, "AWARE", 100, "FULL", "FILE",0] execVM "USPS.sqf"

Yes vehicles are supported in next version :)

Ok, sorted out that problem, thanks! but one more ... lol after sometime patrolling, they just stop and dont patrol anymore, anyway to make them perminant patrol and not stop at all? like unless there dead then they would keep patroling there sector.

Thanks man

Share this post


Link to post
Share on other sites
Ok, sorted out that problem, thanks! but one more ... lol after sometime patrolling, they just stop and dont patrol anymore, anyway to make them perminant patrol and not stop at all? like unless there dead then they would keep patroling there sector.

Thanks man

I should have sorted that problem out already, just need a little more testing.

Hopefully the new version is ready later today :)

Share this post


Link to post
Share on other sites
I should have sorted that problem out already, just need a little more testing.

Hopefully the new version is ready later today :)

Right ok, it should of been noted as a 'known problem' then, lol ... no worries! waiting for the update then, thanks man

Share this post


Link to post
Share on other sites
Right ok, it should of been noted as a 'known problem' then, lol ... no worries! waiting for the update then, thanks man

I wasn't aware of the problem until lately :)

---------- Post added at 09:22 PM ---------- Previous post was at 07:51 PM ----------

Script updated to v1.4, see details in first post :)

Share this post


Link to post
Share on other sites

JW I love the script ,but, is there a way to place it in a folder or something so I can access it in my editor on my maps and copy/paste it in the init instead of always having to type it out? sorry I am not very learned in scripts and how to use them easier, I simply have to type them in all the time, but, I thought I saw were there is a way to have it always available to use in my editor? any ideas or steps in order to do this? thanks mate.

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  

×