Home   Help Search Login Register  

Author Topic: Moving seagulls, butterflies and such.  (Read 1485 times)

0 Members and 1 Guest are viewing this topic.

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Moving seagulls, butterflies and such.
« 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
« Last Edit: 16 Dec 2008, 22:53:10 by laggy »
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline ModestNovice

  • Members
  • *
Re: Moving seagulls, butterflies and such.
« Reply #1 on: 17 Dec 2008, 01:51:44 »
you could try something like this:

creatureMove.sqf
Code: [Select]
//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;
};
"The road became empty and the people disappeared. The clouds ran away; opened up the sky, and one by one I watched every constellation die."
- Sean "Slug" Daley

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Re: Moving seagulls, butterflies and such.
« Reply #2 on: 17 Dec 2008, 02:32:32 »
Tried this:

NOTE: _body is a corpse that acts as the source or origin.

Code: [Select]
_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
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline ModestNovice

  • Members
  • *
Re: Moving seagulls, butterflies and such.
« Reply #3 on: 17 Dec 2008, 03:58:27 »
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.
"The road became empty and the people disappeared. The clouds ran away; opened up the sky, and one by one I watched every constellation die."
- Sean "Slug" Daley

Offline Ext3rmin4tor

  • Members
  • *
Re: Moving seagulls, butterflies and such.
« Reply #4 on: 17 Dec 2008, 10:30:29 »
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.
How can you shoot women and children?
Easy! Ya' just don't lead'em so much! Ain't war hell?!!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Moving seagulls, butterflies and such.
« Reply #5 on: 17 Dec 2008, 12:17:32 »
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.