Jump to content
pierremgi

AI VEHICLE RESPAWN script, an alternative for BI module

Recommended Posts

*

Edited by BhangBR
duplicate post and I could not delete

Share this post


Link to post
Share on other sites
2 hours ago, BhangBR said:

Hello guys

 

I am totally lay with programming and I need help to do an aerial combat training mission for me and my friends to play

 

I'm not able to make the script work. I do not know what I'm doing wrong. I destroy the AI vehicle and it does not spawn again

 

I just need to follow the steps in the video and create two .sqf files (MGI_fnc_getVehicleLoadout and MGI_setVehicleLoadout) in the root folder, right?

 

Do you have any mission as an example for me to look at?

 

I would like to spawn AI vehicles that are the enemy of everyone, including AI previously spawned

 

thank you

 

I guess you and your friends are on one side, and enemies belongs to another one.

If you're not skilled at all, and you are using the editor only;

just add a trigger (simple one, non repeatable),

replace the condition: this,  by: true

copy/paste the first or second script in on activation field but change the last line:

0 = [[crate2,WEST,karl,CIVILIAN],["death","start","start","start"],10,true,false] spawn MGI_fnc_VehicleRespawn; // example

for something like:

0 = [EAST,"start",10,true,false] spawn MGI_fnc_VehicleRespawn;

remove: // example, as comments like this are unsupported in triggers.

 

  • Thanks 1

Share this post


Link to post
Share on other sites
12 hours ago, pierremgi said:

0 = [EAST,"start",10,true,false] spawn MGI_fnc_VehicleRespawn;

 

 

it worked!
But the mission I'm using is not working very well ...

I got a mission from a guy. The author allowed me to include and change his scripts, as long as I keep the respective credits

It's a deathmatch. players are blufor and kill another player gives positive score

At the beginning of the mission the vehicle spawns right. After blowing up the vehicle, it spawns without AI and gives "Bad Vehicle Type". If the vehicle explodes there is no new spawn

 

 

Spoiler

47377827_2142849152649145_60437399687470

 

Share this post


Link to post
Share on other sites
On 02/12/2018 at 4:03 AM, BhangBR said:

Hello guys

 

I am totally lay with programming and I need help to do an aerial combat training mission for me and my friends to play

 

I'm not able to make the script work. I do not know what I'm doing wrong. I destroy the AI vehicle and it does not spawn again

 

I just need to follow the steps in the video and create two .sqf files (MGI_fnc_getVehicleLoadout and MGI_setVehicleLoadout) in the root folder, right?

 

Do you have any mission as an example for me to look at?

 

I would like to spawn AI vehicles that are the enemy of everyone, including AI previously spawned

 

thank you

Unable to open your .rar . Anyway, playing with several flying aircraft seems to be an issue. The code is OK but some scheduler (Arma engine) limitation can impact the result. The bad vehicle error is not 100% repeatable . So, if I have time, or if someone would dig into script, there is an optimization to do.

Share this post


Link to post
Share on other sites

Hello guys

I decided to do a mission from the beginning.

I previously managed to make this script work. I can not do more now

It spawns two vehicles and their respective crews. as the vehicles spawn in the same position, both explode

Do you have any mission with the script included? This way it's easier for me

 

Spoiler

47684870_2145729895694404_20752693821450

 

 

47571740_2145729875694406_74803446173055
 

 

 

 

 

Share this post


Link to post
Share on other sites

That's probably because you run the script twice!

I don't have this problem at all, nor double spawn, neither error msg. Tested with hosted + client.

Share this post


Link to post
Share on other sites

But in the mission it is executed only once.

So I'm asking for an example mission, so I can see where I'm going wrong

Share this post


Link to post
Share on other sites

I got it. Really I was putting two (one on each side).

 

Ty ;-D

Share this post


Link to post
Share on other sites

Hey Pierre,

just trying this out, it maybe just what we need, having problems getting dynamic loadouts back,
ive used your second script with
0 = [[],"start",10,true,true] spawn MGI_fnc_VehicleRespawn;

at the end 
i put it in a trigger with  true instead of this
 but the vehicles are respawning with the original loadouts.
https://imgur.com/a/a4wbSkk    -Trigger

https://imgur.com/a/DsChYVr  - before respawn

https://imgur.com/a/rED97WV- after respawn
  no scripting here other than the trigger.

if you need video i can do that )

 

 

 

 

Share this post


Link to post
Share on other sites

That's because you tested it with setdamage 1 on plane.

This way doesn't fire the EH handleDamage I'm using to pick all data at the right time (if not, i couldn't respawn as is when vehicle blows).

 

So, play normally or test firing on it with a tank, a bomb or anything able to cause hit damage.

Share this post


Link to post
Share on other sites

Ty for the quick reply.  
 works great,  we moved it into the init script for now,  

 there is.. a problem,   not unlike the problem we have in our current scripting
 some vehicles seem to respawn with a pylon that doesnt belong 

 (its actually the default pylon for that position, but it shows a weapon, with no mags)ArmA_3_Screenshot_2018.12.14_-_02.30.36.

 

i made a video, as short as possible.
 there are 2 ah64 and two mi24-p   one of each has empty plyons. 
in your script all is well except for the extras.. (first mission)
in our script.. the same results(second mission)
in our attempt to fix our script.. we were not able to return ammo to the turret weapon.. (third mission)
 this affects countermeasures.. a gun if its assigned to the pilot,  and sometimes laser designator.

i showed this in some jets on the last mission. 


 the reason we are looking for solution is because it would be possible for one to rearm this pylon at a truck
 and, its kinda annoying to have red for no reason lol.
 it would appear as though you are an expert in this area ))
 

 

Share this post


Link to post
Share on other sites

In your video, for 2nd and 3rd  missions, you're still using setDamage 1 to blow up the helos. So, consider it's not my bad. You're skipping EH handleDamage and I don't want to manage that.

For the first case (using a tank), I tried to reproduce that with CUP_O_Mi24_D_Dynamic_TK and CUP_B_AH64D_DL_USA, both with custom loadout and empty pylons.

Using my 2nd script, the only difference with initial helo was I had to wait for reloading an aim-9L sidewinder.

 

For now, I will not make any change on this script.

 

 

Share this post


Link to post
Share on other sites

the 2nd, 3rd scripts are not yours , just showing similarities. and  why we went looking for a new one.   using setdamage on these , pylons still load fine.
we arent using an eh for handle damage, 2nd, 3rd scripts
 it was more to show that we have the same problem with the ah64 and the mi24  as in video.  and the mystery pylon.
i was using rhs in this case sorry i didnt specify, i do not see this problem with cup with the ah64 either havent tested mi24
thanks for watching it, it was longer than i would have liked.
 it seems to happen when you take the defaults away. if you test in rhs, customize the pylons  or empty pylons, and you will see same as picture above

I looked at some cup stuff too some stuff is perfect, other stuff, is as above.

ArmA_3_Screenshot_2018.12.16_-_00.20.02.ArmA_3_Screenshot_2018.12.16_-_00.22.25.ArmA_3_Screenshot_2018.12.16_-_00.20.24.ArmA_3_Screenshot_2018.12.16_-_00.21.44.

Edited by UDIE
more information

Share this post


Link to post
Share on other sites

on the gom dynamic loadout thread there is a fix for this issue, im not sure if you follow it, but i tested and it worked in our situation. maybe it could work for yours too))

 

  • Like 1

Share this post


Link to post
Share on other sites

Will this script work for UAV such as the Greyhawk?

 

I'm running a Domination server and am using the vehicle respawn module to respawn all UAV but when they respawn they no longer have dynamic loadout option.

 

Thanks.

Share this post


Link to post
Share on other sites

Yes, It should. Test that in Vanilla Arma (no mod). If you have time, describe how I can reproduce that (out of Domination) and make a little video. Thks.

Share this post


Link to post
Share on other sites

I wanted to try the 2nd script but I have no clue how to run it.

 

Do I have to create an sqf file for my mission folder?

 

Or can I run it in the expression field in respawn module?

 

Thank you.

Share this post


Link to post
Share on other sites

This script doesn't need the BI respawn module. It's done to replace it. See the video for global explanation.

I also explained how to use the scripts in this topic.

Or... you can use the MGI advanced modules instead (not at the same time). You shouldn't need any extra script.

Share this post


Link to post
Share on other sites
21 hours ago, pierremgi said:

This script doesn't need the BI respawn module. It's done to replace it. See the video for global explanation.

I also explained how to use the scripts in this topic.

Or... you can use the MGI advanced modules instead (not at the same time). You shouldn't need any extra script.

Ok, I've been reading through the entire thread and I'm starting to figure it out.

 

Been testing on a Greyhawk I have on the USS Freedom carrier.

 

The Greyhawk respawns but at a Marker named "Start" which was placed by xeno.

 

Last line of script:

0 = [[veh1],["start"],10,true,false] spawn MGI_fnc_VehicleRespawn;

 

I don't think I can remove that Start marker so I'm wondering how to get it to spawn back on carrier...

 

Thanks for the reply.

Share this post


Link to post
Share on other sites
3 hours ago, pazuzu said:

The Greyhawk respawns but at a Marker named "Start" which was placed by xeno.

 

Last line of script:

0 = [[veh1],["start"],10,true,false] spawn MGI_fnc_VehicleRespawn;

 

I don't think I can remove that Start marker so I'm wondering how to get it to spawn back on carrier...

 

 

Yes, the script checks for marker(s) first, then "start" as string parameter. So if a marker is named 'start", this one will be used.
What you can do is:

- mark the initial position by a marker like "veh1Start" and specify this marker in your command line : 0 = [[veh1],["veh1Start"],10,true,false] spawn MGI_fnc_VehicleRespawn;

- change my script (command line included) to read "startVeh" as string anytime you read "start". This way,(if you don't have any marker already named "startVeh", this string will operate and the true position at start will be used.

 

NOTE: There are some remaining problems, respawning on a carrier, and when UAV  has remaining waypoints, choosing the start position. I'll check that.

 

Share this post


Link to post
Share on other sites

Ok, I changed the script line to:  if (_position == 'veh1Start' or (_x getVariable ['emptyVeh',false])) exitWith {_pos = getPos _veh};

 

And:  0 = [[veh1],["veh1Start"],10,true,false] spawn MGI_fnc_VehicleRespawn;

 

I created a marker where the UAV is located on the carrier and it did respawn there but on the water.

 

I tried changing the z value of the marker in the mission.sqm but it did not work.

 

I googled the problem and found that I needed to define the marker in my init.sqf

 

I tried these 2 examples:

 

_veh1Start = getMarkerPos "respawn_";
"respawn_" setMarkerPosLocal [_veh1Start select 0, _veh1Start select 1, 160.01];

 

"veh1Start" setMarkerPosLocal [markerPos "veh1Start" select 0, markerPos "veh1Start" select 1, 160.01];

 

But the UAV is still spawning on the water.

 

How do I get it to spawn at the proper height?

 

Thank you.

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

×