Quick Modding Questions Thread

Yeah barbs can be tricky, as they have there own set of rules and have all these bits of code in the sdk that do things, so the code may force the barbs back to a default level..

have you tried playing your scenario for a turn or 2 then WB changing the techs and reloading? It may do nothing, but it might just 'avoid' some defaulting bit of code that starts the barbs off with X or no tech?
I can artifficially give the barbarians techs in worldbuilder and the barbarians then have techs for the duration of the game (and seem to research normally, albeit slowly), but when I save that as a WB scenario and reload it again from the start they have 0 again


spaceman98 I'm also interested in solving this one and having a sudden brainwave I think I've found a simple way round it and that's to add a minor civilisation to the game. You open the WB file and add a new team and player.

In this example it's team 16. First add the team and the techs you want
Spoiler :
BeginTeam
TeamID=16
Tech=TECH_MYSTICISM
Tech=TECH_MEDITATION
Tech=TECH_POLYTHEISM
Tech=TECH_PRIESTHOOD
Tech=TECH_MONOTHEISM
Tech=TECH_MONARCHY
Tech=TECH_LITERATURE
ContactWithTeam=16
RevealMap=0
EndTeam


Then you add the player

Spoiler :
BeginPlayer
Team=16
LeaderType=LEADER_BARBARIAN
LeaderName=Barbarian
CivDesc=Barbarian
CivShortDesc=Barbarian
CivAdjective=Barbarian
FlagDecal=Art/Interface/TeamColor/FlagDECAL_ZuluShield.dds
WhiteFlag=0
CivType=CIVILIZATION_BARBARIAN
Color=PLAYERCOLOR_BLACK
ArtStyle=ARTSTYLE_BARBARIAN
PlayableCiv=0
MinorNationStatus=1
StartingGold=200
StartingX=108, StartingY=68
StateReligion=
StartingEra=ERA_RENAISSANCE
RandomStartLocation=false
CivicOption=CIVICOPTION_GOVERNMENT, Civic=CIVIC_HEREDITARY_RULE
CivicOption=CIVICOPTION_LEGAL, Civic=CIVIC_VASSALAGE
CivicOption=CIVICOPTION_LABOR, Civic=CIVIC_SLAVERY
CivicOption=CIVICOPTION_ECONOMY, Civic=CIVIC_DECENTRALIZATION
CivicOption=CIVICOPTION_RELIGION, Civic=CIVIC_PAGANISM
Handicap=HANDICAP_NOBLE
EndPlayer


This seems to work, as long as you make sure that you specify PlayableCiv=0 and MinorNationStatus=1 then as far as I can tell you can't negotiate with that civ and neither can the AI (I think anyway)

Wouldn't this fix Barbarian's starting cities (which you give to team 16) but not the barbs and barb cities that spawn later (which are given to "team 50") or does team 16 overwrite the existing barbarian player? Still, I will try this and see what happens because it seems promising. Thank You!
 
spaceman 98 It depends what you want in your scenario; what this will do is plant a civilisation which is called Barbarian (you could call it anything) at the given spot, from then on will act exactly like the barbarians would in a regular game because you've given them the CivType=CIVILIZATION_BARBARIAN. i.e. they will build workers but not settlers won't build wonders and only certain types of unit, the exact details of what they will not build can be found in the Civ4CivilizationsInfos.xml

Now if you have 'barbarians on' (selected in the custom game screen or by modifying the WBfile) then other 'barbarians' will spawn as normal but they will start as regular barbarians i.e. without the techs. (I imagine they'd even fight the minor civ that's been called 'Barbarians')

For my scenario/mod where I want to plant a few 'barbarian' cities around in WB, give them starting techs, be called in the game 'Barbarians' and from there after act just like barbarians in a regular game, this solution gives what I want. I've actually turned the barbarians off in the WB file so no more will spawn, they'll only start with the cities I've World Buildered for them and go from there.

What I've found happens (similar to what you've found) is that even if you start your game in an era other than ancient the barbarians do indeed start with techs but as soon as you go into WB and save the file... when you reload that WB save as a scenario the barbarians go back to square one... Which is annoying...
 
Creating a player and setting them as barbarian civ type does not make them barbarians.
Of course, they will start with techs defined in the xml file just like any other civ, but other than that, they do not have anything else real barbs do.

Spawning of barb units in unknown areas as you mentioned is one of them.
Alliance with animal units
Repel by great wall
No great general points generated
Barbarian xp combat limit
Tech lvl based on most advanced team
Python commands such as isBarbarian checks
And many more
 
Creating a player and setting them as barbarian civ type does not make them barbarians.
Of course, they will start with techs defined in the xml file just like any other civ, but other than that, they do not have anything else real barbs do...

I understand what you're saying here, a minor civ isn't EXACTLY like barbarians. I take it there's no way of giving barbarians specific techs in a scenario using WB files and .xml files then? I guess you'd have to delve into python sdk dll and such horrors that make my brain do this :run:
 
Unless you want the barbs to be the most advanced nation, what is the issue anyway?
As barbs, even if they start with poor techs, they will get them for free soon anyway based on how advanced the real civs are.
 
Unless you want the barbs to be the most advanced nation, what is the issue anyway?
As barbs, even if they start with poor techs, they will get them for free soon anyway based on how advanced the real civs are.

I played for 30 turns and didn't see the barbs get any techs except agruiculture. The civs are either in the mideval era or, in a few exceptional cases, the classic era (I, the player was in the classical era). When/under what conditions do the barbs get techs?
 
I played for 30 turns and didn't see the barbs get any techs except agruiculture. The civs are either in the mideval era or, in a few exceptional cases, the classic era (I, the player was in the classical era). When/under what conditions do the barbs get techs?

Each round they get (0.03 * (percent of players having this tech)) percent towards each tech (The 0.03 is the global define BARBARIAN_FREE_TECH_PERCENT).
So after 34+some turns (due to rounding) they should have all techs all civs had from the start.
Before that turn, they shouldn't have any techs (or at least not get techs this way).
 
From inside the scenario you could use worldbuilder. In the xml you could create an event that happens immediately on starting that causes a war between countries. things like that.

Changing the handicap can help--<iAIDeclareWarProb> is a tag in HandicapInfo that changes how likely AIs declare war. On chieftain it's 25, on deity it's 100. That would probably help a bit.

and one last thing...BBAI deals with AIs not attacking and other things, it's really useful. you can get it here .

Hope at least one of those helps :goodjob:

Thanks! I just saw this but this should help a lot.



I was hoping someone would be able to help me out with my other question. I have 28 civs in the game and the civ contact bar is longer than the screen, so I can't see the top few civs. Is there a way to add a scroll bar here?
 
Each round they get (0.03 * (percent of players having this tech)) percent towards each tech (The 0.03 is the global define BARBARIAN_FREE_TECH_PERCENT).
So after 34+some turns (due to rounding) they should have all techs all civs had from the start.
Before that turn, they shouldn't have any techs (or at least not get techs this way).

I played up until turn 40. The barbarians did indeed receive techs, but sadly not very many techs. For example they were missing archery and hence failing badly (the rest of the world was around 1400 tech level, the date was approximately 1500, the mod started in 1100 and everybody had archery at start). I could probably balance many of the barbarian cities to minimize the effect of this by giving them ludicrous amounts of starting units, but I still depend on nomads to weaken the minor "natives" faction in the Americas, and to represent resistance to colonialism in non-Andean south America. Nonetheless, thanks for the suggestions! It seems that I will have to delve into the eldritch depth of the DLL :(
 
I played up until turn 40. The barbarians did indeed receive techs, but sadly not very many techs. For example they were missing archery and hence failing badly (the rest of the world was around 1400 tech level, the date was approximately 1500, the mod started in 1100 and everybody had archery at start). I could probably balance many of the barbarian cities to minimize the effect of this by giving them ludicrous amounts of starting units, but I still depend on nomads to weaken the minor "natives" faction in the Americas, and to represent resistance to colonialism in non-Andean south America. Nonetheless, thanks for the suggestions! It seems that I will have to delve into the eldritch depth of the DLL :(

Strange. I thought maybe what I said is only true for techs barbs can research at the moment, but looking at the code, it only checks for canEverResearch().

If you want to look at it yourself, the relevant code is in CvTeam.cpp, search for "BARBARIAN_FREE_TECH_PERCENT".
 
Well, it does make more sense to check can ever research rather than can currently research.
Say all teams have 20 techs more advanced than barbs.
If using current research, x turns later they will only gain 4 or 5 of the starting techs, since they can't progress on those further down the tech tree.
By the time they get all the 20 techs, the real players would have been another 20 techs down the tree.
Which makes them forever useless
 
Well, it does make more sense to check can ever research rather than can currently research.
Say all teams have 20 techs more advanced than barbs.
If using current research, x turns later they will only gain 4 or 5 of the starting techs, since they can't progress on those further down the tech tree.
By the time they get all the 20 techs, the real players would have been another 20 techs down the tree.
Which makes them forever useless

Yes, I didn't want to make a proposal, it was just a thought about what could have went wrong :).
 
How does the first contact text work when adding a leaderhead - got everything working but that. Using something like this:

<TEXT>
<Tag>AI_DIPLO_FIRST_CONTACT_LEADER_MEIJI_1</Tag>

Is that text special?

Edit: found it - can civ4diplomacyinfos.xml be modularized?
 
I have one question, if i have lots of events in my mod (All BTS events + lots off my events), will it slow down my game (Waiting between turns for example) ?
 
I have one question, if i have lots of events in my mod (All BTS events + lots off my events), will it slow down my game (Waiting between turns for example) ?

The game engine checks first to see if there will be an event, THEN runs through the possible events and totals the likelihoods and draws a number from those likelihoods. I don't think it would slow down the game significantly to have a lot of events for this reason.
 
I have one question about python and events:

can i make more similar events from 1 events in CvRandomEventInterface?

example:

PHP:
def My_Event1
	codes from My_Event1
	codes from My_Event1
	.
	.
	UNITCLASS_SPEARMAN
	.
	.
	etc

def My_Event2
	codes from My_Event1
	codes from My_Event1
	.
	.
	UNITCLASS_AXEMAN
	.
	.
	etc

def My_Event3
	codes from My_Event1
	codes from My_Event1
	.
	.
	UNITCLASS_SWORDSMAN
	.
	.
	etc

in all 3 def i will have codes from My_Event1 i will just change units or buildings in def (CvRandomEventInterface)?
 
Back
Top Bottom