Hmm...AI?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
strafer
Captain
Posts: 237
Joined: Sat Jan 31, 2004 11:29 pm
Location: The Motherland..
Contact:

Hmm...AI?

Post by strafer »

Well, I can't find anything in the search about AI so I guess I'll try posting instead. I haven't seen AI in multiplayer so is it possible? I mean the AI like in single player, not bots like jv_map made. If so, does someone know of a map that has AI so I can look at it and get started on it?
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

Post by Master-Of-Fungus-Foo-D »

uhh i think you need to make the maps name test_whatever
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
strafer
Captain
Posts: 237
Joined: Sat Jan 31, 2004 11:29 pm
Location: The Motherland..
Contact:

Post by strafer »

Master-Of-Fungus-Foo-D wrote:uhh i think you need to make the maps name test_whatever
I have no idea what you mean by that. I'm not making my own map if that's what you think. I am trying to do this through server-side scripting.
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

Post by Master-Of-Fungus-Foo-D »

ok... theres the extent of my knowledge
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
strafer
Captain
Posts: 237
Joined: Sat Jan 31, 2004 11:29 pm
Location: The Motherland..
Contact:

Post by strafer »

Master-Of-Fungus-Foo-D wrote:ok... theres the extent of my knowledge
:cry:

Well, thanks for your attempt anyway. 8-)
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

test_mymapame only loads all models and sounds. it does not allow SP AI in maps.
strafer
Captain
Posts: 237
Joined: Sat Jan 31, 2004 11:29 pm
Location: The Motherland..
Contact:

Post by strafer »

lizardkid wrote:test_mymapame only loads all models and sounds. it does not allow SP AI in maps.
Do you know how to add AI in stock maps?
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post by Grassy »

Do you know how to add AI in stock maps?
Yep :D Note this is all Spearhead btw:

I have 6 ai spawned in brest from triggers, 3 axis 3 allies at each end of the map. They move about the map and protect the objective triggers and spawn areas. Then I have two super ai drop in on parachutes packing explosives strapped to them, they head for the enemy spawn areas and also call in artillery aimed at the enemy spawn areas... Heheh
Needless to say it get's intense at times. :shock:

This is all done server side, but the clients need to download a small add in pk3 for ai dialog and skins only.
All the above is spawned into the map, the new scr is put in a standalone pk3 in mainta, when the map is called for the new scr is loaded instead the old one in the stock pk3. For this to work you must follow the same directory and file naming structure as the stock ones.

It can be done, but it took me a long time to sort out bugs and strange behavior, also you need to make a path file for the stock map if it dosn't have one so the ai know where they can move.
Thanks again to bdbodger for the node maker script 8-)

Grassy
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

is it possible to give him a link? :wink:
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post by Grassy »

Link??? There isn't one at the moment our server is at the doctors.
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

what i meant is you told him it was possible and got him all geared up, but never said how to do it. :wink: :wink:
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post by Grassy »

Ahhh... heheheh yeah nasty aint I ? :)

Oh dear maybe I should have kept my mouth shut....
I made it sound easy but in reality trying to explain the whole process is even more difficult..

Firstly the ai I used have modified tiks to include the required anims.
These modified tiks are in the server map mods pack, thus leaving the stock ones alone, they are also in the client side pack with the required skins, as I didn't use stock skins.
Here is what is needed to add to the human models tikis.

Code: Select all

{
	server
	{
	classname Actor
   	american
	setsize "-16 -16 0" "16 16 92"
	health 100
	weapon "M1 Garand"
		
	// Make him mumble but not breathe steam
	exec global/breathe.scr 0 1
	}
}

//
// include the base animations definition
//
//$include models/player/base/include.txt
$include models/human/new_generic_human.tik
$include models/human/animation/dialogue/generic_dialogue_US.tik

/*QUAKED ai_allied_russian_crazy_boris (1.0 0.5 0.0) (-16 -16 0) (16 16 96)
*/
Also he needs to make a path file for the AI to use, without a path file the ai will only move a small distance to keep within the min max distances set for them.

That's the most of the behind the scene stuff, the rest is done via the map script . I spawn the AI into the map the usual way like this...

Code: Select all

  local.al_bomber = spawn models/human/allied_crazy_boris.tik
  local.al_bomber.origin = ($para_start.origin + ( 0 0 -76 ))
  local.al_bomber.angles = ( 0 179 0 )
  local.al_bomber targetname "albomber"
  local.al_bomber.sight = 10000
  local.al_bomber.hearing = 10000
  local.al_bomber.fov = 180
  local.al_bomber.enemysharerange = 6000
  local.al_bomber.leash = 10000
  local.al_bomber.gun = "thompson"
  local.al_bomber.health = 900
  local.al_bomber.noticescale = 50
  local.al_bomber touchtriggers
And then if all else is ok you should be able to issue move commands and stuff like so:

Code: Select all

 wait 1
 $albomber playsound tac_boris
 $albomber runto $radio2

 wait 10
 iprintlnbold_noloc "Crazy Boris has called in an Atillery strike... Run for cover!"
  
 wait 1
 $albomber playsound boris_wohoo
 $albomber thread allies_artillery
Howzat? :)
Grassy
strafer
Captain
Posts: 237
Joined: Sat Jan 31, 2004 11:29 pm
Location: The Motherland..
Contact:

Post by strafer »

:)

Thanks for all of your help. I just have time to look at the replies. I will have to test it later. I will keep you updated on if it works and if I need help.
Post Reply