Making changes to the DLL and combining the changes with other DLLs

Question

King
Joined
Mar 12, 2008
Messages
950
Does anyone know how to do this?

I am trying to mod trade routes so that land trade routes have the same 2x multiplier that sea routes get.

I know that the relevant info is in CvTradeClasses.cpp and i have the file open, but how do i make a new DLL and combine it with whoward's DLL (Which im currently using)?

This is the relevant code :

Code:
int CvGameTrade::GetDomainModifierTimes100 (DomainTypes eDomain)
{
	if (eDomain == DOMAIN_SEA)
	{
		return 100;
	}
	else
	{
		return 0;
	}
}

I can easily change return 0 to return 100, but what's next?
 
but what's next?

Nutty's answer ... but ... both my DLL and the CPP DLL already have this functionality, in the form of the TRADE_ROUTE_BASE_SEA_MODIFIER and TRADE_ROUTE_BASE_LAND_MODIFIER <Defines> table entries.
 
Thanks, but im confused. I have whoward's DLL file installed as his DLL - Various mod components mod, but i cant open the .dll in notepad as it just gives me gibberish. So im not sure how to edit the modifiers he mentioned.

Unless you mean im supposed to download the PNM Version 63 DLL on github, edit the .cpp file then compile it for use?

Edit : How do you even download the whole folder from github anyway, rather than each individual file?
 
Everything you need to know about the DLL settings is in CustomModOptions.xml
 
I thought it might be in there, but i checked and i cant find it...unless you put it there under another name?

Line 116: <!-- Trade routes can't be plundered on ocean tiles - too much sea to hide in, too many directions to escape in (v39) -->
Line 234: <!-- Enables additional trade route related traits (v52) -->
Line 235: <Row Class="6" Name="TRAITS_TRADE_ROUTE_BONUSES" Value="0" DbUpdates="1"/>
Line 297: <!-- Scales trade routes based on map size and game speed (v52) -->
Line 298: <Row Class="5" Name="TRADE_ROUTE_SCALING" Value="0" DbUpdates="1"/>
Line 300: <!-- Permits wonder resource (ie Marble) trade routes to be established (v43) -->
Line 301: <!-- See also: "Trade - Marble Shipments" -->
Line 302: <Row Class="6" Name="TRADE_WONDER_RESOURCE_ROUTES" Value="0"/>
Line 574: <!-- Event sent as a trade route is plundered (v52) -->
Line 575: <!-- GameEvents.PlayerPlunderedTradeRoute.Add(function(iPlayer, iUnit, iPlunderedGold, iFromPlayer, iFromCity, iToPlayer, iToCity, iRouteType, iRouteDomain) end) -->
Line 576: <Row Class="3" Name="EVENTS_TRADE_ROUTE_PLUNDERED" Value="0"/>
Line 663: <!-- * Enables the Trade Routes API (v23) -->
Line 664: <!-- See also: "UI - Trade Routes Enhancements" -->
Line 665: <Row Class="2" Name="API_TRADEROUTES" Value="1"/>
Line 686: <!-- * Fixes trade routes sticking to coastal water when the player has the EmbarkAllWater trait (v33) -->
Line 687: <Row Class="1" Name="BUGFIX_TRADE_ROUTES_EMBARK_ALL_WATER" Value="1"/>
Line 694: <!-- See also: "Units - Visible Trade Units" -->

None of those appear to affect land/sea trade route values....

P.S. whoward, you really should set <Row Class="1" Name="BUGFIX_FREE_FOOD_BUILDING" Value="1"/> to 0 by default in your DLL, otherwise it breaks the tradition finisher like i said in another thread.
 
P.S. whoward, you really should set <Row Class="1" Name="BUGFIX_FREE_FOOD_BUILDING" Value="1"/> to 0 by default in your DLL, otherwise it breaks the tradition finisher like i said in another thread.

Tested this the other night, and it works fine, so some other mod you're using must be breaking it.
 
Code:
    <!-- * [B][COLOR="Red"]Push various hard-coded values controlling the game out into XML [/COLOR][/B]- see DB/CONFIG/GameInXml.sql for specific values (v53) -->
    <Row Class="2" Name="CONFIG_GAME_IN_XML" Value="1" DbUpdates="0"/>
    <!-- * [B][COLOR="red"]Push various hard-coded values controlling the AI out into XML[/COLOR][/B] - see DB/CONFIG/AiInXml.sql for specific values (v19) -->
    <Row Class="2" Name="CONFIG_AI_IN_XML" Value="1" DbUpdates="0"/>
 
Thanks, just found the SQL file under the config folder, will test it and see if it works.

I tested the aqueducts again, i enabled the free food building bug fix in your .xml file and i didnt get the free aqueducts. I changed it to 0 and i got the aqueducts. Not sure why it would do that, but is there even any reason to set the values to 1 by default? Wouldnt the relevant mod turn it on by itself?
 
Is there any way to make this into an actual mod though? Or would it have to be the entire DLL package together?
 
Back
Top Bottom