Jump to content
Sign in to follow this  
Gundam Meister

Zombies in mission

Recommended Posts

I am going to create a mission and was wondering is it possible to get the zombies to attack people outside the players group or attack people who wander close to them

Share this post


Link to post
Share on other sites

hi,

I am going to create a mission and was wondering is it possible to get the zombies to attack people outside the players group or attack people who wander close to them

If you are using the FML or pepzombies addons you can add and remove units from the gblalltargets array.

Here's a little script to show you how to add other groups than player group in the gblalltargets array

add_target.sqs

;*********************************************************
;Add Target Script by Nikiller v0.9b
;Add target to the gblalltargets array
;Note: lastest version of pepzombies.pbo or FML needed
;contact: nikillerofp@hotmail.fr
;[] exec "scriptName.sqs"
;*********************************************************
_alltargetlist = [[b][color="Red"]playerGrp,civilGrp1,EastGrp1[/color][/b]]
_target_ar=[]
{_target_ar=_target_ar+(units _x)} foreach _alltargetlist

@gblInitDone==1 
~5
gblalltargets = []
{if (alive _x) then {gblalltargets = gblalltargets + [_x]}} forEach _target_ar

exit

Here's a little demo to show how it works (MP/SP compatible):

http://www.multiupload.com/NV78SNWZ2C

I this demo there's a group of civilian near but not in player's group and they will be attacked by zombies.

If you want to make zombies attack i.e a civilian not in player group but close to them you should check the distance between any player's group member and the civilian. If the civilian is less than the distance checked by the script then he is added to the gblalltargets array. If the civilian runs away and he's more than the distance checked by the script then he is substracted from the gblalltargets array. But it will not be very performance friendly since you have to check the distance beween the player group and every units not in player group.

hope it helps.

cya.

Nikiller.

Edited by Nikiller

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
Sign in to follow this  

×