Sign in to follow this  
Followers 0
Silas

Manually spawn AI or zombies using in-game admin commands?

20 posts in this topic

Hi all,

I'm working as an Admin on a server.  We're running , infiSTAR, Ryan's zombies and DMS. Right now we have the number of zombie spawns low and I'm looking for a way to manually spawn a horde (or 1 at a time) of zombies for RP events and whatnot.  Can this be done via the debug menu? If so, please help me out in newbie-code speak.  A simple cut and paste script I can plop in the debug menu would be excellent, if possible.  Any advice is most welcomed.

Thanks in advance for any help. Appreciate it.

~Si

Share this post


Link to post
Share on other sites

Ok, I was able to manually spawn a zombie in the debug console by pasting this into it and hitting local execute:

"RyanZombieC_man_1slowOpfor" createUnit [ position player, group player ];


What I can't figure out is how to set the zombie to hostile.  It groups it with the player but I don't know what to replace Group Player with to put the zombies in a hostile faction.  Any suggestions?

Share this post


Link to post
Share on other sites
Advertisement
29 minutes ago, Silas said:

Ok, I was able to manually spawn a zombie in the debug console by pasting this into it and hitting local execute:


"RyanZombieC_man_1slowOpfor" createUnit [ position player, group player ];


What I can't figure out is how to set the zombie to hostile.  It groups it with the player but I don't know what to replace Group Player with to put the zombies in a hostile faction.  Any suggestions?

Look at the spawning code in ExileZ, you need to create a group for it, not use the player's group ;)

Share this post


Link to post
Share on other sites

Thanks for the hint! I did manage to spawn a hostile zombie, but it doesn't go anywhere.  Just stands there and whacks at a player when they get within arms reach.

 

createAgent ["RyanZombieC_man_polo_1_FslowOpfor", position player, [], 0, "Opfor"];

 

So that let me just set it as being in the Opfor group. Now to figure out how to make them actually move and act like zombies.

Gonna take a look at the spawn code in ExileZ now.

Share this post


Link to post
Share on other sites
9 minutes ago, Silas said:

Thanks for the hint! I did manage to spawn a hostile zombie, but it doesn't go anywhere.  Just stands there and whacks at a player when they get within arms reach.

 


createAgent ["RyanZombieC_man_polo_1_FslowOpfor", position player, [], 0, "Opfor"];

 

So that let me just set it as being in the Opfor group. Now to figure out how to make them actually move and act like zombies.

Gonna take a look at the spawn code in ExileZ now.

Using createagent I don't think will enable the AI that is in ryan's zombies, you'd have to assign an FSM to them, which you would want to write yourself. The AI in ryan's zombies is not very good for performance btw, if you have the ability to do so, I would make an FSM and work with that instead, he's not using an FSM, just a thread with a continuous loop for the AI.

Share this post


Link to post
Share on other sites

if it helps I trigger this script through InfiSTAR

 

Quote

fn_spawnAI = {
 _targetObj = _this;
 _netId = netId _targetObj;
 _stringcode = "
  _object = objectFromNetId "+str _netId+";
  _pos = getpos _object;
  _spawnPos = [_pos,20,20,20,0,0.5,0] call DMS_fnc_findSafePos;
  _group = [[_spawnPos select 0, _spawnPos select 1,0],6,'difficult','random','bandit'] call DMS_fnc_SpawnAIGroup;
  [_group, _pos] call bis_fnc_taskDefend;_group setBehaviour 'STEALTH';
  _group setCombatMode 'YELLOW';systemChat format['Spawn AI -> selected player: %1',name _object];
 ";
 [_stringcode] call admin_d0_server;
};

using the trigger in custom_functions in InfiSTAR

 

Quote

 class custom1 {
  type = 2;
  name = "Spawn AI near Admin";
  code = "_this call fn_spawnAI";
 };

 

1 person likes this

Share this post


Link to post
Share on other sites
59 minutes ago, red_ned said:

if it helps I trigger this script through InfiSTAR

 

using the trigger in custom_functions in InfiSTAR

 

 

Is it possible to condense that into something that can be cut and pasted into the debug console? I don't have access to change infistar files.

Share this post


Link to post
Share on other sites

Posted (edited)

1 hour ago, red_ned said:

if it helps I trigger this script through InfiSTAR

 

using the trigger in custom_functions in InfiSTAR

 

 

I was just trying to get his working last night and failed horribly. I get where to put the custom_functions in the CUSTOM_FUNCTIONS.hpp, but where do I need to put the 

fn_spawnAI = {
 _targetObj = _this;...etc etc 

Is that run in the admin console once I've added the custom functions or do I need to add that into EXILE_AT.sqf?

Edit: I'm just trying to do this with standard DMS units, not zombies

Edited by devilFaust

Share this post


Link to post
Share on other sites
43 minutes ago, devilFaust said:

I was just trying to get his working last night and failed horribly. I get where to put the custom_functions in the CUSTOM_FUNCTIONS.hpp, but where do I need to put the 

fn_spawnAI = {
 _targetObj = _this;...etc etc 

Is that run in the admin console once I've added the custom functions or do I need to add that into EXILE_AT.sqf?

Edit: I'm just trying to do this with standard DMS units, not zombies

you add the main block of code into a single file and drop it into your mission file then do (in your init.sqf):

Quote

[] execVM "addons\spawnai.sqf";

my file is called spawnai.sqf and the path in the mission PBO is addons\spawnai.sqf

 

the minor call in custom functions just calls the function fn_spawnAI which is defined in the spawnai file - ie server side Infistar calls client side function

If you add multiples make sure the function name is unique or all hell breaks loose!

2 people like this

Share this post


Link to post
Share on other sites
Advertisement

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

  • Recently Browsing   0 members

    No registered users viewing this page.