Jump to content
  • 0

Spawning Zombies via SQF - They Vanish :(


PetuniaEpoch

Question

Hey all.

 

So I'm trying to spawn zombies via SQF in the mission PBO.

 

Here's the code I'm using - it sort of works, but the Zombies VANISH a split second after spawning in front of me (Booo!).

 

I've checked the RPT file and can't see any issues, could this be an infistar issue do you think? 

 

- Obviously I'm passing the location then setting it as the pos via _target = _this select 0; - and it's working as they DO appear, just seem to get deleted right away :(

 

I got the code from this post:  which seems to say they should work, just can't figure out what's going wrong... WHY are the zombies going 'poof!' in  front of my eyes and vanishing :P

 

private ["_genzombles","_zombletypes","_target","_zomblesposition","_agent","_genzombles","_zombleselectedpos"];
 
_target = _this select 0;
 
_zombletypes = [
"zZombie_Base",
"z_worker1",
"z_worker2",
"z_villager1",
"z_priest"
];
 
_zomblesposition = getpos _target;
_i = 1;
for "_i" from 1 to 25 do // spawns between 1 and 30 zombies
{
_genzombles = _zombletypes call BIS_fnc_selectRandom;
_agent = createAgent [_genzombles, _zomblesposition, [], 10, "NONE"];
_zombleselectedpos = getPosATL _agent;
[_zombleselectedpos,_agent] execFSM "\z\addons\dayz_code\system\zombie_agent.fsm";
};

 

Any advice would be GREATLY appreciated!

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...