Jump to content

Recommended Posts

I tried to create a zombie (Zombie & Demons mod). Looks like they work fine. But they doesn't move. The zombie can turn right or left, but he can't move. I read, that if you create unit with this command - he will have an animal logic. Is there a way to make him act like normal unit...? Command 'createUnit' is not an option, because of the limit. You can't create so much zombies like in dayz with that... Anyone knows maybe the solution...?  :)

Share this post


Link to post
Share on other sites

code?

 

There is no code. I just create him with that command. createAgent

 

Currently testing it in a trigger:

 

null = createAgent ["RyanZombieC_man_1", position gs1, [], 0, "NONE"];

Share this post


Link to post
Share on other sites

I am far from being an expert, but I suppose Dayz Zombies are createUnit, it's just a matter of monitoring how many zombies are spawned in map. Proper zombie FSM will be less CPU expensive so I guess the max amount of zombies exceeds the typical Arma AI limit (no search for cover, enemy awareness less intensive).

 

Anyway I remember KillzoneKid had some tutorial on scripting createAgent units.

  • Like 1

Share this post


Link to post
Share on other sites

I am far from being an expert, but I suppose Dayz Zombies are createUnit, it's just a matter of monitoring how many zombies are spawned in map. Proper zombie FSM will be less CPU expensive so I guess the max amount of zombies exceeds the typical Arma AI limit (no search for cover, enemy awareness less intensive).

 

Anyway I remember KillzoneKid had some tutorial on scripting createAgent units.

 

In DayZ, the zombies are created with 'createAgent'

  • Like 1

Share this post


Link to post
Share on other sites

^ yup

 

edit:  @jts_2009: You can disable their inbuilt FSM's with:

agent = createAgent ["ryanzombieclassname", position player, [], 0, "FORM"];
agent disableAI "fsm";

(You might not need to disable the AI - check the config entries for "fsmDanger" and "fsmFormation" and see if they are already empty).

 

Then you would need to write an FSM or script to control the zombie. Here's what they use in Dayz currently:

 

https://github.com/DayZMod/DayZ/blob/Development/SQF/dayz_code/system/zombie_agent.fsm

 

Use it as reference and substitute in Ryans anims for attacks etc.  I'm not sure if that would work out of the box in Arma 3 as there have been some changes to commands etc and also bear in mind that moveTo was (and still might be) broken for agents.  

Share this post


Link to post
Share on other sites

Then you would need to write an FSM or script to control the zombie. Here's what they use in Dayz currently:

 

Yes, but the problem is, that the zombies should not move, until they don't know about player presence. I took command 'knowsAbout', but the result is always 'false'

Share this post


Link to post
Share on other sites

knowsAbout doesn't work on agents, you need to emulate that yourself.

Share this post


Link to post
Share on other sites

You're doing something wrong then.  Knowsabout should only return a number, not bool.  From the wiki:

 

Return value: Number in the range of 0 - 4, where 4 is max knowledge

 

https://community.bistudio.com/wiki/knowsAbout

 

edit: ninja'd by Haleks

    

Try neartargets (iirc that worked in Dayz) or write your own with lineIntersects /checkVisibility

Share this post


Link to post
Share on other sites

You're doing something wrong then.  Knowsabout should only return a number, not bool.  From the wiki:

 

Return value: Number in the range of 0 - 4, where 4 is max knowledge

 

https://community.bistudio.com/wiki/knowsAbout

 

edit: ninja'd by Haleks

    

Try neartargets (iirc that worked in Dayz) or write your own with lineIntersects /checkVisibility

 

Thats doesn't matter if number or bool, the result is bad. It was just a quick-check with: hint str (s1 knowsAbout player > 1)

It return always false. hint str (s1 knowsAbout player) returns 0

Share this post


Link to post
Share on other sites

Thats doesn't matter if number or bool, the result is bad. It was just a quick-check with: hint str (s1 knowsAbout player > 1)

It return always false. hint str (s1 knowsAbout player) returns 0

 

Ah ok fair enough, I didn't know you were comparing to another value.  From what you wrote, it sounded like the command was returning a bool.

Share this post


Link to post
Share on other sites

look at this topic to get an idea how to check visibility:

https://forums.bistudio.com/topic/189068-los-line-of-sight/

i would not use checkVisibility but i described it there

 

Thanks. I found new problem now. Zombie don't attack me, if I not shoot. Well, sometimes he attacks if I not shooting, but it's very rarely. So I think that thing with createAgent is bad idea. Will to have probably use createunit, but Im not sure about limitation... How much units I can create for 1 commander, anyone know..? If I create them periodically, 24 hours. 100 per hour. (Of course they will be deleted under specific conditions)

Share this post


Link to post
Share on other sites

hi do you found a solution?

 

 

for me im using

 

_typezombiesR2= ["RyanZombieB_Soldier_02_f_1_1slowOpfor","RyanZombieC_man_1slowOpfor"]     call BIS_fnc_selectRandom;
 
 
_spawnPoszr2 = [getpos player, 100, 200, 0, 0, 0, 0] call BIS_fnc_findSafePos;
 
_groupzombr2 = createGroup east;// create the group east can be independent,west
 
_unitzombr2 = _groupzombr2 createUnit [_typezombiesR2,_spawnPoszr2, [], 0, "none"] ;
 
 
createUnit is always what i m using but you need to impement some function module in editor
like roaming option ....
 
you may (i think) also take care to the side if you are east or west by adding this on init mission file
or by adding   addrating -20000;
 
 
civilian setFriend [east, 0];
civilian setFriend [west, 0];
civilian setFriend [resistance, 0];
west setFriend [resistance, 0];
east setFriend [resistance, 0];
resistance setFriend [east, 0];
resistance setFriend [west, 0];
resistance setFriend [civilian, 0];
 
hope it help...
 
mini_627027banniere.jpg
 

Share this post


Link to post
Share on other sites

If you actually look at the DayZ mod code from ArmA 2, they are agents and have a custom FSM (Made with the FSM editor).  It's probably also doable with createUnit and just execute the FSMs on them, similar to the ALICE modules from ArmA 2:OA.

  • Like 1

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  

×