Author Topic: [RequestHelp] AI Spawn script DayZ - Beginner  (Read 3820 times)

0 Members and 1 Guest are viewing this topic.

KaosNye

  • Cheater Apprentice
  • *
  • Posts: 14
  • Learning~
    • View Profile
Re: [RequestHelp] AI Spawn script DayZ - Beginner
« Reply #15 on: June 25, 2012, 01:51:41 pm »
That code makes way more sense... its easier to understand what is happening and where

MrMedic

  • MasstKer
  • ********
  • Posts: 8900
  • programmer/dev/software engineer
    • View Profile
Re: [RequestHelp] AI Spawn script DayZ - Beginner
« Reply #16 on: June 25, 2012, 01:53:11 pm »
you may want to assign your ai to west btw.

Yeah I edited in before you did, haha, but joining my group should bring them over to west, I thought. (All players are BLUFOR)

dayz specific yes , normal mission it varies usually between 2 factions.

i think were all civs actually i havent checked.
EnCoded Message: i3iy9yl8kr2xf3g2Txs3pr6ye3ya7jg5ty2z

https://www.youtube.com/watch?v=62_7-AYfdkQ
you need a paypal account for the private versions.

Website:
http://bit.ly/medic101

Teamspeak 3: 85.236.101.5:10157

MrMedic

  • MasstKer
  • ********
  • Posts: 8900
  • programmer/dev/software engineer
    • View Profile
Re: [RequestHelp] AI Spawn script DayZ - Beginner
« Reply #17 on: June 25, 2012, 01:54:48 pm »
That code makes way more sense... its easier to understand what is happening and where

a much simpler way is to :

[getPos aPos, EAST, 5] call BIS_fnc_spawnGroup

or : rather elongated version of the same

[getPos aPos, EAST, ["TK_INS_Bonesetter_EP1", "TK_INS_Soldier_2_EP1"],[],[],[],[],[],180] call BIS_fnc_spawnGroup

etc.
EnCoded Message: i3iy9yl8kr2xf3g2Txs3pr6ye3ya7jg5ty2z

https://www.youtube.com/watch?v=62_7-AYfdkQ
you need a paypal account for the private versions.

Website:
http://bit.ly/medic101

Teamspeak 3: 85.236.101.5:10157

s0beit

  • Relentless Teamkiller
  • **
  • Posts: 94
    • View Profile
Re: [RequestHelp] AI Spawn script DayZ - Beginner
« Reply #18 on: June 25, 2012, 01:57:28 pm »
That code makes way more sense... its easier to understand what is happening and where

Well, they still aren't very good at attacking zombies, but the firing does attract zombies D:

So they're basically like zombie alert squads more than bodyguards since they rarely shoot let alone hit anything (I'm working on it)

dayz specific yes , normal mission it varies usually between 2 factions.



Yep. Still don't really get why they won't kill the bastards but I'll keep messing with it

a much simpler way is to :

[getPos aPos, EAST, 5] call BIS_fnc_spawnGroup

or : rather elongated version of the same

[getPos aPos, EAST, ["TK_INS_Bonesetter_EP1", "TK_INS_Soldier_2_EP1"],[],[],[],[],[],180] call BIS_fnc_spawnGroup

etc.

That offers less control though doesn't it? Particularly because I don't see a way to grab the unit from there, so I wouldn't know how to modify it's behavior.

MrMedic

  • MasstKer
  • ********
  • Posts: 8900
  • programmer/dev/software engineer
    • View Profile
Re: [RequestHelp] AI Spawn script DayZ - Beginner
« Reply #19 on: June 25, 2012, 01:58:45 pm »
That code makes way more sense... its easier to understand what is happening and where

Well, they still aren't very good at attacking zombies, but the firing does attract zombies D:

So they're basically like zombie alert squads more than bodyguards since they rarely shoot let alone hit anything (I'm working on it)

dayz specific yes , normal mission it varies usually between 2 factions.



Yep. Still don't really get why they won't kill the bastards but I'll keep messing with it

a much simpler way is to :

[getPos aPos, EAST, 5] call BIS_fnc_spawnGroup

or : rather elongated version of the same

[getPos aPos, EAST, ["TK_INS_Bonesetter_EP1", "TK_INS_Soldier_2_EP1"],[],[],[],[],[],180] call BIS_fnc_spawnGroup

etc.

That offers less control though doesn't it? Particularly because I don't see a way to grab the unit from there, so I wouldn't know how to modify it's behavior.

it returns a variable to the group then walk into it.

Return Value:
    (Group)

i did write a nice little thing where it spawned a super body guard group but its long gone , i do shit like that jkust to see if i can then usually delete it , may still have ii somewhere il look in a bit.
EnCoded Message: i3iy9yl8kr2xf3g2Txs3pr6ye3ya7jg5ty2z

https://www.youtube.com/watch?v=62_7-AYfdkQ
you need a paypal account for the private versions.

Website:
http://bit.ly/medic101

Teamspeak 3: 85.236.101.5:10157

KaosNye

  • Cheater Apprentice
  • *
  • Posts: 14
  • Learning~
    • View Profile
Re: [RequestHelp] AI Spawn script DayZ - Beginner
« Reply #20 on: June 25, 2012, 02:03:58 pm »
You guys write whole snippets of code, faster than i can jot notes. Ill get there sometime!

MrMedic

  • MasstKer
  • ********
  • Posts: 8900
  • programmer/dev/software engineer
    • View Profile
Re: [RequestHelp] AI Spawn script DayZ - Beginner
« Reply #21 on: June 25, 2012, 02:04:26 pm »
Code: [Select]
_gxpos=[(_gxpos select 0)+random _Radius*2,(_gxpos select 1)+random _Radius,(_gxpos select 2)];
_GrptoSpawn = [_gxpos, _side, _grpof] call BIS_fnc_spawnGroup;
{[_x] joinsilent (group Player)} foreach units _GrptoSpawn;
deletegroup _GrptoSpawn;
sleep 0.01;
group Player selectLeader Player;

snipped a fair bit out but youl get the idea then

_m = [position player,"Armored","USMC",80] execvm "SpwnGrp.sqf"; etc

_m select _x foreach. and set them to do what you want.
« Last Edit: June 25, 2012, 02:11:57 pm by MrMedic »
EnCoded Message: i3iy9yl8kr2xf3g2Txs3pr6ye3ya7jg5ty2z

https://www.youtube.com/watch?v=62_7-AYfdkQ
you need a paypal account for the private versions.

Website:
http://bit.ly/medic101

Teamspeak 3: 85.236.101.5:10157

MrMedic

  • MasstKer
  • ********
  • Posts: 8900
  • programmer/dev/software engineer
    • View Profile
Re: [RequestHelp] AI Spawn script DayZ - Beginner
« Reply #22 on: June 25, 2012, 02:14:13 pm »
You guys write whole snippets of code, faster than i can jot notes. Ill get there sometime!

keep going im sure you will eventually.
EnCoded Message: i3iy9yl8kr2xf3g2Txs3pr6ye3ya7jg5ty2z

https://www.youtube.com/watch?v=62_7-AYfdkQ
you need a paypal account for the private versions.

Website:
http://bit.ly/medic101

Teamspeak 3: 85.236.101.5:10157

KaosNye

  • Cheater Apprentice
  • *
  • Posts: 14
  • Learning~
    • View Profile
Re: [RequestHelp] AI Spawn script DayZ - Beginner
« Reply #23 on: June 25, 2012, 02:14:51 pm »
I appreciate all the help so far. I'm tired and need rest, but tomorrow i am determined to not only write, but understand it

s0beit

  • Relentless Teamkiller
  • **
  • Posts: 94
    • View Profile
Re: [RequestHelp] AI Spawn script DayZ - Beginner
« Reply #24 on: June 25, 2012, 02:17:53 pm »
I think the problem with them refusing to fire on people might boil down to the zombies being civilians, I can't think of anything else atm.

I might be able to change all the zombies to "EAST" on my client and just try that out.

s0beit

  • Relentless Teamkiller
  • **
  • Posts: 94
    • View Profile
Re: [RequestHelp] AI Spawn script DayZ - Beginner
« Reply #25 on: June 25, 2012, 04:26:11 pm »
Well, I've been trying this out

Code: [Select]
while {alive _spawnAIS} do
{
_findTa = nearestObjects[_spawnAIS, ["zZombie_Base"], 150];

_victim = _findTa select 0;

if(_victim isKindOf "zZombie_Base") then {
_spawnAIS dotarget _victim;
_spawnAIS dofire _victim;
};

sleep 10;
};

It works but really, not that great. I'd rather the default logic handle all this bull but whatever.

MrMedic

  • MasstKer
  • ********
  • Posts: 8900
  • programmer/dev/software engineer
    • View Profile
Re: [RequestHelp] AI Spawn script DayZ - Beginner
« Reply #26 on: June 25, 2012, 06:20:37 pm »
you should put in a check to see if the target is alive and / or is a player or those fucking idiot ai could end up targetting dead bodys.
EnCoded Message: i3iy9yl8kr2xf3g2Txs3pr6ye3ya7jg5ty2z

https://www.youtube.com/watch?v=62_7-AYfdkQ
you need a paypal account for the private versions.

Website:
http://bit.ly/medic101

Teamspeak 3: 85.236.101.5:10157

Coronel_Niel

  • Insane Joker
  • ****
  • Posts: 846
  • Why can't I pick my own profile picture...
    • View Profile
Re: [RequestHelp] AI Spawn script DayZ - Beginner
« Reply #27 on: June 25, 2012, 08:29:17 pm »
Code: [Select]
zomDie = true;
WHILE {zomDie } DO
{
{_X ADDRATING -200000} FOREACH ALLMISSIONOBJECTS "ZZOMBIE_BASE";
};


......

Due to lag they may fire entire clips at one zombie, however. They don't register as dead for 10-15 secs sometimes. Worked on 1.7.0.0
"Now we are going to watch my boys do it" - Joopig

KaosNye

  • Cheater Apprentice
  • *
  • Posts: 14
  • Learning~
    • View Profile
Re: [RequestHelp] AI Spawn script DayZ - Beginner
« Reply #28 on: June 26, 2012, 01:24:08 am »
Thanks all for help.

I have the AI spawning the way I had hoped.

They are a little clunky as you know when it comes to hesitating against killing the zombies, but it's really not that bad.

Appreciate the help.

MrMedic

  • MasstKer
  • ********
  • Posts: 8900
  • programmer/dev/software engineer
    • View Profile
Re: [RequestHelp] AI Spawn script DayZ - Beginner
« Reply #29 on: June 26, 2012, 01:02:35 pm »
well done.
EnCoded Message: i3iy9yl8kr2xf3g2Txs3pr6ye3ya7jg5ty2z

https://www.youtube.com/watch?v=62_7-AYfdkQ
you need a paypal account for the private versions.

Website:
http://bit.ly/medic101

Teamspeak 3: 85.236.101.5:10157