Mr H.
Member-
Content Count
597 -
Joined
-
Last visited
-
Medals
Everything posted by Mr H.
-
Sorting an array of objects by name
Mr H. replied to Tova's topic in ARMA 3 - MISSION EDITING & SCRIPTING
_sorted= [_yourArray, [], {(str _x splitString "_")select 1}, "ASCEND"] call BIS_fnc_sortBy; try this (untested -
(SOLVED) class CfgGlasses: how can I make more textures for the same model?
Mr H. replied to TCGM's topic in ARMA 3 - ADDONS - CONFIGS & SCRIPTING
you can do it in both, in blender its the vertex groups, go to object edit mode and select the whole mesh, got to the vertex groups tab and create a new vertex group called camo (google it if you don't know how too),if you use the blender to p3d export tool it will export your vertex groups as selections. OR In object builder, select your whole LOD and create a new selection that you name camo (same, google it if you don't know how). This has too be done on every resolution lod if you have several.- 8 replies
-
- 3
-
- hiddenselections
- textures
- (and 6 more)
-
(SOLVED) class CfgGlasses: how can I make more textures for the same model?
Mr H. replied to TCGM's topic in ARMA 3 - ADDONS - CONFIGS & SCRIPTING
Does your model itself have a camo selection? Should be the entire model- 8 replies
-
- 1
-
- hiddenselections
- textures
- (and 6 more)
-
scrtach that it's not just the last loadout, i'm gussing it's the joinstring with the results of getUnitLoadOut... scratch that again! It's the ace function if I just take the generated loadout and use setUnitLoadOut it works fine. Again, I was a stupid fool and used it on an arsenal with no items. This updated version will also provide you with a list of items to allow and some help: _allLoadOuts =["[",endl,endl]; _arsenalItemsArray = []; //---generates the objects for the arsenalVariable (Borrowed from ace 3 doc) private _items = allUnits apply {getUnitLoadout _x}; _items = str _items splitString "[]," joinString ","; _items = parseSimpleArray ("[" + _items + "]"); _items = _items arrayIntersect _items select {_x isEqualType "" && {_x != ""}}; { private _toString =[endl,endl,"//-----",str _x,"-----//",endl,"[","""",str _x,"""",",",getUnitLoadOut _x,"]"]; _toString append ([[",",endl,endl],[endl,endl]] select (_forEachIndex isEqualTo ((count allUnits)-1))); _allLoadOuts append _toSTring; }forEach allunits; _allLoadOuts pushBackUnique "];"; _info1 = "/*"; _info2 = "//-----NOTE-------//"; _info3 = "If you want to create an arsenal that contains only items from the above loadouts paste the following code in its init:"; _info4 ="this spawn {waitUntil{!isNil 'ACE_ArsenalAllowedItems'};[_this,ACE_ArsenalAllowedItems,true] call ace_arsenal_fnc_initBox};"; _info5 ="*/"; _script = ["//-----------Load Outs-----------//",endl,endl,"_allLoadOuts = "]; _footer = [endl,endl,"//----------LoadOuts End----------//",endl,endl,"//-------add loadouts to ace default------",endl,"{[_x select 0,_x select 1] call ace_arsenal_fnc_addDefaultLoadout}forEach _allLoadOuts;",endl,endl,"ACE_ArsenalAllowedItems =",_items,";",endl,endl,_info1,endl,_info2,endl,_info3,endl,_info4,endl,_info5]; _script append _allLoadOuts; _script append _footer; copyToClipboard (_script joinstring ""); hint "export complete, paste results to file"; it gives an oupout file that looks like this (comments are included in the outpout):
-
Now @Cockheaven since I was interested in the subject I went ahead and made a version that makes a more elaborate, sexier and more readable output file that you can copy paste directly to your init and still make sense of: _allLoadOuts =["[",endl,endl]; { private _toString =[endl,endl,"//-----",str _x,"-----//",endl,"[","""",str _x,"""",",",getUnitLoadOut _x,"]"]; _toString append ([[",",endl,endl],[endl,endl]] select (_forEachIndex isEqualTo ((count allUnits)-1))); _allLoadOuts append _toSTring; }forEach allunits; _allLoadOuts pushBackUnique "];"; _script = ["//-----------Load Outs-----------//",endl,endl,"_allLoadOuts = "]; _footer = [endl,endl,"//----------LoadOuts End----------//",endl,endl,"//-------add loadouts to ace default------",endl,"{[_x select 0,_x select 1] call ace_arsenal_fnc_addDefaultLoadout}forEach _allLoadOuts;"]; _script append _allLoadOuts; _script append _footer; copyToClipboard (_script joinstring ""); It will yield an ouput file that looks like this: Only trouble is: it works fine but the very last loadout is always fucked up and missing its uniform backpack and vest. I've done a few test it works fine otherwise but I've been unable to figure out why this final loadout is fucked up, maybe somebody here can....
-
You don't need the p3d just the textures to texture. See with 3cb if they allow that. You'll have to go the addons way so I suggest you move this thread to the addons and config scripting section of this forum.
-
I can not get my kill-feed script to execute properly. No errors displayed.
Mr H. replied to Neonz27's topic in ARMA 3 - MISSION EDITING & SCRIPTING
@Neonz27 you're not there yet: the cba killed event will only fire where unit is local. In the version you have posted the event is only set on the server. That will work with editor placed AIs but not for players or units in groups of players or vehicles driven by players. I suggest you run it from init on all machines. Just to be on the safe side you can add if !(local _killer) exitWith {}; see https://github.com/CBATeam/CBA_A3/wiki/Adding-Event-Handlers-to-Classes-of-Objects -
ALIVE mod dynamic AI spawner how do i put scripts on spawned ai???
Mr H. replied to Astrild's topic in ARMA 3 - ADDONS - CONFIGS & SCRIPTING
so @Astrild try this instead class Extended_Init_EventHandlers { class CAManBase { class My_Soldier_init_eh { init = "if !(isplayer _this) then {[_this] call HG_fnc_aiUnitSetup}"; }; }; }; Dedmen is right, this while loop is horrible! -
ALIVE mod dynamic AI spawner how do i put scripts on spawned ai???
Mr H. replied to Astrild's topic in ARMA 3 - ADDONS - CONFIGS & SCRIPTING
jup BTW @Dedmen what does "jup" mean? -
no no no! I'd suggest making all your loadouts in a virtual mission, give all the units a variable name that fits the loadout they have eg. squadLeaderDeltaforce Then run this script: _allLoadOuts =[]; { _allLoadOuts pushbackunique [str _x,getUnitLoadOut _x] }forEach allunits; _script = ["_allLoadOuts = ",_allLoadOuts,";",endl,"{[_x select 0,_x select 1] call ace_arsenal_fnc_addDefaultLoadout}forEach _allLoadOuts;"] joinString ""; copyToClipboard _script copy the clipboard contents to a script that you will call in your missions' init.sqf and can share to your mission makers. Don't forget that the "allow default loadouts" setting in your ACE settings. I've just tested it and it works
-
ALIVE mod dynamic AI spawner how do i put scripts on spawned ai???
Mr H. replied to Astrild's topic in ARMA 3 - ADDONS - CONFIGS & SCRIPTING
Yeah copy paste error sorry. -
ALIVE mod dynamic AI spawner how do i put scripts on spawned ai???
Mr H. replied to Astrild's topic in ARMA 3 - ADDONS - CONFIGS & SCRIPTING
class Extended_Init_EventHandlers { class CAManBase { class My_Soldier_init_eh { init = "[_this] call HG_fnc_aiUnitSetup;}"; }; }; }; Try to put this in your description.ext (untested) -
ALIVE mod dynamic AI spawner how do i put scripts on spawned ai???
Mr H. replied to Astrild's topic in ARMA 3 - ADDONS - CONFIGS & SCRIPTING
It is possible, since arma requires cba 3 you can use cba s custom events to spawn scripts when the unit is created. But I'm not familiar with the kill reward script you ask for so I can't give you a more specific answer. -
4.2 Adding default loadouts via script Since 3.13.0, you can also add default loadouts with the ace_arsenal_fnc_addDefaultLoadout function. * 0: Name of loadout <STRING> * 1: getUnitLoadout array <ARRAY> Example: ["Squad Leader", getUnitLoadout sql1] call ace_arsenal_fnc_addDefaultLoadout If a loadout with the same name exists, it will be overwritten so you can store all your loadouts in a sqf https://ace3mod.com/wiki/framework/arsenal-framework.html
-
At first glance I don't see anything wrong with this. Maybe add diag logs and check your logs
-
Try to add it to iniplayerlocal.sqf instead and also waitUntil {!isNull (findDisplay 12)};
-
where do you call the script from ?
-
More load capacity in vehicle
Mr H. replied to Coladebote's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I think if you add stuff to vehicle cargo by script the actual cargo side doesn't matter. However you can't expand actual cargo size short of modding the vehicle (but it's easy to do then). -
I have the following config for a custom module. The module works fine and all but for the life of me I can't get the description to show when I double click on it in the editor. I have read again and again the (I think) quite cryptic doc. And simply can't figure it out
-
Getting module description to show
Mr H. replied to Mr H.'s topic in ARMA 3 - ADDONS - CONFIGS & SCRIPTING
Answering my own question: this seems to be the proper way. I still have doubts however about the sync/synced entities. The function does get anything the module it's synced too but I'd like to understand the sync things better. -
I can not get my kill-feed script to execute properly. No errors displayed.
Mr H. replied to Neonz27's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Also if you're using cba you can get rid of that ugly while loop and use ["CAManBase", "killed", { params ["_unit", ["_killer", objNull]]; }] call CBA_fnc_addClassEventHandler; in your init.sqf The event will only fire where the unit is local but you can remote exec the message. something like: ["CAManBase", "killed", { params ["_unit", ["_killer", objNull]]; [[_unit,_killer],{params ["_unit","_killer"]; systemChat format ["%1 was killed by %2",name _unit,name _killer];}] remoteExec ["Call",0]; }] call CBA_fnc_addClassEventHandler; Or more elaborate and using what I said above: ["CAManBase", "killed", { params ["_unit", ["_killer", objNull]]; //if !(isPlayer _unit) exitWith {}; uncomment if you only want this to fire for players _killer = _unit getVariable ["ace_medical_lastDamageSource", objNull]; [[_unit,_killer],{ params ["_unit","_killer"]; _message = format ["%1 was killed by %2 with %3",name _unit,name _killer, (getText (configfile>>"cfgWeapons">>(currentWeapon _killer)>>"displayName"))]; if (_killer isEqualTo _unit) then {_message = format ["%1 bled out and died, poor bastard",_unit]}; systemChat _message; }] remoteExec ["Call",0]; }] call CBA_fnc_addClassEventHandler; -
I can not get my kill-feed script to execute properly. No errors displayed.
Mr H. replied to Neonz27's topic in ARMA 3 - MISSION EDITING & SCRIPTING
ACE 3 rewrites the handlers, you have to use CBA events instead of arma event handlers. Scratch that _unit getVariable ["ace_medical_lastDamageSource", objNull]; // will return the killer, if killer is victim it means the victim bled out. See here: https://github.com/acemod/ACE3/issues/3790 -
Exorcise the object (or whatever it is)
Mr H. replied to wogz187's topic in ARMA 3 - MISSION EDITING & SCRIPTING
do you have any mod activated? Sometimes mod makers (I know I do) don't have time/will/ability to model their own stuff so they point to a bis p3d. DLC dependency is built in the p3d but the object as defined in config won't be listed as dependent from a dlc. Don't know if it would get you this message though.- 10 replies
-
- 1
-
Exorcise the object (or whatever it is)
Mr H. replied to wogz187's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I thought objects didn't add a dependency to dlcs. Anyone not owning LAW should be able to play your mission regardless correct? Also check in mission attributes there's a require dlc somewhere in there you might have selected it by mistake- 10 replies
-
How to make removing weapon trigger ?
Mr H. replied to ALPHIVE's topic in ARMA 3 - MISSION EDITING & SCRIPTING
This will only work for independents so just to be sure: you're not testing with a blufor soldier are you ?