Home » MODDING HQ 1.13 » v1.13 Modding, Customising, Editing » v1.13 Modding, Customising, Editing » LUA scripting: making CIV_GROUP NEUTRAL again
LUA scripting: making CIV_GROUP NEUTRAL again[message #364507] Mon, 21 March 2022 20:47 Go to next message
Grumpy

 
Messages:21
Registered:December 2021
Is there any "easy" way of making a certain CIV_GROUP and their RPCs/NPCs NEUTRAL again?

Perhaps by inserting a script into earlymorningevents in StrategicEventHandler.lua or elsewhere?

I am in an extended play through of UC113 and the PIN group (Kingpin) turned immediately hostile on me after finishing conversation with him the first time (there is a few bugs like that there I think). Makes giving him the "chalice" or recruiting Conrad impossible, and I'd rather not start over. Tried playing with Facts in F11 debug screen to no luck.

I had a look at the SetCivGroupHostile function, but frankly, I can't get my head around using it properly...

Thanks!

Report message to a moderator

Private 1st Class
Re: LUA scripting: making CIV_GROUP NEUTRAL again[message #364509 is a reply to message #364507] Mon, 21 March 2022 23:07 Go to previous message
Grumpy

 
Messages:21
Registered:December 2021
Ah, sorry, had a bit deeper delve into the source and lua scripts, and found an easy solution after all. I'll just leave it here in case anybody else runs into a similar problem (backup files first).

I (mis)used the ExplosionControl.lua in /Data-1.13/Scripts, since there is a direct function to make Kingpin faction hostile upon setting off an alarm ("Kingpin alarm", ActionID == 13).

I just changed Civ_status.CIV_GROUP_HOSTILE to Civ_status.CIV_GROUP_NEUTRAL in that function and commented out the following loop to set any present Kingpin men hostile to player upon the action, like this:

SetCivGroupHostile( Group.KINGPIN_CIV_GROUP , Civ_status.CIV_GROUP_NEUTRAL )
		
		--for iLoop = GetTacticalStatusFirstID(Team.CIV_TEAM),GetTacticalStatusLastID(Team.CIV_TEAM) do
			--if ( CheckMercPtrsInSector (iLoop) == true and CheckMercPtrsInActive(iLoop) == true and CheckMercPtrsInCivilianGroup (iLoop) == Group.KINGPIN_CIV_GROUP ) then
				--for aimLoop=GetTacticalStatusFirstID(Team.OUR_TEAM),GetTacticalStatusLastID(Team.OUR_TEAM) do
					--if ( CheckMercPtrsID1SeenID2(iLoop,aimLoop) == SEEN_CURRENTLY ) then
					--	MakeMercPtrsHostile( iLoop )
					--end
					--end	
			--end	
			--end

Loaded the game and just went and deliberately stepped on a Kingpin alarm action item, the whole faction reset to NEUTRAL upon exiting the current sector in tactical view. Save, exit the game, revert the Lua changes (so we can make them hostile as intended during normal play). So far, it seems to have worked well no unintended quest consequences, can recruit Conrad again, no existing Facts changed. Nice!

I guess similar one-time edit could be done if you accidentally turned UC113 Gun Runners hostile when one of their detailed profile NPCs attacked you (there are a few including Smirnoff NPC in L14 who are erroneously set as Enemy faction instead of Civilian in the map files, resulting on attacking you on sight, instead of being neutral and open to dialogue) I believe they are set up as HICKS_CIV_GROUP in the UC113 mod.

Report message to a moderator

Private 1st Class
Previous Topic: Editing EDT
Next Topic: Cannot locate mapeditor.exe [FIXED]
Goto Forum:
  


Current Time: Sat May 17 11:29:52 GMT+3 2025

Total time taken to generate the page: 0.00422 seconds