The enemy doesn't fight anymore

Post your scripting questions / solutions here

Moderator: Moderators

Manta

The enemy doesn't fight anymore

Post by Manta »

Hi, I just built my first map. At the beginning (when I only had a little room), I added already some enemy soldiers. I compiled the map and everything went fine: They were shooting at me and running around in the room, just as things should be.

But when the map was finished, these same enemy soldiers didn't fight anymore. They didn't move at all (but were still speaking), and I didn't change anything on the AI Properties.

Can anybody tell me why this is so, and what I must do to get the enemy soldiers into action again? Thanks.
Surgeon
Site Admin
Posts: 1386
Joined: Tue Jun 04, 2002 1:15 am
Location: Stirling, Scotland
Contact:

Post by Surgeon »

make sure u have the same map/script name - make sure u still have
exec global\ai.scr near the top of the script file.....
Admin
Image

.map Forums

Truth and Honor.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Check your map name

Post by jv_map »

I'm sorry Surgeon, but the global/ai.scr is completely useless in this case, it can only be used to spawn large number of enemies.

The reason why the enemies don't work is probably because they can't find their animation files. These are included in 'new_generic_human.tik' in pak0.pk3 in the 'models/human/animation' folder. What animations are loaded for which map depends on the map's file name.

I think the easiest way to solve this problem without overwriting the original game files is by putting 'test' or 'utils' before your map name and make sure you don't place the file in a 'dm' or 'obj' folder.

Another solution would be to make your own enemies with their own TIKI files, and manually include the necessairy animations, but this will be somewhat more work.
Mirek
Colour Sergeant
Posts: 77
Joined: Mon Jul 08, 2002 2:12 am
Location: Melbourne, Australia
Contact:

Post by Mirek »

This is kind of a hard question to answer without knowing more detail but if your final map details are exactly the same as when u started ( map and script name) then I sugest that it could just be a spelling or syntax error in your script.
A missing space or a misspelt command, especially if you copy and paste from other scripts it's possible to miss something like a line or the 'end' of a thread.
The most common reason why my maps stop working all of a sudden or only partially work is just that.


Cheers
Mirek
Mapping !!! Who needs sleep anyway !?!?!?
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Even without a script file, the enemy would still attack you. I'm really convinced that when you prefix 'test' to your map name, everything will work fine.
Oddball_Woof
Sergeant
Posts: 74
Joined: Tue Aug 06, 2002 9:32 am
Location: London UK

ummm not necessarily ....so plus SP now has wrong animations

Post by Oddball_Woof »

ermmm pardon me but I tried all the names in the book as well as test_ etc.
never worked on its own for me, check out the wombat new_generic_human.tik advice. By editing it and moving the desired animation higher in tik ALL AIs attack ALL the time, bar me having trouble with MG-gunner and spotter script.....still then you can name it what you like.
They roll to avoid fire, toss nades, run away, investigate noises.........

However I am just in the process of checking whether the altered tik or Jimbo Ultimate SP mod is screwing up my single player....the animations aren't working some scripts aren't happening
Dozens of allies line up on the beach no m1 in hand staring at the sky like
Blithe in Band of Brothers, no bandgalore appears no death animations.....
Mirek
Colour Sergeant
Posts: 77
Joined: Mon Jul 08, 2002 2:12 am
Location: Melbourne, Australia
Contact:

Post by Mirek »

well, I don't know.....

I've only ever made SP maps and all I've ever used is 'test_mapname'.

The only thing that I can not access/get working atm is some level specific animation and dialogs which have not been set up for use with the 'test' map name. Those would need some editting in the animation and sound .src files but they don't effect gameplay and are mostly eye candy.
Apart from that everything works fine for me - All sounds, AI, AI Friendlies, mg42s, alarms, spotlights etc. etc.

I have tried Wombat's new_generic_human.tik idea and renamed my maps with no 'test_' and found that the AI worked good but I then needed to make further changes to other files to get my map sounds to work again.
It would be nice to be able to call my map anything I like but since 'test_" does the job without any other requirements I can put up with that.

Now I am no expert, I just plod along with my little maps but if you can't get your map to work with the 'test_mapname' then I would love to see your map and script to see why it doesn't work or if it works on my system.

Cheers,
Mirek
Mapping !!! Who needs sleep anyway !?!?!?
Oddball_Woof
Sergeant
Posts: 74
Joined: Tue Aug 06, 2002 9:32 am
Location: London UK

Trust me

Post by Oddball_Woof »

All you need is the new_generic_human.tik, theres post about it here somewhere I am sure surgeon or wombat will direct you.
still go to models/human find the new_generic_human.tik and rename it original_new.......tik
Then paste from where it says COPY NOW below, into a txt file
then copy the rest from the original from where it says

//-------------------------------------
// Mission 1
//-------------------------------------
// Intro, fight through town, ambush (Mackey)


and rename it new_generic_human.tik
Nothing to lose by trying :) I am sure it will help.


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
NOW COPY.......
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>




setup
{
ischaracter
}

//=============================================================================================
//=============================================================================================
//
// Level-specific animations
//
//=============================================================================================
//=============================================================================================

$path models/human/animation

$include models/human/animation/scripted/balcony.tik
$include models/human/animation/scripted/table.tik

//my additions:
$include models/human/animation/human_grenade.tik
$include models/human/animation/human_bar.tik
$include models/human/animation/human_thompson.tik
$include models/human/animation/human_pistol.tik
$include models/human/animation/human_mp44.tik
$include models/human/animation/human_rifle.tik
$include models/human/animation/human_mp40.tik
$include models/human/animation/human_bazooka.tik
$include models/human/animation/human_mg42.tik
$include models/human/animation/human_unarmed.tik
$include models/human/animation/human_unarmed.tik
$include models/human/animation/scripted/dead_poses.tik
$include models/human/animation/scripted/fallen.tik
$include models/human/animation/scripted/crate_carry.tik
$include models/human/animation/scripted/hiding_cabinet.tik
$include models/human/animation/scripted/wallclimb.tik
$include models/human/animation/scripted/sleep.tik
$include models/human/animation/scripted/opeltruck.tik
$include models/human/animation/scripted/vent.tik
$include models/human/animation/scripted/alarm.tik
$include models/human/animation/scripted/tank.tik
$include models/human/animation/scripted/workers.tik
$include models/human/animation/scripted/welding.tik
$include models/human/animation/scripted/balcony.tik

$include models/human/animation/scripted/level_m1l1.tik
$include models/human/animation/scripted/level_m1l2.tik
$include models/human/animation/scripted/level_m2l1.tik
$include models/human/animation/scripted/level_m3l1.tik
$include models/human/animation/scripted/level_m4l3.tik
$include models/human/animation/scripted/level_m5l3.tik

$include models/human/animation/scripted/scientist.tik
$include models/human/animation/scripted/set_explosive.tik
$include models/human/animation/scripted/throw_helmet.tik
$include models/human/animation/scripted/flak88_animation.t


//-------------------------------------
// Test maps (every animation)
// Utils is a keyword for Radiant and other tools.
//-------------------------------------
//includes test utils
//{
// NPC weapon animations
$include models/human/animation/human_grenade.tik
$include models/human/animation/human_bar.tik
$include models/human/animation/human_thompson.tik
$include models/human/animation/human_pistol.tik
$include models/human/animation/human_mp44.tik
$include models/human/animation/human_rifle.tik
$include models/human/animation/human_mp40.tik
$include models/human/animation/human_bazooka.tik
$include models/human/animation/human_mg42.tik
$include models/human/animation/human_unarmed.tik


// Level-specific scripted animations
$include models/human/animation/scripted/level_m1l1.tik
$include models/human/animation/scripted/level_m1l2.tik
$include models/human/animation/scripted/level_m2l1.tik
$include models/human/animation/scripted/level_m3l1.tik
$include models/human/animation/scripted/level_m4l3.tik
$include models/human/animation/scripted/level_m5l3.tik

// More scripted animations
$include models/human/animation/scripted/dead_poses.tik
$include models/human/animation/scripted/fallen.tik
$include models/human/animation/scripted/crate_carry.tik
$include models/human/animation/scripted/hiding_cabinet.tik
$include models/human/animation/scripted/interrogation.tik
$include models/human/animation/scripted/jeep.tik
$include models/human/animation/scripted/scientist.tik
$include models/human/animation/scripted/set_explosive.tik
$include models/human/animation/scripted/throw_helmet.tik
$include models/human/animation/scripted/flak88_animation.tik
$include models/human/animation/scripted/prisoners.tik
$include models/human/animation/scripted/lean.tik
$include models/human/animation/scripted/pilot_capture.tik
$include models/human/animation/scripted/wallclimb.tik
$include models/human/animation/scripted/sleep.tik
$include models/human/animation/scripted/opeltruck.tik
$include models/human/animation/scripted/vent.tik
$include models/human/animation/scripted/alarm.tik
$include models/human/animation/scripted/tank.tik
$include models/human/animation/scripted/workers.tik
$include models/human/animation/scripted/welding.tik
//}


Mirek
Colour Sergeant
Posts: 77
Joined: Mon Jul 08, 2002 2:12 am
Location: Melbourne, Australia
Contact:

Post by Mirek »

I just tried it.

Following the above instructions made no difference to my non 'test_' maps but some original single player games and my own 'test_' maps became unplayable.

Anyway, I am very intrigued and if you, Wombat or anyone, could maybe produce a small example SP map that does not use 'test_mapname' and has AI and all the sounds working and does not require for the end user to alter original .pak3 files I would really appricate it as i just can't get it to work.

I mention the .pak3 alteration as I would like for other people to play my maps without having to write a set of advanced instructions for them on how to get the game going.

Cheers
Mirek
Mapping !!! Who needs sleep anyway !?!?!?
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Create your own enemies!

Post by jv_map »

I think the only way to get the AI working without changing original files is just to not use the original files. Create your own TIKI files for your enemies, and manually include all necessary animations. This way you won't need the fancy 'new_generic_human.tik' anymore.

At the moment I can't access the computer on which I have MOH:AA installed because of an OS change, and I can therefore not yet create an example map. If you really want an example, I might do this later.

One more note, about the modified 'new_generic_human.tik', it sure looks like this file loads all animations twice, thereby unnecessarily increasing map load times and needlessly wasting memory.

I'm not sure who created the 'my additions' section, but if you use that modified file, I'd advise you to remove those lines.
Oddball_Woof
Sergeant
Posts: 74
Joined: Tue Aug 06, 2002 9:32 am
Location: London UK

Post by Oddball_Woof »

http://www.Oddball.Woof.dsl.pipex.com/O ... rstmap.zip

This map has been tried successfully on 3 other peoples systems you can copy the new-generic_human.tik from there but leave it extracted.

The AI work fine, though you may have to extract the files rather than leave them in the pk3. Remember the file structure reading is quite sensitive if you have other mods and user.pk3 s they may clash and this maybe part of your problem.

The above map is an early version beta with all the area-portals removed as mbuild/radiant startied introducing errors and I was mid cleaning it up when someone asked me to send it to them so the fps is poor at certain points, there are alot of things eating up processor time alot of Bots all active at once. It was only meant as a test area map.

Believe me until I tried Wombat solution I had the same problem.
I assume you didn't place the altered tik back into the original pk3? leave it in the same file structure but extracted.
Try extracting the global and model/human directories.
Oddball_Woof
Sergeant
Posts: 74
Joined: Tue Aug 06, 2002 9:32 am
Location: London UK

PS

Post by Oddball_Woof »

remember, to start the map use the MP interface it will be listed there.
Try spectaing the krauts go mad trying to kill you and catching their own cross fire get great screen shots

However be aware that altering New_generic_human.tik affects the original SP game play, you will have to replace the original to get the animations working right again.
I have 2 setups of MOH anyway one for editing and testing maps
one for normal playing.
Mirek
Colour Sergeant
Posts: 77
Joined: Mon Jul 08, 2002 2:12 am
Location: Melbourne, Australia
Contact:

Post by Mirek »

Thanks for that Oddball_Woof but unfortunatelly that is not what I was talking about.

The fact that it disables the original game files alone makes it not suitable. As I have seen, some maps are downloaded by hundrerds if not thousands of people, People who's original MOHAA game will stop working. Now try explainning ' New_generic_human.tik ' to someone who doesn't really know what a PAK file is. It's just not an option as far as I am conserned.

Some other problems from a single player point of view as I see it,
- Can't save your current position.
- only one weapon at a time
- killed with a single shot
- can't setup objectives
and I'm sure more I can't think of atm.

I don't know, some people may not care that their MOHAA SP missions don't work anymore but I like MOHAA more for it's SP maps then anything else.

Naming all my maps ' test_whatever ' and having to start them through the consol is a pain but it works and that's what we have atm. Until , if ever, a decent SDK is released I guess that will have to do.

Thanks again, :D
Mirek
Mapping !!! Who needs sleep anyway !?!?!?
Oddball_Woof
Sergeant
Posts: 74
Joined: Tue Aug 06, 2002 9:32 am
Location: London UK

ummmmmmmm

Post by Oddball_Woof »

- Can't save your current position.
- only one weapon at a time
- killed with a single shot
- can't setup objectives
and I'm sure more I can't think of atm.

Since you are in MP you can pick up any weapon around or change weapons like MP, you can place other weapons in map too.
Have you tried my map even?

Single shot kills, depends if you are using realism otherwise no differnt to normal play.

Since its a MP DM you can script obj as any MP map does, if you want you could insert bots to any MP map such as bridge, hunt especially if you had the .map file

Renaming one file to another isn't much of a hard thing to do.
Plus it may depend on the way you've rewritten the new_generic_human.tik, ask wombat, I may have altered it some and by careful editing it may not affect the SP.

Carry on as you are then as I said this has worked for me and many others, check the cardgame thread by wombat . Its a good idea any way to run differnt setups on your machine if you are editing. I have a playing/editing/clean versions you can then check all necessary files are in pk3s and check pk3 clashes...........

Plus by using test_name not all animations are available I believe. not sure about this it was sometime ago I was sorting this out.

Did you even try it? download wombat's version of tik not mine if in doubt.

ANYone who downloads user maps will need to know how to install and run them, the engine its self requires the way we do this, if you include a read.me or create an install/uninstall exe such as jimbos SP mod less worry.
ANY modding of the original game can affect the stability of the game if there is an error, or clash, some pk3 wont work with other, some you need to extract for engine to read the textures or tiks.
Look at all the precache msgs you get, the ubersound problems.
If you want a mod to work sometimes you need to work around stuff.

Far less people than you think will download your map and if you support it properly they won't have a problem if it needs a patch, look at all the servers out there 85% still run only the original maps, its the enthusiasts and clan that use USER maps.

The point is that if you write a SP map in this way properly you in theory can play it online with bots in coop with other players I think that is a cool idea and has more lifetime than a SP map alone has.
Oddball_Woof
Sergeant
Posts: 74
Joined: Tue Aug 06, 2002 9:32 am
Location: London UK

loading animations

Post by Oddball_Woof »

jv_map

As far I as I understand it the animations are called by the scripts and not all loaded at once I might be wrong though

If you want to argue it try talking to all the people that gave me this advice
or who have stacks of experience and understanding which I don't.

surgeon
Kdja
Dr ABAP
tltrude
Balr14
crizz
Wolf-man
Mpowell1944

Since we don't have EA support we have had to work all the stuff out ourselves, try using the experience offered on this and TMT forum.

By the way the SP problems have only just occurred and I haven't gotten to the bottom of it yet, but I have been using the new tik for a couple of months with no problem.
Post Reply