HX3 Foren

HX3 Foren (https://hx3.de/)
-   Editing (https://hx3.de/editing-139/)
-   -   Per Skript erstellten Ka50 andere bewaffnung zuteilen (https://hx3.de/editing-139/per-skript-erstellten-ka50-andere-bewaffnung-zuteilen-16184/)

Hannibal 16.05.2009 08:24

Per Skript erstellten Ka50 andere bewaffnung zuteilen
 
Hallo,

wie der Titel schon sagt möchte einem per Skript erstellten Ka50 eine andere Bewaffnung zuteilen.

Hier das Skript wo der Ka50 erstellt wird:

Code:

if (not (local server)) exitwith {};
rscripts=rscripts+1;
for [{_loop=0}, {_loop<1}, {_loop=_loop}] do
{
        _starts = [ka1,ka2,ka3,ka4];
        _poscreate = position (_starts select (round random 3));

        _pilot = createGroup (east);
        "SoldierEPilot" createUnit [_poscreate, _pilot];
        _recy = [_pilot,"none",objNull] spawn {[_this select 0,_this select 1,_this select 2] call EVO_gRecy};
        //if(isNull (units _pilot select 0)) exitWith {};
        _heli = createVehicle ["KA50", _poscreate, [], 5000, "FLY"];
        _heli setpos [getpos _heli select 0, getpos _heli select 1, 500];
        _heli setdir (random 359);
        _heli engineon true;

        //"MarianQuandt" createUnit [position tpos1, _pilot];
        (units _pilot select 0) assignAsDriver _heli;
        (units _pilot select 0) moveInDriver _heli;
        //(units _pilot select 0) setBehaviour "AWARE";
        _pilot setCombatMode "RED";

        _handle = [_pilot] execVM "scripts\flightpath.sqf";
        {_x addEventHandler ["killed", {handle = [_this select 0] execVM "scripts\bury.sqf"}]} forEach (units _pilot);
        _heli addEventHandler ["killed", {handle = [_this select 0] execVM "scripts\bury.sqf"}];

        sleep 1.0;
        waitUntil {not (alive _heli) or isNull (driver _heli)};
        sleep 1.0;
        if (alive _heli) then {_heli setdammage 1;};
        if (alive (units _pilot select 0)) then {(units _pilot select 0) setdammage 1};
        sleep 600.0;
};

Habe es so versucht
Code:

if(typeof _heli == "KA50") then {_heli removeWeapon "VikhrLauncher"; _heli removeMagazine "12Rnd_Vikhr_KA50"; _heli addWeapon "Ch29Launcher"; _heli addMagazine "4Rnd_Ch29"; _heli addMagazine "4Rnd_Ch29"; };
aber leider hat es so nicht geklappt

Vienna 16.05.2009 11:29

Du musst das über die "Initialisierungszeile" änderen.

Code:

_init = "this removeWeapon 'VikhrLauncher'; this removeMagazine '12Rnd_Vikhr_KA50'; this addMagazine '4Rnd_Ch29'; this addMagazine '4Rnd_Ch29'; this addWeapon 'Ch29Launcher'";

_heli = createVehicle ["KA50", _poscreate, [], 5000, "FLY"];
_heli setVehicleInit _init;
processInitCommands;

Beachte die unterschiedlichen Anführungszeichen. Die neuen Magazine vor den neuen Waffen anführen.

Bei manchen Units lassen sich die Waffen aber nicht auf alle Waffentypen ändern.

Ob hier die Bewaffnung überhaupt richtig gewählt wurden, habe ich nicht überprüft.


Alle Zeitangaben in WEZ +1. Es ist jetzt 11:38 Uhr.

Angetrieben durch vBulletin, Entwicklung von Philipp Dörner & Tobias


SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119