Jump to content
Sign in to follow this  
eggbeast

SOLVED - respawn / save loadout / ammo crates / clothing script

Recommended Posts

ok here is a basic mission that enables:

file - v3 fixed ammocrates and incorporated vehicles scripts

http://www.gitsarma.gamingdeluxe.net/missions/GITS_sandbox.Stratis.pbo

features

respawn on death

save loadout (use flag near crates) including clothing, weapons, items, weaponitems

ammo crates with most items/weapons/ammo

ammo crates with backpacks, vests, headgear, uniforms

frogman crate

vehicles repair/refuel and rearm inside the ariport/dock triggers - you can make more around map if needed

damaged vehicles respawn (thanks Tophe for your fast work)

marker system added to abandoned/damaged vehicles

purpose

you can take all weapons/vehicles/clothing/items currently available in the alpha

and try out engineer /medic/ demolitions/ frogman functions

some enemies in nearby buildings to take down

enemy vehicles, boats and divers

some boats, helis and vehicles to play with

bugs

one slight bug - cannot work out how to re-enable grenades without dropping one and picking it up again - this will no doubt become apparent in time - it's to do with the selectweapon/muzzle/throw conundrum

have fun - feel free to break this open and use in your missions

just delete the enemy units etc and add in your own mission content

egg

Edited by eggbeast

Share this post


Link to post
Share on other sites

updated with fixes

so 2 problems:

1. how to place goggles in ammocrates?

_vec addWeaponCargo ["G_Diving",1];
_vec addItemCargo ["G_Shades_Black",1];
_vec addItemCargo ["G_Shades_Blue",1];
_vec addItemCargo ["G_Sport_Blackred",1];
_vec addItemCargo ["G_Tactical_Clear",1];

none of these work, and the goggles are defined in cfgglasses, NOT cfgweapons

if you have goggles on your head you can move them into and out of crates in game, but how to place them without using additem/addweapon?

2. how to re-enable grenade muzzle after respawning (calling removeallweapons on player, which removes weapon "throw" temporarily)

grenades are in cfgweapons as

class Throw: GrenadeLauncher
{
	muzzles[] = {"HandGrenade_Stone","HandGrenadeMuzzle","MiniGrenadeMuzzle","SmokeShellMuzzle","SmokeShellYellowMuzzle","SmokeShellGreenMuzzle","SmokeShellRedMuzzle","SmokeShellPurpleMuzzle","SmokeShellOrangeMuzzle","SmokeShellBlueMuzzle","ChemlightGreenMuzzle","ChemlightRedMuzzle","ChemlightYellowMuzzle","ChemlightBlueMuzzle"};
	class ThrowMuzzle: GrenadeLauncher
etc
	class HandGrenadeMuzzle: ThrowMuzzle
	{
		magazines[] = {"HandGrenade"};
	};
	class MiniGrenadeMuzzle: ThrowMuzzle
	{
		magazines[] = {"MiniGrenade"};
	};
etc

when you remove them and replace them, the grenade selector ctrl-G is disabled and only re-enables if you drop and re acquire a grenade...

I have tried this

EGG_EVO_pallammo = (magazines player);
EGG_EVO_pweapons = (weapons player);
EGG_EVO_pweapons = EGG_EVO_pweapons +["Throw","Put"];

EGG_gmagazines = [["MiniGrenadeMuzzle","MiniGrenade"],["HandGrenadeMuzzle","HandGrenade"],["SmokeShellMuzzle","SmokeShell"],["SmokeShellYellowMuzzle","SmokeShellYellow"],["SmokeShellRedMuzzle","SmokeShellRed"],["SmokeShellGreenMuzzle","SmokeShellGreen"],["SmokeShellPurpleMuzzle","SmokeShellPurple"],["SmokeShellBlueMuzzle","SmokeShellBlue"],["SmokeShellOrangeMuzzle","SmokeShellOrange"],["ChemlightGreenMuzzle","Chemlight_green"],["ChemlightRedMuzzle","Chemlight_red"],["ChemlightYellowMuzzle","Chemlight_yellow"],["ChemlightBlueMuzzle","Chemlight_blue"],["HandGrenade_Stone","HandGrenade_Stone"]];

//A3 grenade fix - doesnt work yet
_i=0;
_c = count (EGG_gmagazines select 0) - 1; 
while {_i <= _c} do 
{
	if ((EGG_gmagazines select 1) select _i in EGG_EVO_pallammo) then 
	{
		player selectWeapon "Throw";
		_muzzles = getArray(configFile>>"cfgWeapons" >> "Throw" >> "muzzles");
		player selectWeapon (_muzzles select 1);
		_i=_c;
	};
	_i=_i+1;
};
//and also
if ("MiniGrenade" in EGG_EVO_pallammo) then {player addWeapon "Throw";player selectWeapon "MiniGrenadeMuzzle"};
if ("HandGrenade" in EGG_EVO_pallammo) then {player addWeapon "Throw";player selectWeapon "HandGrenadeMuzzle"};

//and also
If ({_x iskindof "ThrowMuzzle"} in EGG_EVO_pweapons) then
{
_i=0;
_c = count (EGG_gmagazines select 0) - 1; 
while {_i <= _c} do 
{
	if ((EGG_gmagazines select 1) select _i in EGG_EVO_pallammo) then 
	{
		player addWeapon "Throw";
		player selectWeapon "Throw";
		_muzzles = getArray(configFile>>"cfgWeapons" >> (EGG_gmagazines select 0) select _i >> "muzzles");
		player selectWeapon (_muzzles select 1);
		_i=_c;
	};
	_i=_i+1;
};
};

none of these work!

any ideas?

Edited by eggbeast

Share this post


Link to post
Share on other sites

it works except for the bugs described - and i'm working on those. it should be functional enough for mission makers to use - saves hours of faffing about

Share this post


Link to post
Share on other sites
it works except for the bugs described - and i'm working on those. it should be functional enough for mission makers to use - saves hours of faffing about
Hi egg, thanks for posting this.;-) Edited by Beerkan

Share this post


Link to post
Share on other sites

we had fun with this last night - kept six of us busy for a good few hours... start as an assault group, take back the airfield, then split into frogman team and do the coast to the north east and also send a scout troop to come overland over the hill to the north, and the little town there is crawling with bad guys... lots of house to house fighting...

Share this post


Link to post
Share on other sites

Is there a link to the actual script for these things?

Can we use them on our own missions?

Share this post


Link to post
Share on other sites
Is there a link to the actual script for these things?

Can we use them on our own missions?

open the pbo and the mission/scripts are there laid bare.

use in your mission design as you see fit.

this is a sandbox mission that i'm building for particularly co-op mission makers to use - it will bring in a lot of functions from other coders' work in arma2.

the aim is to speed up arma3 mission design (and to help me build a cleaner, leaner Evolution MP coop mission)

Share this post


Link to post
Share on other sites

Tried to use the loadoutrecorder script in my own mission...

It wont work though, we press save on the flag pole then suicided, and we didn't spawn with what gear we had when we saved. Help?

Share this post


Link to post
Share on other sites

I'm using the save loadout function in a mission i am making, however i need the spawn.sqf to only fire on respawn, not the initial spawn. any ideas on a mp compatible way of doing this?

Share this post


Link to post
Share on other sites

the init sets the pallweapons and pallammo - is this interfering with your plans? rather than the spawn?

weird the spawn is called but not in pinit... looking into it

loadout recorder works fine for me

did you just rip it out of the sandbox? you might want instead to put your mission into it...

Share this post


Link to post
Share on other sites

i'm making a tvt mission, 1 diver sneaking in the dark to blow up some weapon crates vs some defending guys with no nvgs only flashlights

the thing is that i have the loadouts setup in a script i made before (stuff for blufor and opfor), and it resets my gear on the initial spawn, so i either have to have the spawn.sqs run on respawn or find some other way.

i know you made it for coop but if i can make it do that it will suit my needs.

Share this post


Link to post
Share on other sites

I got a very strange problem...

I tried to use your functions in my mission (very much appreciated!), the loadout saves correctly, but for a very strange reason no player except for the host can take clothing from a crate and put it on. Uniforms, vests and backpacks won't work for them. Headgear works though. They can, however, kill the host, take his clothing items and put them on, then save the loadout - this works.

We tried to find the cause for this error for quite a couple of hours. Seeing that the loadout saves correctly and the other players can take the host's clothes, it seems to be a bug from ArmA 3 itself, or maybe I'm just too tired now to find the mistake... Sigh. Will keep trying tomorrow.

Share this post


Link to post
Share on other sites

This is a great idea.

Since i dont know much about scripting something like this makes it possible for me to do a lot more stuff ingame.

Good work, hope i can figure out how to get this all to work :D

Thanks!

Share this post


Link to post
Share on other sites
i'm making a tvt mission, 1 diver sneaking in the dark to blow up some weapon crates vs some defending guys with no nvgs only flashlights

the thing is that i have the loadouts setup in a script i made before (stuff for blufor and opfor), and it resets my gear on the initial spawn, so i either have to have the spawn.sqs run on respawn or find some other way.

i know you made it for coop but if i can make it do that it will suit my needs.

edit the init - EGG_EVO_pallammo and EG_EVO_pallweapons to suit your mission - this defines the starting gear.

It's quite straightforward to also change EGG_EVO_uniform/vest/headgear etc to the diver rig

---------- Post added at 07:21 PM ---------- Previous post was at 07:19 PM ----------

I got a very strange problem...

I tried to use your functions in my mission (very much appreciated!), the loadout saves correctly, but for a very strange reason no player except for the host can take clothing from a crate and put it on. Uniforms, vests and backpacks won't work for them. Headgear works though. They can, however, kill the host, take his clothing items and put them on, then save the loadout - this works.

We tried to find the cause for this error for quite a couple of hours. Seeing that the loadout saves correctly and the other players can take the host's clothes, it seems to be a bug from ArmA 3 itself, or maybe I'm just too tired now to find the mistake... Sigh. Will keep trying tomorrow.

arma can be pretty perplexing at times - hence making this sandbox for new guys etc

Q: are you running a dedi in a server farm or playing on your own pc hosting for buddies?

it runs fine for both for me.

if you took stuff out, maybe you didnt set the global variables like EGG_EVO_uniform in the init.sqf - that might screw your locality

---------- Post added at 07:22 PM ---------- Previous post was at 07:21 PM ----------

i should also say - the Evolution alpha release (this is our normal MP co-op mission) is out and is building rapidly on the sandbox with stuff like mobile respawn HQ's in it

http://forums.bistudio.com/showthread.php?148074-MP-COOP-GITS-EVOLUTION-main-thread

further down the line -

R3F logistics - ability to tow, heli hitch and load items like static weapons into vehicles

radio support options - call in artillery on groups of enemy troops, or call in a pushbike if you're lost in the desert, or a boat if you're miles out in the water

sharks

build a ladder against a wall (Vfarber)

recruit AI teammates

set variable view distances for air unit vs land unit/foot - which automatically changes (eg from 3000 to 8000) when you board/ leave a heli/jet

HALO

gas grenades and gas masks

HE and AP ammo for MG's and big sniper rifles

flashlights on all weapons including MG turrets

attach satchels to passing tanks

throwable combat nife

refuel vehicles with jerrycans

repair at all gas stations

etc etc - all standard stuff in our arma 2 mission - lots of community scripters work in one mission

Edited by eggbeast

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  

×