Blocking Diplomacy?

Riker13

King
Joined
Nov 9, 2001
Messages
853
Location
UK
Dear All,

I want to add an alien race to my own little mod but I don't want any other civ in the game to be able to talk with them or more correctly the alien race wont talk to anyone and also I want the alien race to be constantly at war with all civs.

I know how to add a civ but could some nice person please let me know how I can go about doing the other stuff??

Many Regards

Riker13 :crazyeye:
 
Questions shouldn't actually be in the Tutorials subforum, but no worries, I've asked for this topic to be moved to the main C&C forum.

You could probably do this using a Trait. Create a new flag on the Traits table for your alien civ (default to false, so it doesn't affect existing civs), something like "ConstantWar" or whatever you wish to name it.

Then you could use Lua hooked onto one of the starting game events or the team meeting event (I'm not sure there's a team meet event?). Look for a civ with your new trait flag and if you find one, loop through all other players and declare war on them, then use the set permanent war or peace event (both ways, so neither side can make peace). (If you go with the start game event approach, this will have the side effect of the aliens meeting all other civs on turn 1.)

The alien civ will still have a diplo screen, but since making peace is disabled, they'll only ever say the one kind of thing, so you could replace that message with some symbols to make it look like they're speaking an unintelligible language.
 
Doh! sorry for being in the wrong sub forum :(

But thanks S3rgeus for the help, I`m not good with Lua so I guess I will have to learn can do XML and at a squeeze SQL so if anybody else has something to add that would be good :)

And thanks for the idea about the symbols to make it look like they're speaking an unintelligible language, nice one :)

Moderator Action: Moved to the proper forum.
 
Here's how I would do this (derived in part from our Andean Scenario). The only thing to change is warCivType to whatever civ you desire.

Code:
local warPlayerID	= 0
local warCivType	= "CIVILIZATION_AMERICA"

function DeclareWarOnMeet(iTeamID, iOtherTeamID)
	local warTeamID = Players[warPlayerID]:GetTeam()
	local warTeam = Teams[warTeamID]
	if iTeamID == warTeamID then
		warTeam:DeclareWar(iOtherTeamID);
		warTeam:SetPermanentWarPeace(iOtherTeamID, true);
	elseif iOtherTeamID == warTeamID  then
		warTeam:DeclareWar(iTeamID);
		warTeam:SetPermanentWarPeace(iTeamID, true);
	end
end
GameEvents.TeamMeet.Add( DeclareWarOnMeet )

function Initialize()
	for iPlayer = 0, GameDefines.MAX_CIV_PLAYERS-1, 1 do
		local pPlayer = Players[iPlayer]
		if pPlayer:GetCivilizationType() == GameInfoTypes[warCivType] then
			warPlayerID = iPlayer
			break;
		end
	end
end
Initialize();

Attached is mod file as idea on how to set this up and then use in game; lua file includes helpful print statements. Note that this will declare war on everybody, including CS and allies to CS.
best, FA
 

Attachments

  • DeclareWarOnMeet (v 1).civ5mod
    1.1 KB · Views: 41
FramedArchitect,

Wow that's great many thanks for that I will give it a go in the morning and let you know how I got on.

All the best.
 
FramedArchitect,

That seems to work just fine, tell me will this code disallow ever the possibility of peace with xx nation?

If so then this is all I need :)
 
Top Bottom