Author Topic: AI Spawn Script  (Read 7348 times)

0 Members and 1 Guest are viewing this topic.

Fishgun123

  • Online Villain
  • ***
  • Posts: 223
    • View Profile
Re: AI Spawn Script
« Reply #30 on: June 06, 2012, 11:47:04 pm »
They are auto attacking players and zombies. What if I just want them to attack players also how do I give you rep?
1: Dunno, 2: You need to have 100 posts.

katie1992

  • Intentional Cheater
  • **
  • Posts: 38
    • View Profile
Re: AI Spawn Script
« Reply #31 on: June 06, 2012, 11:50:49 pm »
Can anyone paste a full snippet of the code you've got for the "AI" spawned to attack anything?

Fishgun123

  • Online Villain
  • ***
  • Posts: 223
    • View Profile
Re: AI Spawn Script
« Reply #32 on: June 07, 2012, 12:02:47 am »
Can anyone paste a full snippet of the code you've got for the "AI" spawned to attack anything?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

katie1992

  • Intentional Cheater
  • **
  • Posts: 38
    • View Profile
Re: AI Spawn Script
« Reply #33 on: June 07, 2012, 12:25:05 am »
This would be great, thanks..

Buster

  • Klass Klown
  • ***
  • Posts: 295
  • Kool Kat
    • View Profile
Re: AI Spawn Script
« Reply #34 on: June 07, 2012, 01:11:53 am »
Guys, cant find a spoon big enough at the moment  :icon_laugh

Buster

  • Klass Klown
  • ***
  • Posts: 295
  • Kool Kat
    • View Profile
Re: AI Spawn Script
« Reply #35 on: June 07, 2012, 01:37:10 am »
Ok then, make this code into a script or take out the // comments and add to the spawned ai's init.
ur_ai = the name you need to give the ai that you spawn  :icon_thumbsup
Code: [Select]
_grp = creategroup (east);  // Side of a group to make enemy
_grp allowFleeing 0;   // 0 means maximum courage, while 1 means they will fuck off
[ur_ai] join _grp;   // the group ur_ai will join
ur_ai enableAI "TARGET";      // Obvious
ur_ai enableAI "AUTOTARGET";   // More obvius
ur_ai setskill 1;   // set to 1 for maximum skill
ur_ai setCombatMode "RED";   // Makes ur_ai red with anger
ur_ai setBehaviour "AWARE";   // give ur_ai awareness
ur_ai addweapon "MakarovSD";   // give ur_ai a gun
ur_ai addmagazine "8Rnd_9x18_Makarov";  // gives ur_ai some ammo
ur_ai selectWeapon "MakarovSD";   // tells ur_ai to use this weapon
while {alive ur_ai} do {  
ur_ai setvehicleammo 1;      // will give ur_ai unlimited ammo
sleep 0.01;
};
Not actually tested, so try it and let me know  :icon_cool2
« Last Edit: June 08, 2012, 01:48:20 am by Buster »

katie1992

  • Intentional Cheater
  • **
  • Posts: 38
    • View Profile
Re: AI Spawn Script
« Reply #36 on: June 07, 2012, 02:23:43 am »
I tried this:

Code: [Select]
ur_ai = _this select 0;
_grp = createGroup east;

ur_ai = "GUE_Soldier_Sniper" createunit [[(getpos player select 0), (getpos player select 1), 50], group player, format["%1", TKC__MedicDevString_command]], _grp allowFleeing 0, ur_ai enableAI "TARGET", [ur_ai] join _grp, ur_ai enableAI "AUTOTARGET", ur_ai setskill 1, ur_ai setCombatMode "RED", ur_ai setBehaviour "AWARE", ur_ai addweapon "AKS_74_kobra", ur_ai addmagazine "30Rnd_545x39_AK", ur_ai selectWeapon "AKS_74_kobra", while {alive ur_ai} do { ur_ai setvehicleammo 1, sleep 0.01
};

hint "Soldier spawned...";

Dunno what I should edit?

zlake

  • Relentless Teamkiller
  • **
  • Posts: 76
  • Killer space clowns. Twas a movie.
    • View Profile
Re: AI Spawn Script
« Reply #37 on: June 07, 2012, 02:55:51 am »
Ok then, make this code into a script or take out the // comments and add to the spawned ai's init.
ur_ai = the name you need to give the ai that you spawn  :icon_thumbsup
Code: [Select]
_grp = creategroup (east);  // Side of a group to make enemy
_grp allowFleeing 0;   // 0 means maximum courage, while 1 means they will fuck off
[ur_ai] join _grp;   // the group ur_ai will join
ur_ai enableAI "TARGET";      // Obvious
ur_ai enableAI "AUTOTARGET";   // More obvius
ur_ai setskill 1;   // set to 1 for maximum skill
ur_ai setCombatMode "RED";   // Makes ur_ai red with anger
ur_ai setBehaviour "AWARE";   // give ur_ai awareness
ur_ai addweapon "MakarovSD";   // give ur_ai a gun
ur_ai addmagazine "8Rnd_9x18_Makarov";  // gives ur_ai some ammo
ur_ai selectWeapon "MakarovSD";   // tells ur_ai to use this weapon
while {alive ur_ai} do { 
ur_ai setvehicleammo 1;      // will give ur_ai unlimited ammo
sleep 0.01;
};
Not actually tested, so try it and let me know  :icon_cool2

No result

Your other code

_group = createGroup east;
[_civilianname] joinsilent _group;
Agros players and zombies

I tired

_group = createGroup enemy;
[_west] joinsilent _group;
[_east] joinsilent _group;

_group = createGroup enemy;
[west] joinsilent _group;
[east] joinsilent _group;

as there is 8 factions and enemy is one of them same result not agroing other players.

Buster

  • Klass Klown
  • ***
  • Posts: 295
  • Kool Kat
    • View Profile
Re: AI Spawn Script
« Reply #38 on: June 07, 2012, 03:11:22 am »
Sorry guys, right now am a little popped up with the amber necter  :icon_teehee
will need to study this tomorrow, can't decide whether it's my head that's fucked or yours  :icon_o_o
Am thinking this is quite simple but I must be wrong  :icon_cry2

zlake

  • Relentless Teamkiller
  • **
  • Posts: 76
  • Killer space clowns. Twas a movie.
    • View Profile
Re: AI Spawn Script
« Reply #39 on: June 07, 2012, 03:18:08 am »
Well I had it sorta working now I cant even get it to do that anymore. So id say mines fucked up atm.

Buster

  • Klass Klown
  • ***
  • Posts: 295
  • Kool Kat
    • View Profile
Re: AI Spawn Script
« Reply #40 on: June 07, 2012, 03:22:35 am »
Ok ffs, lets go right to begining of class boys and girls.  :icon_sly
Do you know how to spawn a unit ?  :unsure
Answer yes/no  :icon_thumbsup

katie1992

  • Intentional Cheater
  • **
  • Posts: 38
    • View Profile
Re: AI Spawn Script
« Reply #41 on: June 07, 2012, 03:23:21 am »
Ok ffs, lets go right to begining of class boys and girls.  :icon_sly
Do you know how to spawn a unit ?  :unsure
Answer yes/no  :icon_thumbsup

No, we don't.
We posted that on the first page because it looked cool.

zlake

  • Relentless Teamkiller
  • **
  • Posts: 76
  • Killer space clowns. Twas a movie.
    • View Profile
Re: AI Spawn Script
« Reply #42 on: June 07, 2012, 03:39:20 am »
Katie I'm looking over http://community.bistudio.com/wiki/createUnit Ill update you if I figure anything out.

Buster

  • Klass Klown
  • ***
  • Posts: 295
  • Kool Kat
    • View Profile
Re: AI Spawn Script
« Reply #43 on: June 07, 2012, 03:55:01 am »
SpawnUnit_command = _this select 0;

SpawnUnit = "USMC_SoldierS_Sniper" createunit [[(getpos player select 0), (getpos player select 1), 50], group player, format["%1", SpawnUnit_command]];

~0.01
deletevehicle SpawnUnit
SpawnUnit = nearestobject [[(getpos player select 0), (getpos player select 1), 50],"USMC_SoldierS_Sniper"];
deletevehicle SpawnUnit
sleep 0.5
deletevehicle SpawnUnit
exit


Try that.
well why post this if you !=wot it means   :icon_cool2

darkrounge

  • Online Villain
  • ***
  • Posts: 166
    • View Profile
Re: AI Spawn Script
« Reply #44 on: June 07, 2012, 04:00:51 am »
I know what it means, else I wouldn't have posted it.
Touch? Motherfucker!

Well, what I'm confused on doing is reestablishing the AI to fire at both; Humans and Zombies.
To which I'm still, to this point, confused.