HX3 Foren

HX3 Foren (https://hx3.de/)
-   Editing & Scripting (https://hx3.de/editing-scripting-187/)
-   -   Kisten (https://hx3.de/editing-scripting-187/kisten-22340/)

Braindead 11.03.2013 21:32

Kisten
 
Hallo,

Unter welcher Kategorie findet man Kisten mit Uniformen und mit Aufsätzen für Waffen???

Danke im Vorraus Lars:D

Braindead 11.03.2013 21:42

und noch die 2. frage^^ wie füge ich "Missionen" aus dem Editor in den Multiplayer ein?

Marscl 11.03.2013 23:17

Zitat:

Zitat von Braindead (Beitrag 444898)
Hallo,

Unter welcher Kategorie findet man Kisten mit Uniformen und mit Aufsätzen für Waffen???

Danke im Vorraus Lars:D

Dafür gibts keine spezielle Kiste soweit ich weiß.

Folgendes in die Init einer Mun-Kiste schreiben:

Code:

this additemcargo ["Zasleh2",2];
this additemcargo ["muzzle_snds_H", 2]; 
this additemcargo ["muzzle_snds_L", 2]; 
this additemcargo ["muzzle_snds_B", 2]; 
this additemcargo ["muzzle_snds_H_MG", 2]; 
this additemcargo ["optic_Arco", 2]; 
this additemcargo ["optic_Hamr", 2]; 
this additemcargo ["optic_Aco", 2]; 
this additemcargo ["optic_ACO_grn",2]; 
this additemcargo ["optic_Holosight", 2];
this additemcargo ["acc_flashlight", 2]; 
this additemcargo ["acc_pointer_IR", 2];


Zitat:

Zitat von Braindead (Beitrag 444900)
und noch die 2. frage^^ wie füge ich "Missionen" aus dem Editor in den Multiplayer ein?

Mission als Mulitplayermission abspeichern, dann in der Serverliste auswählen.

Tajin 12.03.2013 08:57

Kannst es auch mal hiermit versuchen, da kannst du selber festlegen mit welchen Classnames oder Gegenstandskategorien das Script die Kiste befüllen soll.

PHP-Code:

/*
    Author: Tajin
    File: fillbytype.sqf
    Version: 0.2
    Desc: Fills a box/vehicle with Items of the desired SuperClass
    Syntax: [this,[ #parameters# ] execVM "fillbytype.sqf";
        Replace #parameters# with any of the following:
            Classname only: (this fills in the default number [10] of any type of Pistol)
                "Pistol"
            Classname and amount: (this fills in 5 silenced Rook40 Pistols)
                ["hgun_Rook40_snds_F",5] 
            Classname, amount and Configfile: (this fills in 5 of every type of Backpack)
                ["Bag_Base",5,"CfgVehicles"]
            Multiple selections are also possible:
                ["Pistol",5],["Bag_Base",5,"CfgVehicles"]
        # The script also adds 10 magazines of every available Magazinetype per Weapon #
*/

private ["_cfg","_box","_desired","_inherit","_list","_i","_sel","_arr","_dd","_d","_desire","_dcount","_class","_type","_scope","_object","_mags","_x","_kindof","_icon","_dconfig"];

if(!
isServerexitWith {};
_box _this select 0;
_desired = [];


FNC_kindOf = {
    
_inherit inheritsFrom _this;
    
_list = [configName _this];
    while { (
configName _inherit) != "" } do {
        
_list set[count _list,configName _inherit];    
        
_inherit inheritsFrom_inherit );
    }; 
    
_list
};

switch(
typeName (_this select 1)) do {
    case 
"ARRAY": {
        
_desired _this select 1
        for 
"_i" from 0 to (count _desired)-do {
            
_sel _desired select _i;
            if ( (
typeName _sel) == "STRING" then {
                
_arr = [_sel,10];
                
_desired set[_i,_arr];
            };
        };
        break;
    };
    
    case 
"STRING": {
        
_desired = [[_this select 1,10]];
        break;
    };
};

clearWeaponCargoGlobal _box;
clearMagazineCargoGlobal _box;
clearItemCargoGlobal _box;
clearBackpackCargoGlobal _box;

diag_log format["Starting: %1"_desired];
for 
"_d" from 0 to (count _desired)-do {
    
_dd _desired select _d;
    
_desire _dd select 0;
    
_dcount _dd select 1;
    if (
count _dd 2then {
        
_dconfig _dd select 2
    } else {
        
_dconfig "CfgWeapons"
    };
    
    
_cfg configFile >> _dconfig;    
    
    for 
"_i" from 0 to (count _cfg)-do {
        
_class _cfg select _i;
        if (
isClass _classthen {
            
_type getNumber(_class >> "type");
            
_scope getNumber(_class >> "scope");
            
_icon getText(_class >> "picture");
            if(
_scope == && _type != 65536 && _icon != "\A3\Weapons_F\Data\clear_empty.paa"then {
                
_kindof _class call FNC_kindOf;
                if ( 
_desire in _kindof then {
                    
_object configName _class;
                    
                    switch (
true) do {
                        case (
"Bag_Base" in _kindof): {
                            
_box addBackpackCargo [_object_dcount];
                        };
                        case (
"ItemCore" in _kindof): {
                            
_box addItemCargoGlobal [_object_dcount];
                        };
                        default {
                            
_box addWeaponCargoGlobal [_object_dcount];
                        };
                    };
                    
                    
diag_log format["%1 added (%2)"_object_icon];
                    
                    
_mags getArray(_class >> "magazines");
                    {
                        
_box addMagazineCargoGlobal [_x,_dcount 10];
                        
diag_log format["Magazines %1 added"_x];
                    } forEach 
_mags;
                };
            };
        };
    };
};
diag_log "finished"


Für Uniformen (5 von jeder Sorte) wäre das z.b:
[this,[ ["Uniform_Base",5] ] execVM "fillbytype.sqf";

( Classnames und deren Hierarchie findest du hier: http://browser.six-projects.net/cfg_...67&commit=Save )

Braindead 12.03.2013 08:57

Danke :daumen:

Braindead 12.03.2013 09:13

Danke :daumen: aber wenn ich das eingeben steht da: type Array expected nothing

Tajin 12.03.2013 09:30

Zitat:

Zitat von Braindead (Beitrag 444959)
Danke :daumen: aber wenn ich das eingeben steht da: type Array expected nothing

Dann probiers mal so:
PHP-Code:

nul = [this,[ ["Uniform_Base",5] ] execVM "fillbytype.sqf"


Braindead 12.03.2013 09:41

ma was neues: fillbytype.sqf not found

Tajin 12.03.2013 10:35

Naja klar, du musst die Scriptdatei mit dem Inhalt oben natürlich auch erstmal erstellen und in deinem Missionsordner ablegen. Sonst klappt das nicht. :D

JoeJoe87577 12.03.2013 10:47

Dieses Script hier füllt die gewünschte Kiste mit allem auf was im Spiel ist.
[ALPHA] ARMA 3 Crate Filler - Scripts - Armaholic
Und auch noch mit allem was reinkommt :D


Alle Zeitangaben in WEZ +1. Es ist jetzt 15:39 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