Jump to content
Sign in to follow this  
jw custom

Ultra Simple Patrol Script

Recommended Posts

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.

Put a scripts folder in your C:\Users\Mosh\Documents\ArmA 2 (I use win 7, might be different for you) folder and you can access them in any mission you create from there... but before you pbo them, make sure you copy the scripts you need to that particular mission first. I hope that helps... if that's even what you're asking, heh.

Going to try these scripts out JW, thanks. :)

Share this post


Link to post
Share on other sites

Make a scripts folder and then place the USPS.sqf in that folder? then how exactly do I access it from the editor?

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.

Speaking of that, would someone give an example of an init that is executing multiple scripts?

And, will the init execute pbo files, or,

put the pbo in a mod folder in the root, or, what?

What's the best way?

TIA

EDIT: Oh, I guess a person can put multiple folders with dif scripts, as long as the path is correct in the unit init box. Would it be like...

\script(folder)\(mod)folder\script.sqf ? - One more thing to clarify. By best way, I mean, because I am playing with the editor and changing the scripts all the time.

Edited by CyOp

Share this post


Link to post
Share on other sites
Make a scripts folder and then place the USPS.sqf in that folder? then how exactly do I access it from the editor?

Going way off topic here, but yes, put in scripts folder and call from unit init line as normal. See readme or first page of this topic to see what to put.

I'm learning all this myself too... so I might not be able to explain very well.

Oh, I guess a person can put multiple folders with dif scripts, as long as the path is correct in the unit init box. Would it be like...

\script(folder)\(mod)folder\script.sqf ?

Not if you have them in scripts folder like I said above, just call the script like it was in the same folder, nothing extra. Unless you mean a folder in your mission folder, then yes... exec blah blah blah "myscriptsfolder/script.sqf"

If you have any more questions, please do a search, and let's get back on topic here. :) I'm confusing myself here...

Edited by Mosh

Share this post


Link to post
Share on other sites

Thank you for you answer. I did search. But, yes, sorry. (BTW, even before I ever posted here the first time, I searched for weeks just so I would not get in trouble. :) I ALWAYS search first.)

Also, I did not exactly understand your answer. I will re-read.

Share this post


Link to post
Share on other sites
Also, I did not exactly understand your answer. I will re-read.

I think I misunderstood what you asked... I don't know the answer, sorry. I'm new at this scripting stuff myself and only know what works for me.

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.

In your profile folder where you have the missions folder, scripts folder etc. Just make a text (notepad) file with collected commands in it and give each a headline.

Like:

USPS:

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

And save it there. Then when you need it just alt+tab and copy/paste it in. Prolly smarter ways out there but this is how ive done it for years. I have tons of text files that i saved with descriptions of what it is and the commands neatly stacked up. :)

-----

Thanks JW for the update. Good work mate!

EDIT: BTW can the markers be of any shape? Long and thin for example?

EDIT2: You missed explanation for argument 9 in your RTF readme. ;)

Edited by Alex72

Share this post


Link to post
Share on other sites

Yeah, Alex72, thanks for that reply to blackpulpit.

Myself, I looked here for a long time, then went to Google and found the Tips and Tricks thread.

I just put a scripts folder, and mod folders inside of that, with the scripts for each mod per relative folder. (Man, I should have done that weeks ago. And, I just finished cleaning up my profile folder. What a mess it was, with an edit here and there for the same mod/s.)

OT

I have only used the new script about 4 times and once wound up falling out of the sky. Everyone died, of course. :) (Also, of course, I know it was meant for AI. But, if I have a squad or two missing, that may be a guess as to the cause of their demise.)

Edited by CyOp

Share this post


Link to post
Share on other sites

But, if I have a squad or two missing, that may be a guess as to the cause of their demise.)

Thats because you have the last parameter set to something higher than 0, it should only be set higher than 0 if it's a aircraft of some sort your dealing with.

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

So set the value marker above in red to 0.

EDIT: BTW can the markers be of any shape? Long and thin for example?

Only reason i used a visible ellipse marker was to show the area of interest, it's only the center of the marker thats used so the obvious would be to use a "Empty" icon marker :)

EDIT2: You missed explanation for argument 9 in your RTF readme.

Oops your right that will be fixed on next update :)

Edited by JW Custom

Share this post


Link to post
Share on other sites

That is very presumptuous of you! :p But, no, sorry, I have this:

nul = [this, 500, "patrolMarker", "patrolMarker", 500, "AWARE", 100, "LIMITED", "WEDGE", 0, 0] execVM "USPS\USPS.sqf";

EDIT: Just to be clear, there is only ONE maker now, and it should be named 'patrolMarker'? And, BTW, if I had a setting of 75, you know I would have fallen out of the sky every time. (I did re-read the thread and files.) :)

Edited by CyOp

Share this post


Link to post
Share on other sites
That is very presumptuous of you! :p But, no, sorry, I have this:

nul = [this, 500, "patrolMarker", "patrolMarker", 500, "AWARE", 100, "LIMITED", "WEDGE", 0, 0] execVM "USPS\USPS.sqf";

EDIT: Just to be clear, there is only ONE maker now, and it should be named 'patrolMarker'? And, BTW, if I had a setting of 75, you know I would have fallen out of the sky every time. (I did re-read the thread and files.) :)

You can use 1 or 2 markers with whatever names you like as long as you use same name in the parameter as you used as marker name.

1. If you use one marker the unit/group will randomly spawn around that marker and also randomly patrol around that marker.

nul = [this, 500, "patrolMarker", "patrolMarker", 500, "AWARE", 100, "LIMITED", "WEDGE", 0, 0] execVM "USPS\USPS.sqf";

2. If you use two markers the unit/group will randomly spawn around the 1st marker and randomly patrol around the 2nd marker. This is useful if you wanna place unit/group at 1 point and make them move towards another patrol where they will patrol.

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

Share this post


Link to post
Share on other sites

Is this something that can be called later by a trigger and spawn the group then, or does it only work at the start of the mission?

I'm an editing rook and I'd like to be able to spawn defense forces for when a player gets near that objective, not before, to save on processing until those AI need to be in the game. Just like how its done with spawning town defenses in Warfare and its contemparies.

If this script doesn't fulfill that need, would anyone be able to point me in the right direction? I've tried searching but I can't anything, I'm probably a searching rook too :p

Share this post


Link to post
Share on other sites
Is this something that can be called later by a trigger and spawn the group then, or does it only work at the start of the mission?

I'm an editing rook and I'd like to be able to spawn defense forces for when a player gets near that objective, not before, to save on processing until those AI need to be in the game. Just like how its done with spawning town defenses in Warfare and its contemparies.

If this script doesn't fulfill that need, would anyone be able to point me in the right direction? I've tried searching but I can't anything, I'm probably a searching rook too :p

I can easily make it so the script waits until a variable is true and then the scripts continue.

For now you'll have to spawn units through a script and then run this script on them. Then you have full control of when things happens.

Share this post


Link to post
Share on other sites
I can easily make it so the script waits until a variable is true and then the scripts continue.

For now you'll have to spawn units through a script and then run this script on them. Then you have full control of when things happens.

Oh, so I can just use a trigger to spawn the units when the player gets nearby, and then a few seconds later run your script on those spawned units and it'll work as expected?

That should work just as well, awesome!

Share this post


Link to post
Share on other sites
Oh, so I can just use a trigger to spawn the units when the player gets nearby, and then a few seconds later run your script on those spawned units and it'll work as expected?

That should work just as well, awesome!

Here's an example of what you wanna accomplish:

1. Walk into the trigger area to spawn a 3 man group.

2. The group will be placed randomly within "Marker1".

3. The group will move towards "Marker2" and randomly patrol within it.

http://www.filefactory.com/file/a2g2518/n/spawn1.utes.zip

Share this post


Link to post
Share on other sites

Alex72 I made a microsoft word folder with the USPS in it in my scripts folder? because I have no clue on making a "text file". I alt tab out of my editor and can copy the script but how in the world do I paste it in my init? my mouse does not let me paste it in there, I know I am doing something wrong so please bear with me and help me out with this, I appreciate your help, thanks.

Share this post


Link to post
Share on other sites
Alex72 I made a microsoft word folder with the USPS in it in my scripts folder? because I have no clue on making a "text file". I alt tab out of my editor and can copy the script but how in the world do I paste it in my init? my mouse does not let me paste it in there, I know I am doing something wrong so please bear with me and help me out with this, I appreciate your help, thanks.

Mark the string you wanna copy press ctrl+c to copy it, then in the init field press ctrl+v to paste it in :)

Share this post


Link to post
Share on other sites

Thanks JW that worked. One thing I noticed when I used this script is that the units did not patrol, they move to there spots in formation then did nothing? what am I doing wrong you think? thanks.

Share this post


Link to post
Share on other sites
Thanks JW that worked. One thing I noticed when I used this script is that the units did not patrol, they move to there spots in formation then did nothing? what am I doing wrong you think? thanks.

Are you using latest version, v1.4?

Are you talking about all your units/groups or just one that didn't start patrol?

Also run the compiled mission .pbo(the green mission name) rather than the editor one(the blue mission name).

Share this post


Link to post
Share on other sites

This is a great script and I am finding it very useful. Is there any way to make the ai units respawn ?

Share this post


Link to post
Share on other sites
This is a great script and I am finding it very useful. Is there any way to make the ai units respawn ?

No not atm. but maybe in a future update. But tomorrow i can make you an example on how to make a group respawn while using the this script :)

Share this post


Link to post
Share on other sites
No not atm. but maybe in a future update. But tomorrow i can make you an example on how to make a group respawn while using the this script :)

That would be great, many thanks. Looking forward to tomorrow :yay:

Share this post


Link to post
Share on other sites
Here you go:

http://www.filefactory.com/file/a2he609/n/spawn2.utes.zip

Shoot the 3 men in the group and they'll respawn 5 times in total.

Thank you, seems easy, is there any way that they can patrol a second marker?

:)

Forget that last question I worked it out. Many thanks, this is just what I been looking for :)

BTW can you use this to spawn vehicle,s?

Edited by LockJaw-65-

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  

×