PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Random cache


@Survival
11.03.2016, 10:01
Hallo Leute !!!

Suche ein Script für random ammocaches!! hab da schon einige gefunden sowie das RCP usw..

Nur das Problem dabei ist die caches spawnen alle im freien würde sie aber gerne in nem Haus haben.


if (isServer) then {
_box = _this select 0;

//Get the position of the box
_pos = getPosATL _box;

//Get an array of all the towns and select one at random
_townlist = nearestLocations [getpos _box,

["NameCityCapital","NameCity","NameVillage"],500];


//Get town from array
_rnd = floor random (count _townlist);
_town = _townlist select _rnd;
_town_name = text (_town);


//Get town location
_locationPos = locationPosition (_town);


//Move ammobox to town location
_box setPosASL [_locationPos select 0, _locationPos select 1, 0];


//Fix ammo box to ground level
_newpos = getPosASL _box;

_box setPos [_newpos select 0, _newpos select 1, 0];
hint format ["%1",_box];
};

das hier hab ich auch probiert und schon umgeändert mit nearestobject(HAusnamen) usw.

entweder funktioniert es nicht in A3 oder ichmach iwas falsch.

burns
11.03.2016, 12:36
Wenn du vom jeweiligen Haus die buildingPos ausliest, könnste die Kisten einfach darauf setzen. Wär nur blöd, wenn gleichzeitig ne KI zu demselben Punkt hingehen möchte..


Inspirationen für die Routine dahinter, könnte man sich im allseits bekannten housepatrol.sqf von Tophe of Östgöta Öps (thank youuu, Bohemiaaa (https://www.youtube.com/watch?v=-DLJPr2lyno)) holen.

Drunken Officer
11.03.2016, 13:26
edit: falsch gelesen, deswegen falscher code gepostet

@Survival
11.03.2016, 13:28
Danke @Burns und @Drunken Officer


Werd mir das gleichmal ansehen.