Forum Jump :

Author Message


Posts: 1
Rank:


Level: Member

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

 
#1 Posted at 2013-03-06 09:31        
     
Hey!
I'm sure a lot of people have some easy question and there should be an general topic where you can ask those, instead of creating new thread for every single question.

So I'll start off, I'm fairly new to the ArmA scripting, so the things I have might be more general than just ArmA 3.

1. How do you properly debug in ArmA?
I found things like textLog from the wiki, but it didn't seem to do anything. How could I for an example, print out an array which i can get with this piece of code: (debug output doesn't have to be in-game, could be a out-game log file or something)
_items = assignedItems unit;

I'm also aware of the debug console the editor has, but I don't really understand how it works and what it does.

2. How do you properly add an attachment to current player primary (or any other) weapon?
I've made it so far, that it adds an suppressor and acro to the inventory, but not to the weapon, how do you do it?

3. Where could I get .pbo and .bin extractors for ArmA 3?
The one I have for ArmA 2 seems to fail with A3's pbos.


Author Message

R3  



Posts: 5
Rank:


Level: Member

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

 
#2 Posted at 2013-03-06 13:34        
     
I just started tinkering with the A3 editor and scripting as well, so more experienced members, please correct me :)

# Doomstepper :1. How do you properly debug in ArmA? I found things like textLog from the wiki, but it didn't seem to do anything. How could I for an example, print out an array which i can get with this piece of code: (debug output doesn't have to be in-game, could be a out-game log file or something)
_items = assignedItems unit;

Not sure if this is the best or easiest way, but one option for outputing data in-game is:
_arr = primaryWeaponItems _this; //get some data which is returned as an array
_dbg = ""; //initialize a variable to hold our debug data
{_dbg = _dbg + "\n" + _x} forEach _arr; //loop the array and add to our debug variable
titleText [_dbg, "PLAIN DOWN"]; //print our debug variable

EDIT: Found a much easier way using the "str" function:
_arr = str weapons _this; //initialize a variable holding an array
titleText [_arr, "PLAIN DOWN"]; //print our debug variable

# Doomstepper :2. How do you properly add an attachment to current player primary (or any other) weapon? I've made it so far, that it adds an suppressor and acro to the inventory, but not to the weapon, how do you do it?

_this addPrimaryWeaponItem "muzzle_snds_H";
_this addHandgunWeaponItem "muzzle_snds_L";
EDIT: For some reason this doesn't seem to be working for me on a secondary weapon though fixed, was using addSecondaryWeaponItem which is actually for the launcher slot

# Doomstepper :3. Where could I get .pbo and .bin extractors for ArmA 3? The one I have for ArmA 2 seems to fail with A3's pbos.

cpbo seemed to work fine (included in these arma tools)

This post was edited by R3 (2013-03-06 19:07, ago)





This topic is locked, new posts are not allowed.

Tags: Arma, Arma 3, Debug, Editor