Jump to content
johnnyboy

[Solved]How to create butterflies, bees, dragonflies

Recommended Posts

How do you create  butterflies, bees, dragonflies via a script?

 

I think this worked for me in the past, but its not working now:

_butterfly = createAgent ["Butterfly", [0,0,0], [], 0, "NONE"];

I thought I remember seeing class names for these but I can't find them any more.

 

Please advise.

Share this post


Link to post
Share on other sites

I believe these are particleeffects. I'm on mobile and cant investigate, but maybe this helps already.

Share this post


Link to post
Share on other sites

Requested classnames....

ButterFly_random
DragonFly
FireFly
Cicada
HoneyBee
HouseFly
Mosquito

Not sure what you have in mind via a script, but you can also use the Ambient System

 

  • Like 1

Share this post


Link to post
Share on other sites

createAgent seemed to cause issues for me with butterflies.

This uses createVehicle and builds upon BIS_fnc_crows. This will spawn animals which will then circle a centre position:

/*
	Function: TAG_fnc_spawnAnimals (Edited version of BIS_fnc_crows)
	Author: HallyG
	Spawns a group of animals which will circle the spawn area. 

	Argument(s):
	0: Spawn position <OBJECT, STRING, POSITION>
	2: Radius <NUMBER>
	3: Number of animals <NUMBER>
	4: Spawn height <NUMBER>
	5: Animal Classname <STRING>, optional
	
	Return Value:
	Spawned animals <ARRAY>
	
	Example:
	[player, 2, 20, 1] call TAG_fnc_spawnAnimals;
__________________________________________________________________*/
params [
	["_centre", [0,0,0], [[], objnull, ""]],
	["_radius", 50, [0]],
	["_count", 5, [0]],
	["_height", 30 + random 10, [0]],
	["_animal", "ButterFly_random", [""]]
];

_centre = _centre call {
	if (_this isEqualType objNull) exitWith {getPosASL _this};
	if (_this isEqualType "") exitWith {markerPos _this};
	_this
};

if (_centre isEqualTo [0,0,0]) exitWith {[]};


private _animalList = [];
private _wp0 = [_centre, _radius, 00] call BIS_fnc_relPos;
private _wp1 = [_centre, _radius, 090] call BIS_fnc_relPos;
private _wp2 = [_centre, _radius, 180] call BIS_fnc_relPos;
private _wp3 = [_centre, _radius, 270] call BIS_fnc_relPos;


for "_i" from 1 to _count do {
	// Random uniformly distributed position in a circle around the centre position
	private _pos = (_centre getPos [_radius * sqrt random 1 , random 360]) vectorAdd [0, 0, _height];
	
	private _animal = createVehicle ["ButterFly_random", _pos, [], 0, "NONE"];
	_animal setVariable ["BIS_fnc_animalBehaviour_disable", true];
	
	// FSM for animal to circle the spawn area
	[_animal, _wp0, _wp1, _wp2, _wp3, _radius] execfsm "A3\Functions_F\Environment\fn_crows.fsm";
	_animalList pushBack _animal;
};

_animalList;

 

  • Like 2

Share this post


Link to post
Share on other sites
6 hours ago, kremator said:

Suicide exploding butterflies confirmed :)

Dude, don't give away my plan!

 

@Evil Organ Thanks for the ClassNames brah!  Google failed me on that search...

 

@HallyG Thanks much for the solution.  Using the crow function is a clever idea.  I'm going to open that up to get what I need out of it.  Cheers mate!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×