Forum Jump :

Author Message

R3  



Posts: 5
Rank:


Level: Member

Country: ee
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2013-03-06 19:14        
     
Hi,

While tackling a typo in my player initialization code I needed a way to easily output all the gear the player is wearing/using. Came up with this simple script:

File source: debugGear.sqf
/*
	@file Version: v0.1
	@file name: debugGear.sqf
	@file Author: R3
	@file edit: 3/6/2013
	@file Description: Print debug info of player gear through action menu item
	@usage: Put in init field of some object: this addAction ["DEBUG GEAR INFO", "debugGear.sqf"];
*/

_obj = _this select 0; //the object that had the action
_caller = _this select 1; //unit that called the action
_id = _this select 2; //id of the action

_outp = "HEADGEAR  =  " + (headgear _caller)
	+ "\n\nGOGGLES  =  " + (goggles _caller)
	+ "\n\nPRIM. WEAPON  =  " + (primaryWeapon _caller) + "  =  " + (str primaryWeaponItems _caller)
	+ "\n\nSEC. WEAPON  =  " + (secondaryWeapon _caller) + "  =  " + (str secondaryWeaponItems _caller)
	+ "\n\nHANDGUN  =  " + (handgunWeapon _caller) + "  =  " + (str handgunItems _caller)
	+ "\n\nASSIGNED ITEMS  =  " + (str assignedItems _caller)
	+ "\n\nUNIFORM  =  " + (uniform _caller) + "  =  " + (str uniformItems _caller)
	+ "\n\nVEST  =  " + (vest _caller) + "  =  " + (str vestItems _caller)
	+ "\n\nBACKPACK  =  " + (backpack _caller) + "  =  " + (str backpackItems _caller);
	//+ "\n\nALL WEAPONS  =  " + (str weapons _caller)
	//+ "\n\nALL MAGAZINES  =  " + (str magazines _caller);

titleText [_outp, "BLACK IN", 30]; //print our info

Usage: Add the following into the "initialization" field of any object
this addAction ["DEBUG GEAR INFO", "debugGear.sqf"];
Then player just needs to use the action menu on that object by selecting "DEBUG GEAR INFO"

I added it to a ammo container I was using to test out some gear items. But it should work on any object..

Output should look similar to this:

This post was edited by R3 (2013-03-09 20:33, ago)


Author Message


Posts: 15
Rank:


Level: Member

Country: ca
Location:
Occupation:
Age:
In-game name:

 
#2 Posted at 2013-03-06 20:24        
     
Excellent, that will really help to narrow down class names quickly.

Wish I had this 10 hours ago when I was searching for the NVGs :)


Advertisement


Author Message


Posts: 20279
Rank:


Level: Super Admin

Country: nl
Location: The Netherlands
Occupation:
Age: 41
In-game name: Foxhound

 
#3 Posted at 2013-03-08 22:41        
     
Nice script and thanks for posting it here :-)
(I will add this also to our soon to emerge newbie FAQ.

I made some news about it and you can find our mirror here:


Visit my family webshop desteigerhoutshop.nl.





Tags: Debug, Output, Script