Morgen,
ich habe momentan ein Problem beim Spawnen ! Version 4.5r1...
conditions = ""; in der Config, funktioniert dadurch nicht !
Meine :
fn_spawnPointCFG.sqf
Spoiler anzeigen
#include "..\..\script_macros.hpp"
/*
File: fn_spawnPointCfg.sqf
Author: Bryan "Tonic" Boardwine
Description:
Master configuration for available spawn points depending on the units side.
Return:
[Spawn Marker,Spawn Name,Image Path]
*/
private ["_side","_return","_spawnCfg","_curConfig","_name","_licenses","_level","_levelName","_levelValue","_levelType","_tempConfig","_flag"];
_side = param [0,civilian,[civilian]];
switch (_side) do {
case west: {_side = "Cop"};
case independent: {_side = "Medic"};
default {_side = "Civilian"};
};
_return = [];
_spawnCfg = missionConfigFile >> "CfgSpawnPoints" >> worldName >> _side;
for "_i" from 0 to count(_spawnCfg)-1 do {
_flag = true;
_tempConfig = [];
_curConfig = (_spawnCfg select _i);
_licenses = getArray(_curConfig >> "licenses");
_level = getArray(_curConfig >> "level");
_levelName = (_level select 0);
_levelType = (_level select 1);
_levelValue = (_level select 2);
{
if (!((_x select 0) isEqualTo "")) then {
_licenseName = (_x select 0);
_licenseType = (_x select 1);
if (_licenseType isEqualTo 0) then {
if (LICENSE_VALUE(_licenseName,(M_CONFIG(getText,"Licenses",_licenseName,"side")))) exitWith {_flag = false};
} else {
if (!(LICENSE_VALUE(_licenseName,(M_CONFIG(getText,"Licenses",_licenseName,"side"))))) exitWith {_flag = false};
};
};
} forEach _licenses;
if (_flag) then {
if (!(_levelValue isEqualTo -1)) then {
_level = missionNamespace getVariable _levelName;
if (_level isEqualType {}) then {_level = FETCH_CONST(_level);};
_flag = switch (_levelType) do {
case "SCALAR": {_level >= _levelValue};
case "BOOL": {_level};
case "EQUAL": {_level isEqualTo _levelValue};
case "INVERSE": {_level <= _levelValue};
default {false};
};
};
};
if (_flag) then {
_tempConfig pushBack getText(_curConfig >> "spawnMarker");
_tempConfig pushBack getText(_curConfig >> "displayName");
_tempConfig pushBack getText(_curConfig >> "icon");
_return pushBack _tempConfig;
};
};
if (playerSide isEqualTo civilian) then {
if (count life_houses > 0) then {
{
_pos = call compile format ["%1",(_x select 0)];
_house = nearestObject [_pos, "House"];
_houseName = getText(configFile >> "CfgVehicles" >> (typeOf _house) >> "displayName");
_return pushBack [format ["house_%1",_house getVariable "uid"],_houseName,"\a3\ui_f\data\map\MapControl\lighthouse_ca.paa"];
} forEach life_houses;
};
};
_return;
Meine Config_Spawnpoints.hpp
Spoiler anzeigen
/*
* Format:
* 3: STRING (Conditions) - Must return boolean :
* String can contain any amount of conditions, aslong as the entire
* string returns a boolean. This allows you to check any levels, licenses etc,
* in any combination. For example:
* "call life_coplevel && license_civ_someLicense"
* This will also let you call any other function.
*
*/
class CfgSpawnPoints {
class Altis {
class Civilian {
class Kavala {
displayName = "Kavala";
spawnMarker = "civ_spawn_kavala";
icon = "\a3\ui_f\data\map\MapControl\watertower_ca.paa";
conditions = "!license_civ_rebel";
};
class Athira {
displayName = "Athira";
spawnMarker = "civ_spawn_athira";
icon = "\a3\ui_f\data\map\MapControl\watertower_ca.paa";
conditions = "license_civ_athira";
};
class Pyrgos {
displayName = "Pyrgos";
spawnMarker = "civ_spawn_pyrgos";
icon = "\a3\ui_f\data\map\MapControl\watertower_ca.paa";
conditions = "license_civ_pyrgos";
};
class Sofia {
displayName = "Sofia";
spawnMarker = "civ_spawn_sofia";
icon = "\a3\ui_f\data\map\MapControl\watertower_ca.paa";
conditions = "license_civ_sfia";
};
class Flughafen {
displayName = "Flughafen";
spawnMarker = "civ_spawn_flughafen";
icon = "\a3\ui_f\data\map\MapControl\watertower_ca.paa";
conditions = "license_civ_flughafen";
};
class Zaros {
displayName = "Zaros";
spawnMarker = "civ_spawn_zaros";
icon = "\a3\ui_f\data\map\MapControl\watertower_ca.paa";
conditions = "license_civ_Zaros";
};
class Neochori {
displayName = "Neochori";
spawnMarker = "civ_spawn_neochori";
icon = "\a3\ui_f\data\map\MapControl\watertower_ca.paa";
conditions = "license_civ_neochori";
};
class Selakano {
displayName = "Selakano";
spawnMarker = "civ_spawn_selakano";
icon = "\a3\ui_f\data\map\MapControl\watertower_ca.paa";
conditions = "license_civ_selakano";
};
class Syrta {
displayName = "Syrta";
spawnMarker = "civ_spawn_syrta";
icon = "\a3\ui_f\data\map\MapControl\watertower_ca.paa";
conditions = "license_civ_syrta";
};
class Agios {
displayName = "Agios";
spawnMarker = "civ_spawn_agios";
icon = "\a3\ui_f\data\map\MapControl\watertower_ca.paa";
conditions = "license_civ_agios";
};
class RebelS {
displayName = "Rebel South";
spawnMarker = "Rebelop_1";
icon = "\a3\ui_f\data\map\MapControl\bunker_ca.paa";
conditions = "license_civ_rebel";
};
};
class Cop {
class Kavala {
displayName = "Kavala HQ";
spawnMarker = "cop_spawn_kavalahq";
icon = "\a3\ui_f\data\map\MapControl\watertower_ca.paa";
conditions = "";
};
class Athira {
displayName = "Athira HQ";
spawnMarker = "cop_spawn_athirahq";
icon = "\a3\ui_f\data\map\MapControl\fuelstation_ca.paa";
conditions = "";
};
class Pyrgos {
displayName = "Pyrgos HQ";
spawnMarker = "cop_spawn_pyrgoshq";
icon = "\a3\ui_f\data\map\GroupIcons\badge_rotate_0_gs.paa";
conditions = "";
};
class Air {
displayName = "AirHQ";
spawnMarker = "cop_spawn_airhq";
icon = "\a3\ui_f\data\map\Markers\NATO\b_air.paa";
conditions = "call life_coplevel >= 2 && {license_cop_cAir}";
};
};
class Medic {
class Kavala {
displayName = "Kavala HQ";
spawnMarker = "medic_spawn_kavala";
icon = "\a3\ui_f\data\map\MapControl\hospital_ca.paa";
conditions = "";
};
class Flugplatz {
displayName = "Flugplatz HQ";
spawnMarker = "medic_spawn_flugplatz";
icon = "\a3\ui_f\data\map\MapControl\hospital_ca.paa";
conditions = "";
};
class Pyrgos {
displayName = "Pyrgos HQ";
spawnMarker = "medic_spawn_pyrgos";
icon = "\a3\ui_f\data\map\MapControl\hospital_ca.paa";
conditions = "";
};
};
};
class Tanoa {
class Civilian {
class Georgetown {
displayName = "Georgetown";
spawnMarker = "civ_spawn_1";
icon = "\a3\ui_f\data\map\MapControl\watertower_ca.paa";
conditions = "!license_civ_rebel";
};
class Balavu {
displayName = "Balavu";
spawnMarker = "civ_spawn_3";
icon = "\a3\ui_f\data\map\MapControl\watertower_ca.paa";
conditions = "";
};
class Tuvanaka {
displayName = "Tuvanaka";
spawnMarker = "civ_spawn_2";
icon = "\a3\ui_f\data\map\MapControl\watertower_ca.paa";
conditions = "";
};
class Lijnhaven {
displayName = "Lijnhaven";
spawnMarker = "civ_spawn_4";
icon = "\a3\ui_f\data\map\MapControl\watertower_ca.paa";
conditions = "";
};
class RebelNW {
displayName = $STR_SP_Reb_NW;
spawnMarker = "Rebelop";
icon = "\a3\ui_f\data\map\MapControl\bunker_ca.paa";
conditions = "license_civ_rebel";
};
class RebelS {
displayName = $STR_SP_Reb_S;
spawnMarker = "Rebelop_1";
icon = "\a3\ui_f\data\map\MapControl\bunker_ca.paa";
conditions = "license_civ_rebel";
};
class RebelNE {
displayName = $STR_SP_Reb_NE;
spawnMarker = "Rebelop_2";
icon = "\a3\ui_f\data\map\MapControl\bunker_ca.paa";
conditions = "license_civ_rebel";
};
};
class Cop {
class NAirport {
displayName = $STR_SP_Cop_Air_N;
spawnMarker = "cop_spawn_1";
icon = "\a3\ui_f\data\map\MapControl\watertower_ca.paa";
conditions = "";
};
class SWAirport {
displayName = $STR_SP_Cop_Air_SW;
spawnMarker = "cop_spawn_3";
icon = "\a3\ui_f\data\map\MapControl\fuelstation_ca.paa";
conditions = "";
};
class GeorgetownHQ {
displayName = "Georgetown HQ";
spawnMarker = "cop_spawn_2";
icon = "\a3\ui_f\data\map\GroupIcons\badge_rotate_0_gs.paa";
conditions = "";
};
class Air {
displayName = $STR_MAR_Police_Air_HQ;
spawnMarker = "cop_spawn_4";
icon = "\a3\ui_f\data\map\Markers\NATO\b_air.paa";
conditions = "call life_coplevel >= 2 && {license_cop_cAir}";
};
class HW {
displayName = $STR_MAR_Highway_Patrol;
spawnMarker = "cop_spawn_5";
icon = "\a3\ui_f\data\map\GroupIcons\badge_rotate_0_gs.paa";
conditions = "call life_coplevel >= 3";
};
};
class Medic {
class SEHospital {
displayName = $STR_SP_EMS_SE;
spawnMarker = "medic_spawn_1";
icon = "\a3\ui_f\data\map\MapControl\hospital_ca.paa";
conditions = "";
};
class TanoukaHospital {
displayName = $STR_SP_EMS_Tan;
spawnMarker = "medic_spawn_2";
icon = "\a3\ui_f\data\map\MapControl\hospital_ca.paa";
conditions = "";
};
class NEAirportHospital {
displayName = $STR_SP_EMS_NEair;
spawnMarker = "medic_spawn_3";
icon = "\a3\ui_f\data\map\MapControl\hospital_ca.paa";
conditions = "";
};
};
};
};