Jump to content

Recommended Posts

Hi all.

I want to add a suitcase to a civil in my file config.cpp, for when placed on the map have the suitcase in hand

I've tried adding it to:

class C_man_hunter_1_F;
	class malo_3 : C_man_hunter_1_F {
		_generalMacro = "C_man_hunter_1_F";
		scope = 2;
		side = 0;
		faction = "Enemigos_Esp";
		vehicleClass = "Enemigos_units";
		identityTypes[] = {"Language_EN_EP1", "Head_NATO"};
		faceType = "Man_A3";
		genericNames = "NATOMen";
		displayName = "Político Corrupto";
		author = "Brigada_Esp";
		camouflage = 2.0;
		sensitivity = 1.0;
		nakedUniform = "U_C_HunterBody_brn";
		uniformClass = "Enemigo_politico_ropa";
		hiddenSelections[] = {"camo"};
		hiddenSelectionsTextures[] = {"mi_mod\data\politico_ropa.paa"};
		backpack = "";
		weapons[] = {"hgun_rook40_f"};
		respawnweapons[] = {"hgun_rook40_f"};
		magazines[] = {"16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag" "16Rnd_9x21_Mag", "16Rnd_9x21_Mag"};
		respawnmagazines[] = {"16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag", "16Rnd_9x21_Mag"};
		linkeditems[] = {"ItemMap", "ItemWatch", "[color="#FF0000"]Land_Suitcase_F[/color]"};
		respawnLinkedItems[] = {"ItemMap", "ItemWatch", "[color="#FF0000"]Land_Suitcase_F[/color]"};
	};

But it does not work, can anyone help me?

Greetings.-

Share this post


Link to post
Share on other sites

the object Land_Suitcase_F is a item in the game, its not animated nor have any scripts you've made to attach to his hand. So its naturally going to have issues, as well as items wouldn't hold it. those are for the Radio, Map, Watch, GPS, ect.

Share this post


Link to post
Share on other sites

ok thanks for answering AtinAkiri.

Now I realized that the suitcase is not an item.

And there is no way of placing the suitcase in hand of corrupt politician, to add to a mod?

Share this post


Link to post
Share on other sites
ok thanks for answering AtinAkiri.

Now I realized that the suitcase is not an item.

And there is no way of placing the suitcase in hand of corrupt politician, to add to a mod?

If you make your own suitcase you can animate it and such, otherwise its likely to involve a lot of scripting.

Share this post


Link to post
Share on other sites

Not too much scripting if you wish to try (in init line for unit):

_scase = "Land_Suitcase_F" createVehicle position this;

_scase attachTo [this, [-0.03,-.1,-0.26], "RightHandMiddle1"];

Not sure if memory points (e.g. RightHandleMiddle1) are same as A2, worth a try.

Share this post


Link to post
Share on other sites

Thanks Shizweak, that is the solution. But have to turn the suitcase 90 degrees, which is solved by adding: _maletin setVectorDirAndUp [[1,0,0],[0,0,1]];

And looks like this:

_maletin = "Land_Suitcase_F" createvehicle getpos _car;
_maletin attachTo [_car, [-0.03,-.1,-0.26], "RightHandMiddle1"];
_maletin setVectorDirAndUp [[1,0,0],[0,0,1]];

The suitcase is attached, and moves with the movement of the hand.

Now I want to paint black suitcase, I tested with: _maletin setobjecttexture [0,"mi_mod\data\negro.paa"]; but does not work, any suggestion?

EDIT:

In multiplayer mode you are not very stable.

The information I got from here https://community.bistudio.com/wiki/setVectorDirAndUp I do not understand this:

In Multiplayer, setVectorDirAndUp must be executed on the machine where the object it applied to is local.

Can anyone explain me, with an example?

Edited by Brigada_Spanish

Share this post


Link to post
Share on other sites

Now I want to paint black suitcase, I tested with: _maletin setobjecttexture [0,"mi_mod\data\negro.paa"]; but does not work, any suggestion?

Try insert leading backslash on texture path (of course confirm texture path exists), e.g.

_maletin setObjectTexture [0,"\mi_mod\data\negro.paa"];

Also note you can use RGBA, so if you want black:

_maletin setObjectTexture [0,'#(argb,8,8,3)color(0,0,0,1)']

You could even adjust the last number (1), to a little lower, e.g. 0.9 so it's not completely black, but almost black.

This command also has local effect only, so you must execute it on all machines

EDIT:

In multiplayer mode you are not very stable.

The information I got from here https://community.bistudio.com/wiki/setVectorDirAndUp I do not understand this:

Can anyone explain me, with an example?

KillzoneKid has a great tutorial here explaining locality:

http://killzonekid.com/arma-scripting-tutorials-locality/

Essentially, if you create an object on server, it is local to server, if you create an object on client, it is local to client. Locality can change, e.g. a vehicle, if you create a vehicle on server, then player enters vehicle, locality is changed to player's client.

One trick you can try is setPos (should broadcast to all clients, and keep the vector/dir changes), e.g. after using setVectorDirAndUp

_maletin setPos (getPos _maletin);

Share this post


Link to post
Share on other sites

I have tried to add color to the suitcase that way and no way to change the color, is not a thing that is very important, but it is curious.

So I did it another way, in config.cpp added this code:

class cfgVehicles {
class Static;

class Suitcase: Static {
	scope = 2;
	model = "\A3\Structures_F\Items\Luggage\Suitcase_F";
	displayName = "Suitcase";
	hiddenSelections[] = {"camo"};
	hiddenSelectionsTextures[] = {"mi_mod\data\negro.paa"};	
};

        class C_man_hunter_1_F;
	class malo_3 : C_man_hunter_1_F {
		_generalMacro = "C_man_hunter_1_F";
		scope = 2;
		side = 0;
		faction = "Enemigos_Esp";
		vehicleClass = "Enemigos_units";
		identityTypes[] = {"Language_EN_EP1", "Head_NATO"};
		faceType = "Man_A3";
		genericNames = "NATOMen";
		displayName = "Político Corrupto";
		author = "Brigada_Esp";
		camouflage = 2.0;
		sensitivity = 1.0;
		nakedUniform = "U_C_HunterBody_brn";
		uniformClass = "Enemigo_politico_ropa";
		hiddenSelections[] = {"camo"};
		hiddenSelectionsTextures[] = {"mi_mod\data\politico_ropa.paa"};
		backpack = "";
		weapons[] = {};
		respawnweapons[] = {};
		magazines[] = {};
		respawnmagazines[] = {};
		linkeditems[] = {"ItemMap", "ItemWatch", "G_Squares_Tinted"};
		respawnLinkedItems[] = {"ItemMap", "ItemWatch", "G_Squares_Tinted"};
                       class EventHandlers {init = "malet = [_this select 0] execVM ""\mi_mod\script\maletin.sqf""";};
	};
};

maletin.sqf

private ["_car","_maletin"];
_car =_this select 0; 

_maletin = "Suitcase" createvehicle getpos _car;
_maletin attachTo [_car, [-0.03,-.1,-0.26], "RightHandMiddle1"];
_maletin setVectorDirAndUp [[1,0,0],[0,0,1]];
_maletin setObjectTexture [0,"mi_mod\data\negro.paa"];

Not operating properly for the color change of the suitcase.

Can someone review the code, and find the error?

Edited by Brigada_Spanish

Share this post


Link to post
Share on other sites

One question, does anyone know if the suitcase can be applied other color of texture?

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

×