Jump to content
Sign in to follow this  
wokstation

Spawning AI in SP missions on a trigger?

Recommended Posts

First up, greetings! First post, recently got ArmA and the very first thing I did? Opened the editor. It's a curse - I always do that with every game.

So I'm pottering about and have created a little scenario, but I'm in need of help. There's a tank, it's surrounded by soldiers including AA specialists. The AA-S guys need to die before the A-10 tank-buster comes in and takes out the tank, and this is where I'm having trouble.

In the unit creation properties in the editor, there's a field called "Condition of presence" (or similar). I've spent hours trying to make this work on the fly - ie, once the AA-S guys are dead a value gets set to true and the Condition field reads it and spawns the unit. I'm getting the idea that I've misunderstood this field, despite having read several wiki's, that big ol' sticky thread with so much information it's bewildering and battered away at my keyboard in a desperate attempt to make it do what I want - spawn the A-10 when the AA-S troops have been removed.

It's not going to do it, is it? Am I right in thinking that field is only parsed at the start of the mission, along with the init fields? Do I therefore have to delve into the horrors of scripting (hey, it's a horror to me - I've not touched a script yet except using "this setDamage 1" to blow stuff up at the start) and try and spawn a unit that way?

...if so... help? My experience level with this code is 0. My experience level with any code is pretty darn low (I never really progressed past QBasic), so feel free to teach me to suck eggs if it's neccesary. I really would be appreciative of any help smile_o.gif

(PS: dumb question of the year, where the heck's the screenshot key hiding?)

*edit* Oh would you look at that? I managed to post it in the wrong forum whistle.gif

Time to find a mod...

Share this post


Link to post
Share on other sites

There's a little bit of info about Condition_of_Presence here.

It's probably only checked upon creation, but you could easily test that yourself. Set it to false during the mission and see what happens.

Share this post


Link to post
Share on other sites
There's a little bit of info about Condition_of_Presence here.

It's probably only checked upon creation, but you could easily test that yourself. Set it to false during the mission and see what happens.

Yeah I read that one. Unfortunately everything I put in that box either gets disregarded (which is why I think it's only parsing at the start) or throws up an error in the editor. It doesn't like semi-colons in there, that's for sure...

...so what next?

Share this post


Link to post
Share on other sites

The easiest way i can think of, without the need of a script, would be to create the A10 far away and let it fly in circles until the codition is true.

How can you do this? Pretty simple: create the A10 far away, set special as "flying" and give it 3 or 4 move waypoints. Then add a "Cycle" waypoint close to the very first move wp. And at last create a S&D Waypoint close to the tank.

Now you need to break the circle and let the A10 move towards the tank, for this, create a trigger. Size, shape, side and this are obsolete for this purpose, just make sure "type" is SWITCH! In the line condition replace "this" with your variable which you already have. And last, sync the trigger with the CYCLE waypoint (i think it's F5 but not sure).

For sure with script it could be done by createvehicle a A10 midair whenever needed, but this way should work also.

Myke out

Share this post


Link to post
Share on other sites
create the A10 far away, set special as "flying" and give it 3 or 4 move waypoints. Then add a "Cycle" waypoint close to the very first move wp. And at last create a S&D Waypoint close to the tank.

Now you need to break the circle and let the A10 move towards the tank, for this, create a trigger. Size, shape, side and this are obsolete for this purpose, just make sure "type" is SWITCH! In the line condition replace "this" with your variable which you already have. And last, sync the trigger with the CYCLE waypoint (i think it's F5 but not sure).

Interesting, thanks - I'm going to have to go research using switches now then biggrin_o.gif

Also the createVehicle script command, could that be called as the action of a trigger? (Put it in the "on activate" field) If so, how would I then change it's starting properties? It wouldn't exist in an editbox...

Share this post


Link to post
Share on other sites

Well, that got it working perfectly smile_o.gif A little experimenting with making the trigger-switch work on the waypoints and the Warthog came right on in and took out the tank pretty much on cue.

arma-a10.jpg

Many thanks! Now I just need to make it all a bit more... fleshed out smile_o.gif

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  

×