OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: laggy on 16 Dec 2008, 22:50:31
-
Hi all,
I have a script where I createVehicle different "ambient life" like flies etc.
Does anyone know how to move them around? They just seem to sink below ground and not fly around naturally.
In OFP you could use the camCommands for seagulls, but I guess that can't be used when they are VEHICLES.
Laggy
-
you could try something like this:
creatureMove.sqf
//after create use this line
//example: _fly = "godzilla" createVehicle ...
//[_fly] execVM "creatureMove.sqf";
_unit = _this select 0;
while {alive _unit} do
{
_unitPos = (floor(random 15));
_unit doMove _unitPos;
Sleep 2;
};
-
Tried this:
NOTE: _body is a corpse that acts as the source or origin.
_body = _this select 0;
_fly = _this select 1;
while {alive _fly} do
{
_flyPos = [(getpos _body select 0) + (random 2), (getpos _body select 1) + (random 2), random 2];
_fly setdir random 360;
_fly doMove _flyPos;
Sleep 2;
};
It doesn't seem to work.
Setpos works though and I'm starting to suspect that insects can't be affected by doMove.
Tried to unpack the bin and addons in the original game, but found nothing of value.
Laggy
-
well random 2 could be anywhere between 0 and 2. Meaning it could be 0.009 which is very small and with arma and small distances, sometimes the ai will not move at all.
You will want to ceil or floor the value to get it as a whole number, and also increase the number a bit.
-
Besides if I remember well, once I read somewhere that any vehicle or unit created with this command has a small or no AI behaviour, so that's might be the reason why they're stucked there. Try to spawn a soldier and then use the doMove command on it, if he doesn't move that's the problem.
-
True, cam created things have no AI, but at least in old ofp you can make them fly from A to B with setPos of the created cam.