Arched 1 Posted February 2, 2014 Thanks for opening this, I kinda need your help I'm creating a campaign about a zombie apocalypse day by day, so I didn't need any actual zombies in the opening missions. But the time has come to actually kill some of them, so they need to be somewhat convincing. What I want to do is place some units on the map, and have their inits execute a zombie script. I tried messing with the Dynamic Zombie Sandbox script, but I couldn't figure out what to do, since I only want the zombie behavior(and possibly the sounds) from it. (If you can help me modify DZS, that would be perfect) I don't really care about the looks, all I want is a zombie that will attack you and cause damage, nothing really too in-depth. I was going to wait for a zombie mod like the Undead Mod for Arma 2, or maybe its port, but none of it seems to have happened so far.. If any of you could help me, it will be massively appreciated. Thanks for your time again Share this post Link to post Share on other sites
fusion13 11 Posted February 2, 2014 I'll be nice and post a zombieBehavior.sqf I made for one of my mission still in work :D _chasDist = 15; _idleAct = 35; _attack = 1.5; while {(alive player)} do { if (isNull player) exitWith {}; _exit = false; _pos = getPosATL player; { if not (isPlayer _x) then { if (alive _x) then { _posC = getPosATL _x; _dstC = _pos distance _posC; if (_dstC < _idleAct) then { call idle_sound_fnc; if (_dstC < _chasDist) then { if (_dstC < _attack) then { _dir = ((_pos select 0) - (_posC select 0)) atan2 ((_pos select 1) - (_posC select 1)); _x setFormDir _dir; _x setDir _dir;//or only one of these, if sufficient _x playmove "AmovPercMstpSnonWnonDnon_AinvPercMstpSnonWnonDnon_Putdown"; sleep 0.5; _randomHit = [10,12,11,16,13,20,4,7,8]call bis_fnc_selectRandom; //_bleedingChance = [0,0,0,0,0,1]call bis_fnc_selectRandom; //bleeding = _bleedingChance; health = health - _randomHit; //hint format ["%1", _bleedingChance]; enableCamShake true; addCamShake [10, 1, 25]; if (health <= 0) exitWith { player setDamage 1; _exit = true } }; }; _x doMove _pos; } } }; if (_exit) exitWith {} } foreach (entities "Civilian"); sleep 1; }; for the sounds add me on steam I will give u the links when the sounds are done hope this helps Share this post Link to post Share on other sites
Arched 1 Posted February 3, 2014 (edited) Thanks bro, it helped a lot. Just one thing, the zombies don't seem to be doing damage, they just hit me. But thanks a lot for the script Edited February 3, 2014 by Arched Share this post Link to post Share on other sites
fusion13 11 Posted February 3, 2014 Thanks bro, it helped a lot.Just one thing, the zombies don't seem to be doing damage, they just hit me. But thanks a lot for the script Yo need to declare the health var in the init health = 100; Share this post Link to post Share on other sites
Arched 1 Posted February 4, 2014 Just one more quick thing Is there any way to make the zombies independent? Cause my teammates kill me if shoot the civs. I've tried replacing foreach (entities "Civilian"); with foreach (entities "Independent"); but the independent soldier just runs away. Thanks for you help again ;) Share this post Link to post Share on other sites
L.Trale 10 Posted February 4, 2014 (edited) You could open up Intel, (Crtl + W in map Editor) and switch the "Independents are friendly to: Everyone" Edited February 4, 2014 by L.Trale Share this post Link to post Share on other sites
lappihuan 178 Posted February 4, 2014 Paste in your Teams Units: this setCaptive true This should prevent them from feeling. Share this post Link to post Share on other sites
fusion13 11 Posted February 4, 2014 Also what mighy be happening is that the call line is in so it is just going to pos once? Share this post Link to post Share on other sites
Arched 1 Posted February 4, 2014 You could open up Intel, (Crtl + W in map Editor) and switch the "Independents are friendly to: Everyone" The thing about this is that killing them will then count as friendly fire, so my squad will kill me after a kill or two... Paste in your Teams Units:this setCaptive true This should prevent them from feeling. It did stop them, but them don't seem to be executing the .sqf script, they just stands there.. I'm trying to figure out what's going on, but idk what's wrong with the script.. Also what mighy be happening is that the call line is in so it is just going to pos once? What do you mean? this? _pos = getPosATL player; It works with the civilians, I don't know why it wouldn't work with independents.. Share this post Link to post Share on other sites
fusion13 11 Posted February 4, 2014 Idk tbh xD If you make it so that it is foreach (entities "Independent"); It should work the exact same Share this post Link to post Share on other sites
Arched 1 Posted February 5, 2014 Idk tbh xD If you make it so that it is foreach (entities "Independent"); It should work the exact same Perhaps maybe they need a specific script cause they act differently from the civillians.. I have no idea, that hardly makes sense but we never know.. I still think they should just port The Undead Mod.. that'd spare us some effort, but do you have any idea what could be wrong here? Share this post Link to post Share on other sites
Arched 1 Posted February 8, 2014 Think I found a solution that doesn't include modifying the script.. I found a few ways to make the civilians count as hostiles, I'm going to test it right now. Okay the easiest way I found is putting your civs on the map, and a opfor with its probability of presence set to 0%. Then group all of your civilians to the opfor guy, and they will now be considered hostile and blufor will shoot on sight. Share this post Link to post Share on other sites
Solacefire 10 Posted February 24, 2014 How are you adding sounds? Particularly the 'idle_sound_fnc' part, what are you doing there? Share this post Link to post Share on other sites
fusion13 11 Posted February 24, 2014 idle_sound_fnc = { say3D "soundname"; }; Share this post Link to post Share on other sites