Need help in order to script some civilians......

Post your scripting questions / solutions here

Moderator: Moderators

Tod001
Major
Posts: 294
Joined: Sat May 06, 2006 1:23 pm
Location: Shack in the woods,VA
Contact:

Need help in order to script some civilians......

Post by Tod001 »

What is the best way for me to make some civilians to inhabit some of my multiplayer/ bot maps?

Can I just spawn some unarmed bots, and make run from everybody?
Broadus
Captain
Posts: 235
Joined: Mon Jan 30, 2006 5:35 am

Post by Broadus »

Well, I don't know about making them run away. Standard AI won't run in terror if they get shot at.
I'm sure there's some sort of script (or maybe you could make your own?) where they'll try to stay a certain distance from players, or you could make it so that, when a player moves into a specified area, the AI will run to specified points in another area.

As for the best way to make them just be civilians... Spawning unarmed bots will make them stare at players. You could disable their AI, which should stop them from staring at players. Of course, in a warzone, they might look a bit more realistic if they're in their alert, AI-enabled state, looking at players constantly.

I'm assuming you'll want the AI to be invincible, so just slap some nodamage on them. If you don't make them invincible, they'll all be dead in the first two minutes, because lots of players get their sick kicks by killing teammates or anyone who's unarmed in video games. Ever played Half-Life? Many a Barney and a Scientist have been crowbarred to death in Black Mesa by the oh-so-terrible Gordon Freeman.
If you'd like the civilians to be killable by all players, you'll have to set them to a team other than Allies and Axis. Americans and Germans are the usual AI teams, though I'm not sure if that would be any different. I think Spectator is a team, too. No idea.
I found this in m1l2a.scr. It was never used, so I'm not sure if it will do anything, but it seems to imply some sort of team-changing.
level.friendly3 german
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

there are only two (known) sides to MOH, american and german. however jv just found a third difficulty so i wouldn't put it past them to have another faction.

and they're commands,

$guy american
$guy german

side note: you can make the player german too.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Tod001
Major
Posts: 294
Joined: Sat May 06, 2006 1:23 pm
Location: Shack in the woods,VA
Contact:

Post by Tod001 »

Thank you for your input.....
I have only just started to learn MOH.
I have learned scripting in LUA from modding the game Blitzkrieg, I have learned to script for Vice City.

What I am after is civilians for some crowded street scenes.
I once mistakingly put a custom skinned bot into the game with a messed-up tiki. I assume he had standard AI, for he would attack all players reguardlees of the team that they were on.
If I could do that again but, instead of attacking players, running a certain( random) distance away.
Still thinking..................
Tod001
Major
Posts: 294
Joined: Sat May 06, 2006 1:23 pm
Location: Shack in the woods,VA
Contact:

Post by Tod001 »

oops. :oops:
Last edited by Tod001 on Fri May 12, 2006 5:50 pm, edited 1 time in total.
Tod001
Major
Posts: 294
Joined: Sat May 06, 2006 1:23 pm
Location: Shack in the woods,VA
Contact:

Post by Tod001 »

What about making regular bot civilians to walk around the map? Possibly hide from the nazi's when they see then coming?
Hmmm.....
too much processor use ,and not enough animations.i dont recall seeing any "scared" and "fleeing" animations .
maybe for single player ,but then again why use bots? while the AI can do it for less processor usage
AI then........hmm....
Still stumped for now....
Let me keep reading all the tut's and forum's....
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Useing

$ai_targetname exec global/disable_ai.scr

will make the ai ignore enemies and anything else but bots will still shoot at them . There is a command

$ai_targetname threatbias 0

that should make them be ignored by the bots in theory . You would still need a script that determines where they run to and when .
Image
Tod001
Major
Posts: 294
Joined: Sat May 06, 2006 1:23 pm
Location: Shack in the woods,VA
Contact:

Post by Tod001 »

Thank you,
I am still trying..
Broadus
Captain
Posts: 235
Joined: Mon Jan 30, 2006 5:35 am

Post by Broadus »

Actually, Spectator is a team, in multiplayer at least. I've got a script for driveable tanks that ensures that the Spectator team won't be able to drive the tanks.
When I said disable_ai, I just meant that so the AI wouldn't try to fight their enemies, or look like they wanted to.
Also, threatbias 0 is the standard threatbias. AI with threatbias 0 or even threatbias -999999 will still be attacked. Threatbias ignoreme is what will stop AI from being targeted as enemies.
Image
Tod001
Major
Posts: 294
Joined: Sat May 06, 2006 1:23 pm
Location: Shack in the woods,VA
Contact:

Post by Tod001 »

Good info, thanks.
I need to learn more...... :wink:
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Notice there is a distinction between team and dmteam.

team
Property of: Sentient (Actor or Player)
Values:
  • american
  • german
dmteam
Property of: Player
Values:
  • allies
  • axis
  • spectator
Cannot be used in g_gametype 0 (single player).

models/player/base/include.txt specifies the player as an american (even when using a german skin).
Image
Tod001
Major
Posts: 294
Joined: Sat May 06, 2006 1:23 pm
Location: Shack in the woods,VA
Contact:

Post by Tod001 »

Please forgive my lack of experience but,,,,,,,
Can spectator be used as a third team?
Tod001
Major
Posts: 294
Joined: Sat May 06, 2006 1:23 pm
Location: Shack in the woods,VA
Contact:

Post by Tod001 »

//
// include the base player model definition
//
}
$include models/player/base/include.tx


$include models/human/multiplayer_generic_human.tik
$include models/human/animation/dialogue/generic_dialogue_german.tik

/*QUAKED ai_multiplayer_german_axis_chav (1.0 0.5 0.0) (-16 -16 0) (16 16 92)
*/

So this "bot" will be regarded as an American, even though it's tik. is named
"multiplayer_german_chav"?
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Err yah.. but normally bot TIKIs don't include the player base def :?
Image
Tod001
Major
Posts: 294
Joined: Sat May 06, 2006 1:23 pm
Location: Shack in the woods,VA
Contact:

Post by Tod001 »

I learned to just paste something like this:
$include models/human/multiplayer_generic_human.tik
$include models/human/animation/dialogue/generic_dialogue_german.tik

/*QUAKED ai_multiplayer_german_axis_chav (1.0 0.5 0.0) (-16 -16 0) (16 16 92)
*/
, to the end of a normal "player" tik. , then I add "multiplayer" to the tik.'s name. Then I add the new tik. to your Models/Human folder in the BotsPAK to have a new custom skinned bot for my game.

YA, ya ,ya "paste"= "script kiddie" but, I have to reverse engineer and disassemble your tech. to be able to learn for myself without anyone sitting here to guide me. :wink:
Post Reply