Moin,
da mal wieder die Frage aufgetaucht ist wie man einzelne Spawnpunkte in der Höhe verschieben kann, hier mal ein kleines Tutorial dazu. Wie immer gilt ihr dürft das gern verwenden, allerdings untersage ich die Verbreitung auf anderen Plattformen ohne meine Zustimmung .
Dann wollen wir mal anfangen.
1. Config_SpawnPoints.hpp
Ich habe es so gelöst dass ihr wirklich nur die Spawnpunkte bearbeiten müsst, die ihr in der Höhe verschieben wollt. In der angehängten Config habe ich mal den Cop Spawn in Kavala einfach mal auf 5 Meter gesetzt.
class Kavala {
displayName = "Kavala HQ";
spawnMarker = "cop_spawn_1";
icon = "\a3\ui_f\data\map\MapControl\watertower_ca.paa";
conditions = "";
spawnheight=5;
};
2. fn_spawnPointCfg.sqf
Hier müsst ihr unter dem Eintrag
das folgende noch einfügen
if (!isNull (_curConfig >> "spawnheight")) then {
_tempConfig pushBack getNumber(_curConfig >> "spawnheight");
} else {
_tempConfig pushBack 0;
};
Die fertige Datei sieht dann so aus
#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]
*/
params [["_side",civilian,[civilian]]];
_side = switch (_side) do {
case west: {"Cop"};
case independent: {"Medic"};
default {"Civilian"};
};
private _return = [];
private _spawnCfg = missionConfigFile >> "CfgSpawnPoints" >> worldName >> _side;
for "_i" from 0 to count(_spawnCfg)-1 do {
private _tempConfig = [];
private _curConfig = (_spawnCfg select _i);
private _conditions = getText(_curConfig >> "conditions");
private _flag = [_conditions] call life_fnc_levelCheck;
if (_flag) then {
_tempConfig pushBack getText(_curConfig >> "spawnMarker");
_tempConfig pushBack getText(_curConfig >> "displayName");
_tempConfig pushBack getText(_curConfig >> "icon");
if (!isNull (_curConfig >> "spawnheight")) then {
_tempConfig pushBack getNumber(_curConfig >> "spawnheight");
} else {
_tempConfig pushBack 0;
};
_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"];
true
} count life_houses;
};
};
_return;
Alles anzeigen
3. fn_spawnConfirm.sqf
Hier am besten den Inhalt mit dem folgendem ersetzen.
/*
File: fn_spawnConfirm.sqf
Author: Bryan "Tonic" Boardwine
Description:
Spawns the player where he selected.
*/
private ["_spCfg","_sp","_spawnPos"];
closeDialog 0;
cutText ["","BLACK IN"];
if (life_spawn_point isEqualTo []) then {
private ["_sp","_spCfg"];
_spCfg = [playerSide] call life_fnc_spawnPointCfg;
_sp = _spCfg select 0;
if (playerSide isEqualTo civilian) then {
if (isNil {(call compile format ["%1",_sp select 0])}) then {
player setPos [(getMarkerPos (_sp select 0) select 0),(getMarkerPos (_sp select 0) select 1), _sp select 3];
} else {
_spawnPos = (call compile format ["%1",_sp select 0]) call BIS_fnc_selectRandom;
_spawnPos = _spawnPos buildingPos 0;
player setPos _spawnPos;
};
} else {
player setPos (getMarkerPos (_sp select 0));
};
titleText[format ["%2 %1",_sp select 1,localize "STR_Spawn_Spawned"],"BLACK IN"];
} else {
if (playerSide isEqualTo civilian) then {
if (isNil {(call compile format ["%1",life_spawn_point select 0])}) then {
if (["house",life_spawn_point select 0] call BIS_fnc_inString) then {
private ["_bPos","_house","_pos"];
_house = nearestObjects [getMarkerPos (life_spawn_point select 0),["House_F"],10] select 0;
_bPos = [_house] call life_fnc_getBuildingPositions;
if (_bPos isEqualTo []) exitWith {
player setPos [(getMarkerPos (life_spawn_point select 0) select 0),(getMarkerPos (life_spawn_point select 0) select 1), life_spawn_point select 3];
};
{_bPos = _bPos - [(_house buildingPos _x)];} forEach (_house getVariable ["slots",[]]);
_pos = _bPos call BIS_fnc_selectRandom;
player setPosATL _pos;
} else {
player setPos [(getMarkerPos (life_spawn_point select 0) select 0),(getMarkerPos (life_spawn_point select 0) select 1), life_spawn_point select 3];
};
} else {
_spawnPos = (call compile format ["%1", life_spawn_point select 0]) call BIS_fnc_selectRandom;
_spawnPos = _spawnPos buildingPos 0;
player setPos _spawnPos;
};
} else {
player setPos [(getMarkerPos (life_spawn_point select 0) select 0),(getMarkerPos (life_spawn_point select 0) select 1), life_spawn_point select 3];
};
titleText[format ["%2 %1",life_spawn_point select 1,localize "STR_Spawn_Spawned"],"BLACK IN"];
};
if (life_firstSpawn) then {
life_firstSpawn = false;
[] call life_fnc_welcomeNotification;
};
[] call life_fnc_playerSkins;
[] call life_fnc_hudSetup;
Alles anzeigen
So und schon ist man fertig. Ich habe mal alle geänderten Dateien auch noch als Zip angehängt.
Noch ein kleiner Hinweis, ich hatte bisher noch nicht die Gelegenheit das zu testen, daher einfach melden falls es Fragen oder Probleme gibt
Gruß,
moeck