08.01.2010, 14:49 | #1 (permalink) |
Registriert seit: 26.03.2008
Beiträge: 2.822
|
Uniform ändern
Der Titel sagt denk ich alles
Hier das Skript: Code:
/* ================================================================ by Cyborg11 Version: 1.00 @ 07.01.2010 Parameters: nul = [unit, [newunit,side]] execVM "uniformchange.sqf"; _unit = Unitname that change the uniform _newunit = The new unit _side = Side of the new unit Example: nul = [player, ["GUE_Soldier_1",guerr]] execVM "uniformchange.sqf"; Example2: nul = [test, ["FR_GL",west]] execVM "uniformchange.sqf"; The new unit has the same weapons and magazines as the old unit ================================================================= */ // Variables _unit = _this select 0; // old unit _posunit = getPos _unit; //position of the old unit _array = _this select 1; // the new soldier array => ["FR_GL",west] _side = _array select 1; // side of the new unit _newunit = _array select 0; // classname of the new unit _weapons = ((weapons _unit) - (items _unit)); // weapons of the old unit _primweap = primaryWeapon _unit; // primaryWeapon of the old unit _magazines = magazines _unit; // magazines of the old unit _unit setPos [0,0,0]; // teleport the old unit to [0,0,0] titleText ["Changing uniform ...", "BLACK FADED"]; // Black Screen // Create the new unit _uniform = group _unit createUnit [_newunit, _posunit, [], 0, "NONE"]; setPlayable _uniform; sleep 0.5; If (!isnil ("_uniform")) then {selectPlayer _uniform}; // New Unit gets the sames weapons as the old unit removeAllWeapons _uniform; {_uniform addMagazine _x} forEach _magazines; {_uniform addWeapon _x} forEach _weapons; // Select the primaryWeapon _uniform selectWeapon _primweap; // Fix for weapons with grenade launcher _muzzles = getArray(configFile>>"cfgWeapons" >> _primweap >> "muzzles"); _uniform selectWeapon (_muzzles select 0); sleep 0.2; deleteVehicle _unit; // delete old unit sleep 1; titleText [" ", "BLACK IN"]; // delete Black Screen
__________________
|
08.01.2010, 14:56 | #2 (permalink) |
Registriert seit: 12.05.2009
Ort: FRA
Beiträge: 1.621
|
cool werd ich mal testen
__________________
My Youtube Channel "Before you diagnose yourself with depression or low self esteem, first make sure you are not, in fact, just surrounded by assholes!" William Gibson |
08.01.2010, 17:47 | #3 (permalink) |
Registriert seit: 26.03.2008
Beiträge: 2.822
|
Hab mal eine neue Version gemacht
Aufruf ist jetzt ein bisschen anders (addAction), aber man kann jetzt auch wieder die Uniform zurückwechseln. Code:
/* ====================================================================================== by Cyborg11 Version: 1.01 @ 08.01.2010 Parameters: unit addAction ["Change Uniform", "uniformchange.sqf", [newunit,side]]; _unit = unit which gets the action to change the uniform _newunit = classname of the new unit _side = side of the new unit Example: this addAction ["Change uniform", "uniformchange.sqf", ["GUE_Soldier_1",guerr]]; Example 2: player addAction ["Change uniform", "uniformchange.sqf", ["FR_GL",west,true]]; The new unit has the same weapons, magazines and the same name as the old unit ======================================================================================= */ // Variables _unit = _this select 1; // old unit _action = _this select 2; // action id _sideold = side _unit; // side of old unit _type = typeOf _unit; // classname of old unit _posunit = getPos _unit; // position of the old unit _VarName = (vehicleVarName _unit); // Editorname of the old unit _array = _this select 3; // the new soldier array => ["FR_GL",west] _newunit = _array select 0; // classname of the new unit _side = _array select 1; // side of the new unit _weapons = ((weapons _unit) - (items _unit)); // weapons of the old unit _primweap = primaryWeapon _unit; // primaryWeapon of the old unit _magazines = magazines _unit; // magazines of the old unit _unit setPos [0,0,0]; // teleport the old unit to [0,0,0] titleText ["Changing uniform ...", "BLACK FADED"]; // Black Screen _unit removeAction _action; // Create the new unit _uniform = group _unit createUnit [_newunit, _posunit, [], 0, "NONE"]; setPlayable _uniform; sleep 0.5; If (!isnil ("_uniform")) then {selectPlayer _uniform}; // New Unit gets the sames weapons as the old unit removeAllWeapons _uniform; {_uniform addMagazine _x} forEach _magazines; {_uniform addWeapon _x} forEach _weapons; // Select the primaryWeapon _uniform selectWeapon _primweap; // Fix for weapons with grenade launcher _muzzles = getArray(configFile>>"cfgWeapons" >> _primweap >> "muzzles"); _uniform selectWeapon (_muzzles select 0); sleep 0.2; deleteVehicle _unit; // delete old unit sleep 1; titleText [" ", "BLACK IN"]; // delete Black Screen _uniform SetVehicleVarName _VarName; _uniform call Compile Format ["%1=_This ; PublicVariable ""%1""",_VarName]; _uniform addAction ["Change uniform", "uniformchange.sqf", [_type,_side], 0, false, false, ""]; //hint format ["Unit: %1\nType: %2\nPosUnit: %3\nArray: %4\nNewUnit: %5\nSide: %6\nVarNameOld: %7\nVarNameNew: %8",_unit,_type,_posunit,_array,_newunit,_side,_VarName,(vehicleVarName _uniform)];
__________________
Geändert von Cyborg11 (08.01.2010 um 17:52 Uhr). |
08.01.2010, 18:10 | #4 (permalink) |
Registriert seit: 18.12.2009
Beiträge: 240
|
Na, do sog I mercä ^^
Werd ich gleich mal verbasteln. Hm, ich würds so lassen. Man kann es ja je nach Missionskontext entweder dem Spieler oder einem NPC (der wie bei mir auch ein Waffenwechselscript hat) geben.
__________________
Go ahead and shoot! I'll come back! I always come back! ...But dying is such a bitch. — Chucky |
08.01.2010, 21:36 | #5 (permalink) |
Registriert seit: 24.12.2009
Alter: 36
Beiträge: 25
|
nur nochmal zum verständniss..das ganze sieht dann wie aus? xD
im spieler options-menü kann dann die uniform gewählt werden von blufor/opfor usw?..oder läuft das per kiste o.o?
__________________
ArmA 2 Editor?..ok..Bring It On no crosshairs, no respwan, no muppets |
08.01.2010, 22:18 | #6 (permalink) |
Registriert seit: 04.10.2009
Beiträge: 28
|
Das funktioniert als Aktion, das heißt du rollst mit dem Mausrad, dann kannst du Change Uniform auswählen und dann hast du die neue Uniform bzw. eine andere Klasse.
So würde ich das verstehen, denn das was dann abläuft ist eigentlich, dass löschen deiner derzeitigen Spielfigur und danach wird eine neue Einheit an der Position platziert wo du die Aktion ausgeführt hast, die bekommt die selbe Ausrüstung die du vorher hattest und die übernimmst du dann, und damit man diesen Vorgang nicht sieht, wird der Bildschirm kurz schwarz. Korrigiert mich wenn ich falsch liege. |
09.01.2010, 01:39 | #7 (permalink) |
Registriert seit: 26.03.2008
Beiträge: 2.822
|
Ist genau richtig so! Eine Einschränkung gibt es aber beim Benutzen des Skriptes. Alle Skripte/Variablen/Eventhandler, die auf die alte Einheit liefen, werden nach dem Uniformwechsel nicht mehr funktionieren. Ganz einfach, weil die alte Einheit gelöscht wird und man zu einer neuen Einheit wechselt. Es gibt aber auch gar keine andere Möglichkeit die Uniform auf irgendeine andere Art und Weise zu ändern :[
__________________
|
09.01.2010, 15:33 | #8 (permalink) |
Registriert seit: 13.04.2003
Ort: Monerica
Alter: 41
Beiträge: 32.968
|
Code:
this setobjecttexture [0, ""blubb.paa""] Bei den Civi´s klappt es zumindest, die anderen habsch noch nciht probiert. |
09.01.2010, 16:47 | #9 (permalink) |
Registriert seit: 26.03.2008
Beiträge: 2.822
|
Damit änderst du nur Texturen, kein ganzes Modell ^^ Außerdem funzt der Befehl nur bei den Fahrzeugen, Flugzeugen, Helikoptern, Zivilisten und der LHD Crew.
__________________
|
17.02.2010, 22:34 | #11 (permalink) |
Registriert seit: 26.03.2008
Beiträge: 2.822
|
Soooo ... hab da mal mein Skript auf 1.3 gebracht.
Funktioniert jetzt mit ACE. Also Rucksack + Inhalt, sowie die Waffe auf dem Rücken werden auf die neue Spielereinheit übertragen. Falls die alte Spielereinheit ein Leader von einer Gruppe war, dann wird die neue Einheit auch automatisch zum Leader. Wie aber schon oben im Kommentar zu lesen ist ... ihr müsst alle Skripte, die auf die alte Einheit liefen, nochmal erneut auf die neue Einheit anwenden. Code:
/* ============================================================================================== by Cyborg11 Version: 1.03 @ 17.02.2010 Parameters: unit addAction ["Change Uniform", "uniformchange.sqf", [newunit,side,exit,debug]]; _unit = unit which gets the action to change the uniform (Object) _newunit = classname of the new unit (Object) _side = side of the new unit (side) _exit = if the unit can only change his uniform once, then set the variable to true (old -> new -> old) (Boolean) default: false _debug = optional - default: false (Boolean) Example: this addAction ["Change uniform", "uniformchange.sqf", ["GUE_Soldier_1",guerr]]; Example 2: player addAction ["Change uniform", "uniformchange.sqf", ["FR_GL",west,true]]; The new unit has the same weapons, magazines and the same name as the old unit BUT: Because the script deletes the old unit and create a new one you must edit this script and execute all scripts on the new unit again! ============================================================================================== */ private [ "_ace","_unit","_action","_sideold","_type","_posunit","_varname","_array", "_newunit","_side","_exit","_weapons","_items","_primweap","_magazines", "_hasruck","_ruck","_ruckMags","_ruckWeaps","_debug","_weaponback" ]; // Variables _ace = isClass (configFile >> "CfgPatches" >> "ace_version"); // Check if ACE is installed _unit = _this select 1; // old unit _action = _this select 2; // action id _sideold = side _unit; // side of old unit _type = typeOf _unit; // classname of old unit _posunit = getPos _unit; // position of the old unit _varname = vehicleVarName _unit; // Editorname of the old unit _array = _this select 3; // the new soldier array => ["FR_GL",west] _newunit = _array select 0; // classname of the new unit _side = _array select 1; // side of the new unit If (count _array > 2) then {_exit = _array select 2} else {_exit = false}; // if set to true the script will exit If (count _array > 3) then {_debug = _array select 3} else {_debug = false}; _weapons = (weapons _unit) - (items _unit); // weapons of the old unit _items = items _unit; // items of old unit _primweap = primaryWeapon _unit; // primaryWeapon of the old unit _magazines = magazines _unit; // magazines of the old unit If (_exit) then { If (isNil "CYBP_changecounter") then { CYBP_changecounter = 0; }; CYBP_changecounter = CYBP_changecounter + 1; }; If (_ace) then { _hasruck = player call ACE_Sys_Ruck_fnc_hasRuck; If (_hasruck) then { //_ruck = _unit call ACE_Sys_Ruck_fnc_FindRuck; _ruckMags = _unit getVariable "ACE_RuckMagContents"; _ruckWeaps = _unit getVariable "ACE_RuckWepContents"; }; _weaponback = _unit getvariable "ACE_weapononback"; If (_debug) then {player globalchat format ["%1",_weaponback]}; }; titleText ["Changing uniform ...", "BLACK FADED"]; // Black Screen _unit setPos [0,0,0]; // teleport the old unit to [0,0,0] _unit removeAction _action; // Create the new unit _uniform = (group _unit) createUnit [_newunit, _posunit, [], 0, "NONE"]; setPlayable _uniform; sleep 0.5; If (!isnil ("_uniform")) then {selectPlayer _uniform}; If (leader group _unit == leader _unit) then { // Check if old unit is leader (group _unit) selectLeader _uniform; }; // New Unit gets the sames weapons as the old unit removeAllWeapons _uniform; {_uniform addMagazine _x} forEach _magazines; {_uniform addWeapon _x} forEach _weapons; {_uniform addWeapon _x} forEach _items; If (_ace) then { If (_hasruck) then { _uniform setVariable ["ACE_RuckMagContents", _ruckMags, true]; _uniform setVariable ["ACE_RuckWepContents", _ruckWeaps, true]; }; If (_weaponback != "") then { _uniform addWeapon _weaponback; [_uniform, _weaponback] call ACE_fnc_PutWeaponOnBack; }; }; // Select the primaryWeapon _uniform selectWeapon _primweap; // Fix for weapons with grenade launcher _muzzles = getArray(configFile>>"cfgWeapons" >> _primweap >> "muzzles"); _uniform selectWeapon (_muzzles select 0); sleep 0.2; deleteVehicle _unit; // delete old unit sleep 1; titleText [" ", "BLACK IN"]; // delete Black Screen _uniform SetVehicleVarName _varname; _uniform call Compile Format ["%1=_This ; PublicVariable ""%1""",_varname]; If (!isNil ("_exit") && _exit && CYBP_changecounter >= 2) exitWith{}; _uniform addAction ["Change uniform", "uniformchange.sqf", [_type,_side,_exit,_debug], 0, false, false, ""]; If (_debug) then { hint format ["Counter: %9\nUnit: %1\nType: %2\nPosUnit: %3\nArray: %4\nNewUnit: %5\nSide: %6\nVarNameOld: %7\nVarNameNew: %8\nExit: %10",_unit,_type,_posunit,_array,_newunit,_side,_varname,(vehicleVarName _uniform),CYBP_changecounter,_exit] };
__________________
|
18.03.2010, 21:44 | #16 (permalink) |
Duplicate weapon ItemMap detected for USMC_SoldierS_Sniper
Duplicate weapon ItemCompass detected for USMC_SoldierS_Sniper Duplicate weapon ItemWatch detected for USMC_SoldierS_Sniper Duplicate weapon ItemRadio detected for USMC_SoldierS_Sniper Das sind die einzigen Einträge in der RPT Gruß Rettich ..und schon mal Danke im Voraus! |
|
19.03.2010, 09:22 | #17 (permalink) |
Registriert seit: 04.06.2008
Beiträge: 197
|
Moin!
erstmal: sehr coole Idee mit uniformwechsel. hatte das in AmrA schonmal probiert aber dann gesteckt mangels wissen und nerven... Hab v1.3 deines scripts auch schon in einer Mission verbaut, bin aber noch nicht dazugekommen es aufm Dedi zu testen. @ 'Duplicate weapon' meldung Da könnte man noch 'removeallItems' mit rein nehmen, das entfernt kompass, map, gps usw. Die Items laufen als 'weapon' und werden per 'addWeapon' hinzugefügt Code:
_unit addWeapon "ItemWatch"; _unit addWeapon "ItemMap"; _unit addWeapon "ItemCompass"; _unit addWeapon "ItemRadio"; _unit addWeapon "ItemGPS"; Grüße! |
12.09.2010, 11:48 | #20 (permalink) |
Registriert seit: 19.08.2009
Beiträge: 20
|
Uniform wechseln
Hab mir nen Script gebastelt mit dem man die Uniform mit toten Einheiten wechseln kann, im Prinzip auch nen fake Script.
Type kopieren , BLACK OUT, Type neu erstellen/spawnen, Spieler in neue Einheit zwingen, alte Spieler Einheit sterben lassen und Original der "kopierten" Uniform löschen. Hintergrundgedanke dabei war nur die Möglichkeit sich mit der Feind Uniform unter den Gegner zu mischen, im prinzip Undercover. Also mit anderen Worten die eigene Seite soll nicht auf mich schießen und der Feind nur solange bis ich auffliege. Problem für mich ist dabei nur die Seiten Zuweißung. Mit setCaptive müßte man erst wieder ne permanente Abfrage laufen lassen welche die Captivity wieder umkehrt wenn bestimmte Aktionen ausgeführt werden. Zudem wäre es ganz schön, wenn ich keiner Gruppe zugehöre (Einzelkämpfer), und längerer Zeit keinen meiner eigenen Leute über den Weg laufe das diese dann erstmal mistrauisch werden wenn sie nen Feind "meinen" zu sehen. meine Idee wäre eine Abfrage auf die Faction der Uniform und von da eine Rückführung zur Seitenzugehörigkeit die sich dann ändert wenn man sich von seinen eigenen Leuten entfernt, aber wieder aufs Original zurück geht wenn ich mich ihnen wieder nähere. Eine ähnliche Idee wäre auch für Fahrzeuge interessant. (BWSoldat steigt in T72 (ungesehen) und solange er drinn bleibt und oder keine feindliche Aktion durchführt gilt er von außen zB. als EAST angehörig). ??? Grüße an alle, .......to be stoned |
Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1) | |
Themen-Optionen | |
Ansicht | |
|
|
Ähnliche Themen | ||||
Thema | Autor | Forum | Antworten | Letzter Beitrag |
Abzeichen auf der Uniform | THOR83ger | Technische Fragen & Probleme | 2 | 13.12.2009 18:10 |
Individuelle Uniform zusammenstellen? | Hubschraubär | Mods & Addons | 10 | 11.08.2009 02:19 |
Waffenreichweite ändern - how to? | burns | Technische Fragen & Probleme | 1 | 11.09.2008 16:00 |
INF - Uniform & Nähte | burns | Skins, Texturen & Templates | 0 | 30.06.2008 14:17 |
uniform, waffen | creatline15 | Multiplayer Community | 1 | 02.12.2006 10:36 |