Jump to content
Sign in to follow this  
scudrunner

Veh Respwan W/Removed Weapons and Mags

Recommended Posts

Hey all. I'm scratching my head on this one. I have some Av8-'s and SU's in a mission with an init that removed some of their weapons and Magazines. Problem is, when they respawn, they respawn with their full compliment of weapons. Is there a way this can be remedied? Perhaps with a trigger? Or maybe a script that says all these vehicles have none of their weapons (except guns and the SU's rockets...i.e., NOT AIM9's, r-73's, or GBUs) Any help would be greatly appreciated!

If this works I'd also like to remove guided rockets from Cobra's, A-10's, and Ka50's as well.

EDIT:

How I failed to spell respawn correctly in the heading I do not know. lol.

Share this post


Link to post
Share on other sites

m8 check out this thread here: http://www.flashpoint1985.com/cgi-bin....=norrin

A couple of posts in I give an example of how to set up something like this.

If you want the one script to add ammo to several different vehicles where it says <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">//code to remove and add ordinance

_vcl removeMagazine "...";

_vcl addMagazine "...";

put something like this instead

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">//code to remove and add ordinance

if ("Su34B" == typeOf _vcl) then

{

_vcl removeMagazine "...";

_vcl addMagazine "...";

};

if ("AV8B" == typeOf _vcl) then

{

_vcl removeMagazine "...";

_vcl addMagazine "...";

};

etc.

Share this post


Link to post
Share on other sites

Hey, thanks for the help. But for a reason I am convinced I cant explain, I'm steering away from Karr's respawn. I'm convinced that sometimes it crashes my missions when a helo or jet crashes (too) occasionally.

Anyway, could you interpret this respawn and possibly explain how to introduce the above changes into it?

[/code]; Call in initline with (120 for 120 seconds, 2 minutes) :

;

; [this, 20] exec "vehirespawn.sqs"

;

; Note - This script needs a "GameLogic" trigger named "SERVER" or else spawning will be nuts

;

?! (local server): exit

~3

_vehicle = _this select 0

_delay = _this select 1

_empty = true

_disabled = false

_moved = false

_startpos = getpos _vehicle

_startdir = getdir _vehicle

_type = typeof _vehicle

#waiting

~2

_newpos = getpos _vehicle

?! (_newpos select 0 in _startpos) or not (_newpos select 1 in _startpos): _moved = true

?! (isnull driver _vehicle) or not (isnull gunner _vehicle) or not (isnull commander _vehicle): _empty = false

? (isnull driver _vehicle) and (isnull gunner _vehicle) and (isnull commander _vehicle): _empty = true

?! (canmove _vehicle) or (canfire _vehicle): _disabled = true

? (canmove _vehicle) and (canfire _vehicle): _disabled = false

? (_disabled) and (_empty): goto "spawn"

? (_moved) and (_empty): goto "spawn"

goto "waiting"

#spawn

~_delay

?! (isnull driver _vehicle) or not (isnull gunner _vehicle) or not(isnull commander _vehicle): _empty = false

?! (_empty): goto "waiting"

deletevehicle _vehicle

~0.5

_newveh = _type createvehicle _startpos

_newveh setpos _startpos

_newveh setdir _startdir

[_newveh, _delay] exec "vehirespawn.sqs"

exit

I'm not looking for a hand out and Im not lazy I have tried quite a bit to figure it out. I know nothing about scripting, huh.gif

Share this post


Link to post
Share on other sites

To be honest I also ran into problems with AI units causing crashes with KaRRiLLioN's vehicle respawn back in ArmA ver 1.02 and spent some time rewriting part of his script to make it compatible with respawning AI. I'm not sure what happens with KaRR's script in ver 1.08 as since this time I've been using only my own ver of the script (if you ever want it I can shoot you a copy smile_o.gif).

Anyway getting back to the script you are using adding the code towards the bottom should be all you need to do (I haven't tested this though).

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">; Call in initline with (120 for 120 seconds, 2 minutes) :

;

; [this, 20] exec "vehirespawn.sqs"

;

; Note - This script needs a "GameLogic" trigger named "SERVER" or else spawning will be nuts

;

?! (local server): exit

~3

_vehicle = _this select 0

_delay = _this select 1

_empty = true

_disabled = false

_moved = false

_startpos = getpos _vehicle

_startdir = getdir _vehicle

_type = typeof _vehicle

#waiting

~2

_newpos = getpos _vehicle

?! (_newpos select 0 in _startpos) or not (_newpos select 1 in _startpos): _moved = true

?! (isnull driver _vehicle) or not (isnull gunner _vehicle) or not (isnull commander _vehicle): _empty = false

? (isnull driver _vehicle) and (isnull gunner _vehicle) and (isnull commander _vehicle): _empty = true

?! (canmove _vehicle) or (canfire _vehicle): _disabled = true

? (canmove _vehicle) and (canfire _vehicle): _disabled = false

? (_disabled) and (_empty): goto "spawn"

? (_moved) and (_empty): goto "spawn"

goto "waiting"

#spawn

~_delay

?! (isnull driver _vehicle) or not (isnull gunner _vehicle) or not(isnull commander _vehicle): _empty = false

?! (_empty): goto "waiting"

deletevehicle _vehicle

~0.5

_newveh = _type createvehicle _startpos

_newveh setpos _startpos

_newveh setdir _startdir

;code to remove and add ordinance

if ("Su34B" == typeOf _newveh) then {_newveh removeMagazine "..."; _newveh addMagazine "..."}

if ("AV8B" == typeOf _newveh) then {_newveh removeMagazine "..."; _newveh addMagazine "..."}

[_newveh, _delay] exec "vehirespawn.sqs"

exit

Where its says <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_newveh addMagazine "..." just add what ever you want the plane to carry eg. "6Rnd_GBU12_AV8B" as ammo for the bomb launcher on the harrier.

For a list of weapons: http://community.bistudio.com/wiki/ArmA:_Weapons

You'll need to addMagazine for each additional ammo you want the vehicle to carry.

For example to add 18 bombs to the Harrier:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if ("AV8B" == typeOf _newveh) then {_newveh addMagazine "6Rnd_GBU12_AV8B"; _newveh addMagazine "6Rnd_GBU12_AV8B"; _newveh addMagazine "6Rnd_GBU12_AV8B"}

Sometimes you'll also want to remove the existing weapons when the vehicle spawns hence the ' _newveh removeMagazine "..." code'.

If you want the vehicle to carry different weapons then you'll also need to add a weapon using the addWepaon command see: http://community.bistudio.com/wiki/addWeapon

Share this post


Link to post
Share on other sites

Wow. After much trial and error it seems to be working. (why removemagazine on some and removemagazineS on others?!, lol) Thanks for your help !

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  

×