Jump to content
Sign in to follow this  
froggyluv

Static Gunners

Recommended Posts

I'd like to get a script which lets AI static gunners disembark and attack if an enemy gets within x meters.

Here Static unit is named Bill and if I put this in his init line:

 (gunner bill) action ["getout",bill]

he disembarks. What I don't get is when I put that code into an sqs. file and call it in his Init line, nothing happens.

Share this post


Link to post
Share on other sites
What I don't get is when I put that code into an sqs. file and call it in his Init line, nothing happens.

It should be an sqf.

Share this post


Link to post
Share on other sites

Thanks. What are the factors that decide whether a file is in sqf or sqs format?

Also, could someone help me out with how I would make this a global trigger so I don't have to put 25 individual tiggers on the map? I can grasp how to make individual units do individual things but I get lost when trying to do it as Groups in one little script.

Edited by froggyluv

Share this post


Link to post
Share on other sites

Im really not the guy to ask but I always use an sqf. when im calling it from a unit or objects init.

Share this post


Link to post
Share on other sites

SQS is old school. Just use SQF when writing scripts.

Share this post


Link to post
Share on other sites

Got it. :p

But the fact remains that I can have 'Bill" call that script with an enemy present trigger but how do I have Bill2, Bill3 and so on call the same script?

This doesn't work but am I on the right track here?

_x = {"bill","bill_1"}

(gunner _x) action ["getout",_x]

Edited by froggyluv

Share this post


Link to post
Share on other sites

I just had ago and came up with this, you had part of it right.

place a manned static gunner and a few other unarmed men grouped( unarmed so you can test)

Place this command in the static gunners init

trig1 attachTo [mgun1,[0,0,0]]

Place a single waypoint over the Static gunner with the getin command.

Then create a trig about say 10m wide or whatever

in the ON ACT

(gunner mgun1) action ["getout",mgun1] 

I just used different names than yours.

The trigger can be placed anywhere on the map and needs to be setup for Activation OPFOR and repeated.

Place an unarmed OPFOR behind the gunner and place a way point that takes him close to the gunner.

If it's working the gunner will get out and shoot the OPFOR then get back in.

If the gunner gets killed one of the other units grouped should get in.

Share this post


Link to post
Share on other sites

^^^

Very cool! That actually gives more functionality then I asked for and works great for my mission.

Share this post


Link to post
Share on other sites
^^^

Very cool! That actually gives more functionality then I asked for and works great for my mission.

Glad it helped but it is a little hit and miss after more testing, they get out well enough but keeping them out can be a problem.

Share this post


Link to post
Share on other sites
SQS is old school. Just use SQF when writing scripts.

call me old fashioned but i prefer SQS still :)

Share this post


Link to post
Share on other sites

More static gun fun :D

First off, thanks again F2k Sel, what you recommended fits what I'm working on perfectlty.

How would I go about declaring a static object 'dead' once it has been unmanned? Meaning, I've got victory conditions checking if t1-t8 are not alive. Problem is, it still counts those units alive until destroyed which might not be feasible at that point of the mission ie. tons of satchels.

Is there a way to declare unmanned as basically dead?

Share this post


Link to post
Share on other sites

I'm not really sure, I had a friend who usually did all the checking for ending and starting missions.

Maybe a new thread as I think it would be useful to know the answer myself.

Share this post


Link to post
Share on other sites

I've been working on something similar and no matter what I do, the *&%$#$% AI just keeps going back into the Nest. He pops out for a second and then re-enters.

How do I keep him out?

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  

×