Are these moddable without DLL access?

Valatros

Chieftain
Joined
Apr 10, 2014
Messages
33
The changes I'd LIKE to make to the trade routes require access to the formula, which requires C++, which is so far past what I can cobble together from a class in highschool on visual basic it's not even worth considering. So this is a thread mostly to ask if pursuing these changes, without having to do anything to the formula, is possible. I don't mind having to find some LUA resources and learn a bit, it's part of the fun, but I'd rather know if I'm chasing phantoms going in.

First off, is it possible to create a new variable for International trade routes only, and give a given city only ONE internal trade route, AND one interNATIONAL trade route, with a building? Would discourage/limit the way a large number of trade routes going in or out allow you to ascend to godhood at either science of production.

Secondly, is it possible to re-instate national wonders using existing code, in the vein of "Every city must have a forge/autoplant to build"? I think I remember seeing some things commented out, and I feel a lot of interesting things could be done with these and added quests.

Third, is it possible to create additional wonders in the vein of the Spy Agency? No special requirement, and you can only build one, but each nation gets to build one once it's researched. Things that give a bonus of some sort, that persists through the game.

Fourth, assuming the third is possible, is it possible to attach existing quest/affinity perks to buildings, instead? I expect MAKING something not get attacked by aliens is more complicated then finding a "Attackable by aliens = true" flag, but if I could call on an existing reward, I would like to move the quest reward of invincible trade caravans to a national wonder. Preferably a national wonder that requires ultrasonic fences in every city, but failing that, I'll take one that I can put at the mid game so that early trade routes are dangerous.

I'll likely have more questions along this vein at some point, hell I can think of a couple more already, but those are the only ones where I'm here browsing through the XML files and thinking "Well, uh... hrm. Maybe... but what about... argh I don't freaking know or even know how to go about knowing".

Thanks in advance for any help, even if the help is to just list 1-4 and say Yes/No, it'd be lovely to know which of these are worth an initial shot.

Edit: Bloody hell I posted this in general instead of mod help, if a mod sees this could you shove this over to the other forum please. Could have sworn I was in Modding Help & Creation.
 
Based on what I know of Civ5's DLL and the fact that BE roughly uses similar DLL code, here's what I suspect:

First off, is it possible to create a new variable for International trade routes only, and give a given city only ONE internal trade route, AND one interNATIONAL trade route, with a building?
I highly doubt you can do this with Lua alone; if so, it'll require a lot of weird code. Short version: you'll probably need DLL access.

Secondly, is it possible to re-instate national wonders using existing code, in the vein of "Every city must have a forge/autoplant to build"?
Provided the necessary parts weren't commented out of the Civ5 code, this should be doable with only XML code. Create a new BuildingClass with <MaxPlayerInstances>1</MaxPlayerInstances>, then assign whatever Building you want to that BuildingClass, and voila, done. I don't know about the "must have [building] in every city" part, but having a building requirement for the National Wonder might work this way.

Third, is it possible to create additional wonders in the vein of the Spy Agency? No special requirement, and you can only build one, but each nation gets to build one once it's researched.
That's basically a national wonder, is it not? Yes, you should be able to do it with XML alone, see my answer to the second question.

Fourth, assuming the third is possible, is it possible to attach existing quest/affinity perks to buildings, instead? I expect MAKING something not get attacked by aliens is more complicated then finding a "Attackable by aliens = true" flag, but if I could call on an existing reward, I would like to move the quest reward of invincible trade caravans to a national wonder. Preferably a national wonder that requires ultrasonic fences in every city, but failing that, I'll take one that I can put at the mid game so that early trade routes are dangerous.
I honestly do not know, as I barely know anything about Lua modding in Civ5 and BE. If quests are implemented via Lua code, I don't see why you wouldn't be able to add your own quests to new buildings. Removing existing quests from existing buildings would be a different matter entirely.
 
First off, is it possible to create a new variable for International trade routes only, and give a given city only ONE internal trade route, AND one interNATIONAL trade route, with a building? Would discourage/limit the way a large number of trade routes going in or out allow you to ascend to godhood at either science of production.

It is possible to do this with just XML, all you require is a building set with the
Code:
<NumTradeRoutes>
tag to add a building that increases your trade routes, combine that with adjusting the starting amount a civ gets and you have that one done.

Secondly, is it possible to re-instate national wonders using existing code, in the vein of "Every city must have a forge/autoplant to build"? I think I remember seeing some things commented out, and I feel a lot of interesting things could be done with these and added quests.

Not sure how you would go about adding it as a quest, or how you would get it comparing the number to the amount of cities you currently own, however there is code for it in the CivBEBuildings.xml file

Code:
<Table name="Building_PrereqBuildingClasses">
		<Column name="BuildingType" type="text" reference="Buildings(Type)"/>
		<Column name="BuildingClassType" type="text" reference="BuildingClasses(Type)"/>
		<Column name="NumBuildingNeeded" type="integer"/>
	</Table>

Third, is it possible to create additional wonders in the vein of the Spy Agency? No special requirement, and you can only build one, but each nation gets to build one once it's researched. Things that give a bonus of some sort, that persists through the game.

as stated by Delnar_Ersike this is as simple as inserting a new building with the
Code:
<MaxPlayerInstances>1</MaxPlayerInstances>
line, however make sure you add a new building class for it too, or you will end up with out the ability to build your new building.

Fourth, assuming the third is possible, is it possible to attach existing quest/affinity perks to buildings, instead? I expect MAKING something not get attacked by aliens is more complicated then finding a "Attackable by aliens = true" flag, but if I could call on an existing reward, I would like to move the quest reward of invincible trade caravans to a national wonder. Preferably a national wonder that requires ultrasonic fences in every city, but failing that, I'll take one that I can put at the mid game so that early trade routes are dangerous.

While it is easy to make a building have an affinity prereq, giving it perks would involve using lua to associate it with the PlayerPerks bonuses. There are a number of bonuses a building can have aside from this however, just check the table at the start of CivBEBuildings.xml. If you do want to assign a building an affinity prereq too the code would look like this...

Code:
<Building_AffinityPrereqs>
		<Row>
			<BuildingType>BUILDING_YOUR_BUILDING</BuildingType>
			<AffinityType>AFFINITY_TYPE_SUPREMACY</AffinityType>
			<Level>2</Level>
		</Row>
</Building_AffinityPrereqs>

Edit: This may be easier than i thought to do, having looked back over the buildings file there is actually a direct link to the PlayerPerks options in the form of adding the following line to a building reference
Code:
<FreePlayerPerk>PLAYERPERK_YOUR_BUILDINGS_PLAYERPERK</FreePlayerPerk>
You would need to then add the relevant details into the PlayerPerks entries as well.
 
It is possible to do this with just XML, all you require is a building set with the
Code:
<NumTradeRoutes>
tag to add a building that increases your trade routes, combine that with adjusting the starting amount a civ gets and you have that one done.
The problem is that there's no way to work with differentiating internal and international trade route numbers, hence why I said DLL access is needed. If it's just fiddling around with trade routes as a value, then yeah, XML modding is enough, but the instant you want to start setting different limits for international trade routes and internal trade routes, you'll need DLL access.
 
You know, I think it would be possible todo the trade route limit thing through .lua alone, but it would require overwriting the ChooseInternationalTradeRoutesPopup.lua (don't worry this controls the entire traderoute selection screen, not just international ones).

If you modify to the lua to examine the trade routes already established from the city, and hide the appropriate sections, it would effectively be a soft limit on how many types of traderoutes you could have. You could even branch the system out even more by adding a column to the buildings table for international vs. domestic trade routes, and you could calculate the number of each a city is allowed by examining the buildings present.
 
You know, I think it would be possible todo the trade route limit thing through .lua alone, but it would require overwriting the ChooseInternationalTradeRoutesPopup.lua...
But if you did it that way, those limitations would only apply to the human player.
 
Back
Top Bottom