Home » MODDING HQ 1.13 » Flugente's Magika Workshop » New feature: easily placed extra civilians
New feature: easily placed extra civilians[message #344843] Sun, 03 April 2016 17:20 Go to previous message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
At least in the stock 1.13 maps, sectors are very empty and devoid of civilians. They also don't have to say that much.
This is rather sad. Unfortunately, adding civilians to maps requires the use of the map editor. For someone not used to the editor, this is not a simple task.

For this reason, I've decided to add a new functionality that allows us to create civilians on any map we want much more easily. And while I am known to rant against the usage of LUA more than often (jsut ask the guy's in IRC ;) ), in this case, LUA scripts are the best place to do this (xml being to inflexible in this case).

There is now a new function used in Scripts/strategicmap.lua in HandleSectorTacticalEntry():
...
-- Flugente: if this sector has not yet been liberated by the player, there might be some civilian enemy personnel here
-- the idea is that these people are government employed, and won't stay around once you take the sector
-- parameters of CreateCivilian:
-- - tile where person should be created on the map
-- - civilian group they should belong to (see also CivGroupNames.xml)
-- - bodytype
-- - vest colour (-1 for random)
-- - pants colour (-1 for random)
-- - hair colour (-1 for random)
-- - skin colour (-1 for random)
-- - optional item 1 (-1 for nothing)
-- - optional item 2 (-1 for nothing)
-- - optional item 3 (-1 for nothing)
-- - optional item 4 (-1 for nothing)
	
if ( fHasEverBeenPlayerControlled == false ) then
	-- surface sectors
	if ( bSectorZ == 0 ) then
		-- central SAM
		if ( sSectorX == 8 and sSectorY == SectorY.MAP_ROW_I ) then
			CreateCivilian(16081, CivGroup.RADAR_TECHNICIAN_GROUP, Bodytype.MANCIV, Vest.GREYVEST, Pants.GREENPANTS, -1, -1, 210, 635, -1, -1)
			CreateCivilian(15443, CivGroup.RADAR_TECHNICIAN_GROUP, Bodytype.REGFEMALE, Vest.GREYVEST, Pants.GREENPANTS, -1, -1, 210, 635, -1, -1)
			CreateCivilian(10944, CivGroup.RADAR_TECHNICIAN_GROUP, Bodytype.REGMALE, Vest.GREYVEST, Pants.GREENPANTS, -1, -1, 210, 8, -1, -1)
		-- Drassen SAM
		elseif ( sSectorX == 15 and sSectorY == SectorY.MAP_ROW_D ) then
			CreateCivilian(11297, CivGroup.RADAR_TECHNICIAN_GROUP, Bodytype.MANCIV, Vest.GREYVEST, Pants.GREENPANTS, -1, -1, 210, 8, -1, -1)
...

This function allows creating a custom civilian with user-defined visuals and a few items. In my examples, I've used the idea I had here and added

  • http://i.imgur.com/BkqOotC.png
    radar technicians to SAM sites and airports
  • prison wardens to prisons (complete with gasmask, nightstick and handcuffs)
  • airport staff to airports
  • barrack staff to the Alma barracks
  • scientists to Orta
  • factory workers to factories
  • outspoken civilian supporters of the regime to Balime (you can't tell me they've all fled to Meduna)
  • http://i.imgur.com/GaDuVJg.png
    secretaries to places that seem like they'd have some.
This also includes dialogue. These new civilian groups so far don't do anything unusual (I nevertheless list them in the code, in case we later want special code for them).

In the above example, the civilians are only created when the player has never liberated this sector before - whether you use that is up to you.

This feature can be turned on and off via ALLOW_EXTRA_CIVILIANS in Ja2_Options.ini and is set to be off by default.

This is savegame compatible.

This has been added to the trunk in r8132 & GameDir r2311. Using the new exe without the new GameDir does not cause anything dangerous, for once. It just makes me sad.

[Updated on: Sun, 03 April 2016 17:26]




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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: New feature: combat jeeps
Next Topic: Ancient feature: sexism, racism, cursing the french and other human relations
Goto Forum:
  


Current Time: Mon Dec 02 01:07:24 GMT+2 2024

Total time taken to generate the page: 0.02888 seconds