Jump to content
Sign in to follow this  
DTM2801

Convoy creator & convoy control v1.0

Recommended Posts

I am making a mission where I need the convoy to be destroyed, how would i go about finding that info? trigger? Even just knowing if a certain vehicle was taken out would help as the rst are defenders for this one truck.

Loving the script BTW, making my missions a whole lot cleaner.

Edited by ker8er0s

Share this post


Link to post
Share on other sites

Great script...but how do you check to see if the convoy has been destroyed?

The obvious would be:

!alive (Convoy_1) && !alive (Convoy_2) 

But that doesnt work.

Share this post


Link to post
Share on other sites

you need the correct names of the vehicles, if they don't have names then give them names and use those to check the !alive status and that should work upto a point.

The problem is that a vehicle can be damaged but not destroyed so it would be a good idea to use !canmove unitname instead or as well as !alive.

Share this post


Link to post
Share on other sites

Right, however this script assigns names to the vehicles it spawns. Looking through the code it looks like it assigns "Convoy_1", Convoy_2", etc etc...

Placing a !alive trigger and then killing the spawned vehicles doesnt work. So I've either got the names wrong or something is broken.

What I think is happening is that it doesnt recognize the names of the vehicles outside of the script (because the debug messages in the script work). Is that even possible?

Edited by Lexxer

Share this post


Link to post
Share on other sites

Maybe use damage instead?

The vehicle names should be available outside the scope of the script. You may also try to add a killed eventhandler to each of the vehicles...?

Share this post


Link to post
Share on other sites

Tried damage, tried event handlers (unless Im doing it wrong) doesnt work.

So either I havent got the names of the vehicles correct or they arent for some reason passing beyond the scope of the script.

This is the code:

_spawned setVehicleVarname format ["Convoy_%1",(_vehspawn + 1)];

So looks to me like it should be Convoy_1, Convoy_2, etc.

Hmm just noticed this..im not exactly sure what it does but i can guess that it limits scope:

if (isServer) then {
private ["

Edited by Lexxer

Share this post


Link to post
Share on other sites

I didn't notice before that he was spawning one convoy and yes indeed Convoy_1 ect should be the name and it is, but for some reason you can't access this name.

It looks like it isn't being made into a publicvariable.

I tried to but even after that I still can't use the name but when I use the trigger it tells me convoy_1 has activated it.

Strange.

Share this post


Link to post
Share on other sites

Ok i found a solution to this.

place a marker called "startconvoy" and the usual convoywp1/2/3 etc.

make a file called startconvoy.sqf.

put this in it:

{deletevehicle _x;} foreach crew veh1;

{deletevehicle _x;} foreach crew veh2;

{deletevehicle _x;} foreach crew veh3;

deletevehicle veh1;

deletevehicle veh2;

deletevehicle veh3;

_pos = getmarkerpos "startconvoy";

_grptank = creategroup West;

_tankSpawn = [[(_pos) select 0, (_pos select 1), 0], 0, "HMMWV_M1151_M2_DES_EP1", _grptank] call BIS_fnc_spawnVehicle;

veh1 = _tankspawn select 0;

_tankSpawn1 = [[(_pos) select 0, (_pos select 1)- 10, 0], 0, "MTVR_DES_EP1", _grptank] call BIS_fnc_spawnVehicle;

veh2 = _tankspawn1 select 0;

_tankSpawn2 = [[(_pos) select 0, (_pos select 1)- 20, 0], 0, "HMMWV_M1151_M2_DES_EP1", _grptank] call BIS_fnc_spawnVehicle;

veh3 = _tankspawn2 select 0;

null= [control,WEST,["convoywp1","convoywp2","convoywp3"],false,0,7,[],[veh1, veh2, veh3],true,false]execvm "convoy.sqf";

hint "Convoy Started";

I put a game logic in my maps called server, so do this, make a trigger and add.

server exec "startconvoy.sqf";

this will spawn a new convoy, name them veh1 veh2 veh3, then exec the convoy script. I assume everyone can recognise what is going on in this script and modify it to their needs.

****MAKE SURE YOU HAVE A FUNCTIONS MODULE AND AT LEAST ONE UNIT OF THE CONVOYS SIDE IN YOUR MAP***

Hmm just noticed this..im not exactly sure what it does but i can guess that it limits scope:

if (isServer) then {
private ["

change this to:

if (true) then {
private ["

for it to work in multiplayer.

Share this post


Link to post
Share on other sites
Ok i found a solution to this.

place a marker called "startconvoy" and the usual convoywp1/2/3 etc.

make a file called startconvoy.sqf.

put this in it:

I put a game logic in my maps called server, so do this, make a trigger and add.

server exec "startconvoy.sqf";

this will spawn a new convoy, name them veh1 veh2 veh3, then exec the convoy script. I assume everyone can recognise what is going on in this script and modify it to their needs.

****MAKE SURE YOU HAVE A FUNCTIONS MODULE AND AT LEAST ONE UNIT OF THE CONVOYS SIDE IN YOUR MAP***

change this to:

if (true) then {
private ["

for it to work in multiplayer.

That throws up an error about control being an undefined variable and the waypoints fail...any idea?

UPDATE:

Here is a revision from the above script

control = true;
_pos = getmarkerpos "startconvoy";

_grptank = creategroup West;
_tankSpawn = [[(_pos) select 0, (_pos select 1), 0], 0, "HMMWV_M1151_M2_DES_EP1", _grptank] call BIS_fnc_spawnVehicle; 
veh1 = _tankspawn select 0;

//Change HMMWV_M1151_M2_DES_EP1 to what vehicle you want to spawn in its place

_tankSpawn1 = [[(_pos) select 0, (_pos select 1)- 10, 0], 0, "MTVR_DES_EP1", _grptank] call BIS_fnc_spawnVehicle;
veh2 = _tankspawn1 select 0;

//Change MTVR_DES_EP1 to what vehicle you want to spawn in its place

_tankSpawn2 = [[(_pos) select 0, (_pos select 1)- 20, 0], 0, "HMMWV_M1151_M2_DES_EP1", _grptank] call BIS_fnc_spawnVehicle;
veh3 = _tankspawn2 select 0;

//Add how ever many more you want, but make sure you include more "vehX" names where X being a different number.

null = [control,WEST,["wp1","wp2","wp3"],false,0,7,[],[veh1, veh2, veh3],true,false]execvm "scripts\convoy\convoy.sqf";

//Change WEST in "[control,WEST" to EAST if you want it be hostile

//I have my convoy scripts located under two folders from the root mission folder as you can see. "scripts\convoy\convoy.sqf" So its in a folder called convoy in a folder called scripts

hint "Convoy Started"; 

Remove all the comments or otherwise it will give you some stupid error but it will still work fine.

Edited by Toasticuss

Share this post


Link to post
Share on other sites

cheers for the update, that script was written on the fly so bound to be an error here or there XD.

Glad it helped.

Share this post


Link to post
Share on other sites

I am using this script in the OA demo, and it seems to be working pretty well, with the usual less-than-ideal AI driving abilities.

But I'm using a convoy of 3 M1A1 tanks (with me alongside in a Humvee), and they don't seem to be firing at enemies (well, at least not the big guns, maybe they fired their machine guns, not sure). We encounter enemy vehicles, and I can see their turrets rotating towards them, but they don't fire.

Is this normal for this script, or have I missed something?

Share this post


Link to post
Share on other sites
I am using this script in the OA demo, and it seems to be working pretty well, with the usual less-than-ideal AI driving abilities.

But I'm using a convoy of 3 M1A1 tanks (with me alongside in a Humvee), and they don't seem to be firing at enemies (well, at least not the big guns, maybe they fired their machine guns, not sure). We encounter enemy vehicles, and I can see their turrets rotating towards them, but they don't fire.

Is this normal for this script, or have I missed something?

I figured this out, in one of the scripts it sets the convoys mode to BLUE when it should be RED or COMBAT.

Blue meaning never fire, red meaning open fire and engage at will

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

Look around for the word blue in the scripts and change it to red.

Share this post


Link to post
Share on other sites

Heya,

I just wanna say what a fantastic script this! It was absolutely brilliantly!

I tweaked the script a little if thats ok with you? I simply added

_combatmode = _this select 10;

and changed the two...

[_convoygrp,_i] setwaypointCombatMode _combatmode;

so that I could control the combatmode as the convoy is spawned (im not releasing the mission at all, its just for my personal use)

I have a question however...

I cant seem to remember (and figure out) how change the init line of a spawned unit / group...

I would like to use the convoy script alongside UPSMON to allow the convoy to be ambushed by the opposing team.

Can someone guide me on this please? (would the script need to be tweaked?)

edit:::

Oh also i forgot... how do i make this script start before all other scripts? (i have been doing a lot of testing on one mission using lots of modules, mods and scripts all at the same time... and they take about 5min to load up (i mean 5 minutes after i am in the game running around and stuff) grouplink 4 seems to start up about between 5 - 8min in game)

Edited by WoodyUK

Share this post


Link to post
Share on other sites

anyone know if this works in CO cause it keep saying that the sqf file isn't found even though its in my mission folder?

Share this post


Link to post
Share on other sites

Just started to use this but cannot find out how I can work out if the Convoy is destroyed ?

I have tried !alive Convoy_1 with a hint but it never get the hint once i blow it up ?

Any idea how i find the name assisgned as it is via script ?

Thanks

Share this post


Link to post
Share on other sites

Although I am not sure if anyone will read this the script for some reason does not work with any ACR units, they just pull off to the side or stand still for some reason

Share this post


Link to post
Share on other sites

I've played around with it and I've used 3 M113A3 APC's on the map Sangin, for some reason the 2nd and 3rd vehicle won't move at all.

I'm unsure why but I'm looking into it, awesome script if I get it working :D

Tested on another map with no avail, does anyone have the same issue where just the 1st Vehicle is starting to move?

Share this post


Link to post
Share on other sites

can i add gear in the vehicles ? when yes how i can add gear ? i dont know sry for my bad english =(

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  

×