Home » MODDING HQ 1.13 » Flugente's Magika Workshop » New feature: enemy profiles
New feature: enemy profiles[message #320833] Sat, 25 May 2013 23:01 Go to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
Enemy Profiles

A new feature made for the KS campaign is the introduction of enemy and militia profiles (http://www.ja-galaxy-forum.com/board/ubbthreads.php/topics/319379.html). In several new xmls you can define the name, visuals and traits of enemy soldiers and militia. Enemies and militia will then be drawn from these pools. No profile can appear twice at once. If the pool is empty, soldiers are generated as usually.

This gives you the ability to add a bit of personality to nameless grunts.

The traits one specifies are the minimum amount, traitslots left open can be filled from the game. The usual STOMP rules for 3 traits apply (enemies can only get up to 3 traits, and only up to 2 major traits.

This works with new traits only!

There are 6 new xmls in the new folder TableData/Profiles:

  • SoldierProfileEnemyAdmin.xml, SoldierProfileEnemyRegular.xml and SoldierProfileEnemyElite.xml are settings for enemies
  • SoldierProfileMilitiaGreen.xml, SoldierProfileMilitiaRegular.xml an SoldierProfileMilitiaVeteran.xml are the settings for militia.
You can turn this feature on/off via the Ja2Options.ini settings
SOLDIER_PROFILES_ENEMY   = TRUE
SOLDIER_PROFILES_MILITIA = FALSE

The xml settings are:
<PROFILE>
    <uiIndex>1</uiIndex>
    <szName>OMG! This is, like, the longest name ever. Are you serious? That's a lot of space you are using here. This is excessive, isn't it?</szName>
    <uiBodyType>4</uiBodyType>
    <uiHair>5</uiHair>
    <uiSkin>4</uiSkin>
    <uiTrait1>5</uiTrait1>
    <uiTrait2>5</uiTrait2>
    <uiTrait3>19</uiTrait3>
  </PROFILE>

You can add a name as long as you want... but only the first 128 letters will be used. :goodnews: That should be enough I think...
http://i40.tinypic.com/34q4j77.jpg
Yep, that's long enough. Notice we got the correct trait numbers (see table below).

Explanation for the tags:
uiIndex           number of profile, 0 is a template            
szName            name of soldier                                                                  
uiBodyType        body type:                                                                        
                  1: REGMALE                                                                        
                  2: BIGMALE                                                                        
                  3: STOCKYMALE                                                                     
                  4: REGFEMALE                                                                      
                                                                                                    
uiHair            hair colour:                                                                      
                  1: WHITEHEAD                                                                      
                  2: BLACKHEAD                                                      
                  3: BROWNHEAD                                                                      
                  4: BLONDHEAD                                                                      
                  5: REDHEAD                                                                        
                                                                                                    
uiSkin            skin colour:                                                                      
                  1: PINKSKIN                                                                       
                  2: TANSKIN                                                                        
                  3: DARKSKIN                                                                       
                  4: BLACKSKIN                                                                      
                                                                                                    
uiTrait1, uiTrait2, uiTrait3: according to the trait numbers:                                       
                  // MAJOR TRAITS                                                                   
                  AUTO_WEAPONS_NT, // 1                                                             
                  HEAVY_WEAPONS_NT, // 2                                                            
                  SNIPER_NT, // 3                                                                   
                  RANGER_NT, // 4                                                                   
                  GUNSLINGER_NT, // 5                                                               
                  MARTIAL_ARTS_NT, // 6                                                             
                  SQUADLEADER_NT, // 7                                                              
                  TECHNICIAN_NT, // 8                                                               
                  DOCTOR_NT, // 9                                                                   
                                                                                                    
                  // MINOR TRAITS                                                                   
                  AMBIDEXTROUS_NT, // 10                                                            
                  MELEE_NT, // 11                                                                   
                  THROWING_NT, // 12                                                                
                  NIGHT_OPS_NT, // 13                                                               
                  STEALTHY_NT, // 14                                                                
                  ATHLETICS_NT, // 15                                                               
                  BODYBUILDING_NT, // 16                                                            
                  DEMOLITIONS_NT, // 17                                                             
                  TEACHING_NT, // 18                                                                
                  SCOUTING_NT, // 19                                                                
                                                                                                    
                  COVERT_NT, // 20  // major trait, here for coding reasons
                  RADIO_OPERATOR_NT, //21
                  SNITCH_NT, //22
                  SURVIVAL_NT, //23        
Note that applying Technician, Doctor or teaching to the enemy is a bit... useless. Also, the standard soldier AI cannot handle being a covert operative, thus applying COVERT_NT is also not advised. The militia is also forbidden from using radios (that's your job!), and does not snitch, so those traits are also useless here. If you want enemy spies, go here.

Using a 0 for hair/skin/traits will cause this to be generated randomly by the game.

Quite a few of these slots will be filled by Shanga, whom I don't envy for adding >3k datasets :compcuppa: . All those backers will now be immortalized in our sacred SVN, yay! :venus:

This has been in the trunk since r6071.

Edit: As of r2249, edmortimer finally made profiles for militia. If you wonder why we now have so many spanish women shooting us in the back, you can read his thoughts behind this here.

[Updated on: Wed, 03 June 2015 22:30]

Report message to a moderator

Captain

Re: New feature: enemy profiles[message #320840] Sat, 25 May 2013 23:30 Go to previous messageGo to next message
Parkan is currently offline Parkan

 
Messages:438
Registered:April 2010
Location: Russia,Sevastopol

Can i made with such new feature enemy spawning without few traits?Like i dinot want to see enemy with trait bodybuilding.I can remove that skill from enemy skill list?

Report message to a moderator

Master Sergeant
Re: New feature: enemy profiles[message #320841] Sat, 25 May 2013 23:32 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
Soldiers are drawn from this pool until it is empty. If you you define a big enough pool, and define traits for all of them, no slots left, and do not set bodybuilding anywhere, then yes.

Report message to a moderator

Captain

Re: New feature: enemy profiles[message #320842] Sat, 25 May 2013 23:32 Go to previous messageGo to next message
DepressivesBrot is currently offline DepressivesBrot

 
Messages:3653
Registered:July 2009
In theory ... if you create a few thousand profiles with 3 traits each so you don't run out over the course of a campaign.

Report message to a moderator

Captain

Re: New feature: enemy profiles[message #320846] Sat, 25 May 2013 23:37 Go to previous messageGo to next message
Parkan is currently offline Parkan

 
Messages:438
Registered:April 2010
Location: Russia,Sevastopol

Flugente
Soldiers are drawn from this pool until it is empty. If you you define a big enough pool, and define traits for all of them, no slots left, and do not set bodybuilding anywhere, then yes.

How much profiles i must to create to made such traits no appear on enemy\militia?

Report message to a moderator

Master Sergeant
Re: New feature: enemy profiles[message #320847] Sat, 25 May 2013 23:43 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
65 for each xml, so 6 * 65 = 390

Report message to a moderator

Captain

Re: New feature: enemy profiles[message #320848] Sat, 25 May 2013 23:49 Go to previous messageGo to next message
Parkan is currently offline Parkan

 
Messages:438
Registered:April 2010
Location: Russia,Sevastopol

How such feature working on tanks?I asking this because in early version tanks in game with new trait system how i understand always have a bodybuilding trait(so they have a double damage reduction from anything-in skill_settings.ini- tank damage reduction plus damage reduction from bodybuilding)

Report message to a moderator

Master Sergeant
Re: New feature: enemy profiles[message #320849] Sat, 25 May 2013 23:51 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
When creating a soldier, we don't know beforehand if he's supposed to be a tank or not. So tanks get profiles too.

Report message to a moderator

Captain

Re: New feature: enemy profiles[message #320967] Mon, 27 May 2013 03:30 Go to previous messageGo to next message
Lepidosteus is currently offline Lepidosteus

 
Messages:95
Registered:November 2007
Location: Land of Buns.
Flugente
When creating a soldier, we don't know beforehand if he's supposed to be a tank or not. So tanks get profiles too.


Does Bombardier/Machinegunner give any bonus to the tank cannon/mg? Smile

Report message to a moderator

Corporal 1st Class
Re: New feature: enemy profiles[message #323199] Thu, 25 July 2013 02:13 Go to previous messageGo to next message
Fjordsen

 
Messages:12
Registered:July 2007
First off, congrats for implementing such a great feature. I've been waiting for something like that since the game was released!
But apparently, I cannot create more than 100 profiles per xml. If I have more than that, the game crashes to desktop while loading the helicopter dropping off the mercs.

[Updated on: Thu, 25 July 2013 02:14] by Moderator

Report message to a moderator

Private
Re: New feature: enemy profiles[message #323241] Thu, 25 July 2013 21:35 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
It was limited to 100 per xml. While it shouldn't crash if there are more, I've simply increased that number to 300 in r6243. PM me if you increase it even more (the theoretical maximum is 65535, after that I need to change more stuff).

Report message to a moderator

Captain

Re: New feature: enemy profiles[message #323246] Fri, 26 July 2013 00:49 Go to previous messageGo to next message
silversurfer

 
Messages:2791
Registered:May 2009
I think it crashes because there was more data read into lpcBuffer than fits into pData.

pData.maxArraySize = NUM_SOLDIER_PROFILES; (which was 100 before)

So if there are 101 or more profiles in the XML the game will try to put that into a 100 field array which will overwrite some foreign data.
Maybe you should put a comment in the XMLs so people know where the limit is.

Report message to a moderator

Lieutenant
Re: New feature: enemy profiles[message #327114] Thu, 24 October 2013 22:51 Go to previous messageGo to next message
Levitus is currently offline Levitus

 
Messages:5
Registered:October 2013
Location: British Columbia
So I've been playing the crap out of JA2 and just recently discovered this forum and the mod packages post-1.13.

I'm running Depri's latest SCI (6520) and noticed all the names appearing on the enemy NPC's.

I'm just wondering if there is a way for it to pull the individual data for the profiles like it is now with this mod, but not show the names in the tactical map? It sort of makes me feel like I'm playing CS all over again with all these strange names popping up xD

It should still have the names, but just invisible, and perhaps only have it appear if I open dialogue with the enemy soldier to force a surrender, etc.

Not sure if this option is already implemented, but perusing through the options.ini, I can only find a toggle to turn this mode off completely, which I wouldn't want. I'd just want to hide the names until I open dialogue with the enemy soldier.

Is this possible already? How would I do it?

Report message to a moderator

Private
Re: New feature: enemy profiles[message #327116] Thu, 24 October 2013 23:02 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
Hi Levitus, welcome to the pit!

No, you can only turn this off completely. You could, however, simply edit the names in the xmls to all say 'Soldier' (a name showing up multiple times is no problem).

Report message to a moderator

Captain

Re: New feature: enemy profiles[message #327176] Sat, 26 October 2013 02:31 Go to previous messageGo to next message
Levitus is currently offline Levitus

 
Messages:5
Registered:October 2013
Location: British Columbia
Flugente
Hi Levitus, welcome to the pit!

No, you can only turn this off completely. You could, however, simply edit the names in the xmls to all say 'Soldier' (a name showing up multiple times is no problem).



Ah I see! Thank you for the information and for the welcome!

Report message to a moderator

Private
Re: New feature: enemy profiles[message #341333 is a reply to message #327176] Wed, 03 June 2015 22:35 Go to previous messageGo to next message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
As of r2249, edmortimer finally made profiles for militia. If you wonder why we now have so many spanish women shooting us in the back, you can read his thoughts behind this here.

@edmortimer: I removed a few technician/doctor trait entries, cut down on the stealthy and scout traits a bit and added survival (two per xml).



I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.

If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.

Report message to a moderator

Captain

Re: New feature: enemy profiles[message #341340 is a reply to message #341333] Thu, 04 June 2015 05:56 Go to previous message
edmortimer is currently offline edmortimer

 
Messages:1533
Registered:January 2015
Location: Home Free
Quote:
@edmortimer: I removed a few technician/doctor trait entries, cut down on the stealthy and scout traits a bit and added survival (two per xml).


Sounds good!

Report message to a moderator

Sergeant Major
Previous Topic: Deleted feature: poison system
Next Topic: New feature: Campaign History
Goto Forum:
  


Current Time: Sat Nov 30 09:24:28 GMT+2 2024

Total time taken to generate the page: 0.02369 seconds