Jump to content
Sign in to follow this  
domcho

ArmA 2 make AI use an added action

Recommended Posts

Rather than have the plane fly round in circles, it would probably be better to spawn it just before you need it and get him to fly straight in. Your plane is probably completing it's last waypoint before starting its bombing run, hence it's delay.

Also because the bombs have quite a lot of forward velocity, you will need to drop them early to hit the target.

Welcome to the world of mission making - timing is everything!

Share this post


Link to post
Share on other sites
Rather than have the plane fly round in circles, it would probably be better to spawn it just before you need it and get him to fly straight in. Your plane is probably completing it's last waypoint before starting its bombing run, hence it's delay.

Also because the bombs have quite a lot of forward velocity, you will need to drop them early to hit the target.

Welcome to the world of mission making - timing is everything!

I don't understand how to spawn a vehicle. I create a game logic and name it SpawnPos, then type in a trigger activated by radio alpha:

[getPos SpawnPos, 180, "BMP3", EAST] call bis_fnc_spawnvehicle

Nothing happens. Tried with the link that Kylania gave me:

_vec_array = [markerPos "some_marker", random 360, "A10", west] call BIS_fnc_spawnVehicle;

I created a marker named some_marker but again nothing appeared. And I spawned east or west soldier with 0% for the bmp 3 and the A10. Nothing goes how it should. Sorry, this is my first mission in ArmA 2, I am new to the game and to the editor. :(

Share this post


Link to post
Share on other sites
*snip*
if you read info on BIS_fnc_spawn.... youll see that you need a functions module placed on map, and wait for it to be initiated, usually a second or 2 else use the condition found on the BIKI.

Edit: seems the BIKI isnt very clear on the functions module, its a small note at bottom page.

place this in the triggers condition line and it will activate immediatly once the module is ready.

!isnil "bis_fnc_init"

Share this post


Link to post
Share on other sites
if you read info on BIS_fnc_spawn.... youll see that you need a functions module placed on map, and wait for it to be initiated, usually a second or 2 else use the condition found on the BIKI.

Edit: seems the BIKI isnt very clear on the functions module, its a small note at bottom page.

place this in the triggers condition line and it will activate immediatly once the module is ready.

!isnil "bis_fnc_init"

I placed a functions module, typed in the trigger condition: !isnil "bis_fnc_init"

on activation:

_vec_array = [markerPos "mymarker", random 360, "A10", west] call BIS_fnc_spawnVehicle;

Nothing happened. What am I doing wrong?

Share this post


Link to post
Share on other sites

i just tested myself, using your code, one functions module and waiting until it was ready. all working.

Error on your end:

1: marker is not named mymarker

2: you dont have a west unit placed in map before the spawn.

3: you spawn it far away from you, but actually dont see it as it will spawn the a10 low on ground, wich leads many if not all times to a crash.

this will make it spawn 200 up in the air..

_vec_array = [[getMarkerPos "mymarker" select 0, getMarkerPos "mymarker" select 1, 200], random 360, "A10", west] call BIS_fnc_spawnVehicle;

Share this post


Link to post
Share on other sites
i just tested myself, using your code, one functions module and waiting until it was ready.

Error on your end:

1: marker is not named mymarker

2: you dont have a west unit placed in map before the spawn.

3: you spawn it far away from you, but actually dont see it as it will spawn the a10 low on ground, wich leads many if not all times to a crash.

Wait, I did it, I spawned an A10 but he flied on the ground. How do I make him fly normal in the air. This:

http://community.bistudio.com/wiki/flyInHeight

Or it is not the same command in ArmA 2?

I need to spawn him in the air.

Edited by Domcho

Share this post


Link to post
Share on other sites

i edited my previous post a little late, answer is there for height spawning.

also you need to read BIKI on BIS_fnc_spawnVehicle about wich select is the vehicle and then just use the flyInHeight command, wich is for arma2 aswell.

Share this post


Link to post
Share on other sites
i edited my previous post a little late, answer is there for height spawning.

also you need to read BIKI on BIS_fnc_spawnVehicle about wich select is the vehicle and then just use the flyInHeight command, wich is for arma2 aswell.

I don't understand how to make him fly at a specific height since the unit has no name since it spawns in the game. This didn't help me:

http://community.bistudio.com/wiki/BIS_fnc_spawnVehicle

At least if it contains the answer I can't find it. And thanks plane spawns in the air now. :yay::yay:

And I also want to give him a specific waypoint.

Edited by Domcho

Share this post


Link to post
Share on other sites
I don't understand how to make him fly at a specific height since the unit has no name since it spawns in the game. This didn't help me:

http://community.bistudio.com/wiki/BIS_fnc_spawnVehicle

At least if it contains the answer I can't find it. And thanks plane spawns in the air now. :yay::yay:

And I also want to give him a specific waypoint.

BIS_fnc_spawnVehicle returns an array. Position 0 of that array is the vehicle spawned. So if you had;

[font=Courier New]my_spawn = [getPos mySpawnPos, 180, "BMP3", EAST] call bis_fnc_spawnvehicle;[/font]

then

my_vehicle = my_spawn select 0;

my_vehicle is now the vehicle you just spawned. You can now do other stuff to it such as;

my_vehicle flyinheight 300;

However, you are not going to be able to do this all in the trigger onAct - I think you are better to write an external script which is called by the onAct, especially if you want to add waypoint stuff too.

Share this post


Link to post
Share on other sites
BIS_fnc_spawnVehicle returns an array. Position 0 of that array is the vehicle spawned. So if you had;

[font=Courier New]my_spawn = [getPos mySpawnPos, 180, "BMP3", EAST] call bis_fnc_spawnvehicle;[/font]

then

my_vehicle = my_spawn select 0;

my_vehicle is now the vehicle you just spawned. You can now do other stuff to it such as;

my_vehicle flyinheight 300;

However, you are not going to be able to do this all in the trigger onAct - I think you are better to write an external script which is called by the onAct, especially if you want to add waypoint stuff too.

My problem with spawning is solved but I made a new posts about how to make waypoints for the spawned units. This was solved too except that the plane has no name which means I can't activate the script you gave me from the trigger. :mad:

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  

×