Jump to content
gulozwood

Infected Script by Gulozwood

Recommended Posts

Hi there,

after few month learning and playing with arma3 scripts, here is my first one.

I precise a thing, my english is pretty bad and I'm sorry for that.

Based on the "Shaun: a Simple zombie AI" script by Bluebär posted on Armaholic few month ago,

I kept sounds from his script and the "contact" function that check if targets are visible or not.

How infected work:

when spawning he start walking at random points, 100m around his spawn position.

regurarly the infected check if there any uncover target in his line of sight.

if he detect a target he start running at him, if distance <2m he does damage, he will

lose his target if distance >100m then will return walk around his spawn point.

INSTALLATION:

add:

#include "infected\infectedsounds.hpp";
#include "infected\cfgfunctions.hpp";

in your description.ext file.

HOW TO USE:

create a unit in the editor, add in the init box:

null = this spawn INF_fnc_infecthim

OR

Create a marker and name it, create a trigger and put in "on act":

null= [thistrigger,["marker01"],100, false, true] spawn INF_fnc_infectedzone;

in this order:

thistrigger : this one never change.

["marker01"] : the name of your marker. can be multiple ["marker01","marker02"]

100 : infecteds to spawn.

false : spawn in houses: true/false

true : respawn after last player leave the trigger : true/false

here infecteds will be created as soon as any player enter the trigger, if he leave

they all will be "frozen", and reactivated if he come again, so don't use "repeat" on the trigger

THEN

you can use the "horde" trigger, it's a bit different:

infecteds will attack the player that activate

the trigger and his group ONLY, if all players are dead, they will return to

their spawn point and die.

null= [thistrigger,["pop000"],15,false] spawn INF_fnc_initHorde;

in this order:

thistrigger : this one never change.

["pop000"] : the name of your marker. can be multiple ["pop000","pop001"]

15 : infecteds to spawn on every markers

false : spawn in houses: true/false

UPDATE 0.5: cleaning the mess. added "firedNear" eventhandler, infecteds will investigate gunshot sound position except in case of silenced weapons usage, they can now change target when attacking.

UPDATE 0.3: new triggers, infecteds now use different posture, crouching and crawling (thanks to Killzone_Kid for this great idea :D )

Download Link

Exemple mission

PS: I'm totaly new with scripts, posting things on forum, sharing things etc, so tell me if i'm doing it wrong.

I started this script few months ago, and at first it was totaly chaotic and "non exportable" but i make a coop mission with it, lots of bugs but fun anyway:

Edited by gulozwood
Update (bugs correction)

Share this post


Link to post
Share on other sites
Guest

Release frontpaged on the Armaholic homepage.

==================================================

You are not registered on Armaholic, or at least not that we are aware of. In the future we offer the possibility to authors to maintain their own pages.

If you wish to be able to do this as well please register on Armaholic and let me know about it.

This is not mandatory at all! Only if you wish to control your own content you are welcome to join, otherwise we will continue to follow your work like we have always done ;)

When you have any questions already feel free to PM or email me!

Edited by Guest

Share this post


Link to post
Share on other sites

Hi !

How do I add the attack for civil for the zombies attack CIVILIAN and BLUEFOR ?

Thank you

Share this post


Link to post
Share on other sites

hi, i've tested this and it seems to work.

first in the infected.sqf file at line 68 find:

_x setTriggerActivation ["west", "PRESENT", true];

and replace with:

_x setTriggerActivation ["any", "PRESENT", true];

then in the infected\zoneinit.sqf file at line 16:

if (alive _x ) then

and replace with:

if ((alive _x )and( side _x != east ))

Share this post


Link to post
Share on other sites

THank you for this, I've been wanting to create a "Shacker" type game play for my group. Seems this will at least fit part of that bill.

Share this post


Link to post
Share on other sites

Do they continue to spawn? or after a while if you kill them all is that it area done? thx looking forward to this

Share this post


Link to post
Share on other sites

@Droopypiles: they all spawn when you enter the area, you have to leave then enter the area to make them spawn again.

@karneck: I'm sorry but can you explain what is a "shacker" gameplay?

Share this post


Link to post
Share on other sites
@Droopypiles: they all spawn when you enter the area, you have to leave then enter the area to make them spawn again.

@karneck: I'm sorry but can you explain what is a "shacker" gameplay?

No my question is more what is there spawn limit or numbers, and if your in the area do they spawn forever or is there a number?

Share this post


Link to post
Share on other sites

spawn rate is based on the house count in the marker zone, from 10% to 70%.

70% if you have 10 houses or less in the marker, 10% if you have more than 100 houses.

these probabilities are used for every "buildingPos" of houses in the marker.

in Aegia Marina filled at 10% I can get from 30 to 70 spawned units ... :/

you can find _probability in the popinfected.sqf file at line 19.

here a little test with 300 spawned, still working in coop

---------- Post added at 21:48 ---------- Previous post was at 21:47 ----------

Thank you Karneck

yep that's it, infecteds are just angry peoples :).

Edited by gulozwood

Share this post


Link to post
Share on other sites

Right what done is this.

I put markers on the bottom left of Altis on that huge city, each marker I made was 100 x 100 square, and I just touched them all together, I gave myself 30 markers in that city, and changed the probability to 65, now everywhere is very very busy with infected, I love it! well done you :D

Share this post


Link to post
Share on other sites
hi, i've tested this and it seems to work.

first in the infected.sqf file at line 68 find:

_x setTriggerActivation ["west", "PRESENT", true];

and replace with:

_x setTriggerActivation ["any", "PRESENT", true];

then in the infected\zoneinit.sqf file at line 16:

if (alive _x ) then

and replace with:

if ((alive _x )and( side _x != east ))

What does this do ?

I came here to learn more as there is not much documentation.

Share this post


Link to post
Share on other sites
What does this do ?

I came here to learn more as there is not much documentation.

Hi,

at start you have trigger that detect BLUFOR only, changed to a trigger that detect every factions exept OPFOR.

triggers are created at mission start and used to make target list that will be used by infected inside the trigger only, infected AI is disabled exept for walking, in that way they are just like "moving empty vehicles" and you can spawn hundreds of them in coop on a "normal" server.

Share this post


Link to post
Share on other sites

I tried using your marker and trigger option, you said to

" null= [thistrigger,"zone01",100] spawn fncPopOutdoor; " I have tried this in the On Act, and the Condition as you said init, triggers don't have inits.

So anyway I made trigger activated by blufor names my marker zone01 and nothing happens

Share this post


Link to post
Share on other sites
I tried using your marker and trigger option, you said to

" null= [thistrigger,"zone01",100] spawn fncPopOutdoor; " I have tried this in the On Act, and the Condition as you said init, triggers don't have inits.

So anyway I made trigger activated by blufor names my marker zone01 and nothing happens

I'm sorry, that's "on act." box...

if you have download the new exemple mission, it's inside, look at the airfield.

something like this in on act. box:

null= thisTrigger spawn zoneInit; null= [thistrigger,"zone02",100] spawn fncPopOutdoor; 

Share this post


Link to post
Share on other sites
is it the Version 1.0 that on armaholic, cause one on this forum has more files

nope, the one on armaholic is not up to date.

Share this post


Link to post
Share on other sites
Guest

It is now :)

Updated version frontpaged on the Armaholic homepage.

==================================================

You are not registered on Armaholic, or at least not that we are aware of. In the future we offer the possibility to authors to maintain their own pages.

If you wish to be able to do this as well please register on Armaholic and let me know about it.

This is not mandatory at all! Only if you wish to control your own content you are welcome to join, otherwise we will continue to follow your work like we have always done ;)

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites
Hi,

at start you have trigger that detect BLUFOR only, changed to a trigger that detect every factions exept OPFOR.

triggers are created at mission start and used to make target list that will be used by infected inside the trigger only, infected AI is disabled exept for walking, in that way they are just like "moving empty vehicles" and you can spawn hundreds of them in coop on a "normal" server.

Ahh okay, thank you.

I was wondering why the indies couldn't trigger the horde..

Hope someone makes zombies with good animations soon! as this mod needs it bad.. Great script tho mate.

You should add different types of zombies and or make a percentage of ambient life hostile as well.

any chance you could make it so that instead of dying, your screen gets distorted and you attack your fellow crew members ? and they are the ones to kill you ?

Excited to see what you do with this..

---------- Post added at 03:04 ---------- Previous post was at 02:55 ----------

Okay I have some questions..

#1 Do you have to be on the marker for the trigger to activate,, or close to x amount of distance ?

#2 can I change the time or distance away from in which the dead delete ?

#3 When I attack and then leave the marker/trigger area, does the script keep track of what I've killed ?

You should do a video to explain the highlights of your script and tweaks that could be done, would save yourself a lot of question answering :D

Once again thank you for this, I built a mission around this and another script.

Share this post


Link to post
Share on other sites
#1 Do you have to be on the marker for the trigger to activate,, or close to x amount of distance ?

for now markers are spawning zone and triggers are used to detect players for the targeting system. so infecteds are "linked" to their trigger

#2 can I change the time or distance away from in which the dead delete ?

yes you can, look for the line:

if(!alive _me)then

in files "infectedinit.sqf" and "fnc_attack.sqf" and modify the sleep value

#3 When I attack and then leave the marker/trigger area, does the script keep track of what I've killed ?

Infected are just OPFOR, so you know how much you kill at the end of the mission.

by the way, I forgot to put airfield and Aigia marina triggers on repeat mode on the last exemple mission :/

Share this post


Link to post
Share on other sites
for now markers are spawning zone and triggers are used to detect players for the targeting system. so infecteds are "linked" to their trigger

yes you can, look for the line:

if(!alive _me)then

in files "infectedinit.sqf" and "fnc_attack.sqf" and modify the sleep value

Infected are just OPFOR, so you know how much you kill at the end of the mission.

by the way, I forgot to put airfield and Aigia marina triggers on repeat mode on the last exemple mission :/

Okay cool I'll try that.

I never used your sample mission, so I wouldn't know. I just pulled the script and made my own markers.

Will let you know if any fixes are needed, but it works flawless other then its cosmetic features.

Take care and thanx for the script.

Share this post


Link to post
Share on other sites

Hello, can i make enemy ia attack the infected ia? or infected ia attack the other ia?

Thanks

Sorry , i dont read this

Infected are just OPFOR

Edited by Fillo

Share this post


Link to post
Share on other sites
hi, i've tested this and it seems to work.

first in the infected.sqf file at line 68 find:

_x setTriggerActivation ["west", "PRESENT", true];

and replace with:

_x setTriggerActivation ["any", "PRESENT", true];

then in the infected\zoneinit.sqf file at line 16:

if (alive _x ) then

and replace with:

if ((alive _x )and( side _x != east ))

So does the above line determine the infected faction spawned? So that line is set to "east", if not, is it possible to have different factions infected? Like Nato and/or AAF?

Are you planning on any updates to the infected appearance?

Looks good I will give it a go.

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

×