DLL - Various Mod Components

OK, you can have an event ;)

Code:
  <CustomModOptions>
	<Update>
	  <Where Name="EVENTS_MINORS_GIFTS"/>
	  <Set Value="1"/>
	</Update>
  </CustomModOptions>

Code:
GameEvents.MinorGift.Add(function(iCS, iMajor, iData2, iData3, iFlags, bOpt1, bOpt2, sType)
  -- iFlags will always be 0 and bOpt2 will always be false
  print(string.format("CS %i gave a gift to %i of %i, %i, %s, %s", iCS, iMajor, iData2, iData3, (bOpt1 and "true" or "false"), sType))
end)
Great! Thank you very much :)
 
When I play Civ5 with 34 civ dll (v.66), YNAEMP, YNAEMP leader fix, and it is my turn to propose something for the World Congress, after I attempt to open the World Congress screen by hitting the button, nothing happens at all.
Here is the error recorded in the Lua Log that appears when I press the button:
[3805585.859] Runtime Error: Assets\DLC\Expansion2\UI\InGame\Popups\LeagueOverview.lua:762: attempt to index local 'buttonControl' (a nil value)
 
V73 is now on my web site and in GitHub

Code:
    <!-- Event sent upon a City State giving a gift (v73) -->
    <!--   GameEvents.MinorGift.Add(function(iMinor, iMajor, iData2, iData3, iFlags, bOpt1, bOpt2, sType) end) -->
    <Row Class="3" Name="EVENTS_MINORS_GIFTS" Value="0"/>

    <!-- Event sent after a civilization moves their capital (v73) -->
    <!--   GameEvents.CapitalChanged.Add(function(iPlayer, iNewCapital, iOldCapital) end) -->
    <Row Class="3" Name="EVENTS_CITY_CAPITAL" Value="0"/>

    <!-- * Fixes the bug of creating a capital from a puppet city, and leaving it that way (v73) -->
    <Row Class="1" Name="BUGFIX_NO_PUPPET_CAPITALS" Value="1"/>
 
The last part I can answer easily. Everyone in the team gets the gift (except for food (doggie bags) and unit gifts), and the player that actually met the CS gets twice the gift
The player who meets does not get the gift twice. (also with your original version of gift mod, not my merged one)
Code:
GameEvents.MinorGift.Add(function(iCS, iMajor, iData2, iData3, iFlags, bOpt1, bOpt2, sType)
    -- iFlags will always be 0 and bOpt2 will always be false
    print(string.format("CS %s gave a gift to %s of %i (amount or ID), %i (friendship boost), %s (if first met), %s (gift)", Players[iCS]:GetName(), Players[iMajor]:GetName(), iData2, iData3, (bOpt1 and "true" or "false"), sType))
end)

The output, when I (pocatello) meet Kysyl is:
[2514737.875] CityStateGreetingPopup: CS Kysyl gave a gift to Pocatello of 12 (amount or ID), 36 (friendship boost), true (if first met), CULTURE (gift)
[2514737.875] CityStateGreetingPopup: CS Kysyl gave a gift to Theodora of 12 (amount or ID), 36 (friendship boost), true (if first met), CULTURE (gift)
[2514737.875] CityStateGreetingPopup: CS Kysyl gave a gift to Maria Theresia of 12 (amount or ID), 36 (friendship boost), true (if first met), CULTURE (gift)

Is this okay, or a bug now?
 
Are there only three players on that team? Are they all human? Is the leader (usually the player with the lowest ID) human or AI?
 
Are there only three players on that team? Are they all human? Is the leader (usually the player with the lowest ID) human or AI?
it is a singleplayer game (can't test in multiplayer).

I'm Pocatello and discovered the CS, my ID should be 0, so I'm the leader.
The other two are ID 1 and 2 I guess, at least they are in the gamesettings slots directly under mine, and they are in my team.
 
I've not changed anything in the gifting code, it's been like that since the code was first written - so if it is a bug it's now an established "feature" ;)
 
Could you make a way to forbid ships through an allied CS located in the isthmus until some technology has been found?

My world map need this setting to forbid ships through Panama City until the Navigation has been found. :mischief:

Thanks in advance!
 
And I found some mistakes in the newest v73:
the AllText_en_US.xml, AllText_zh_CN.xml & AllText_zh_Hant_HK.xml end with "<GameData>" (not the correct </GameData>);)

&#8212; It's my fault to give you the texts with these mistakes before... :cringe:
 
Awww crap! And I even spotted those and corrected them ... guess I did my favourite trick of correcting the MODS sub-directory directly and not the ModBuddy project :blush:
 
Hey :)
I did a promotion, which gives some gold and culture when collecting a goody hut.

I wrote it in lua with your "GameEvents.GoodyHutCanNotReceive" Event.
Now the question is:
1) Does the function called this way have to return true or false? Or is it also okay to not return anything? Or should I return false everytime?
2) When I activate this new promotion and your "Goody Hut - No Auto-Mapping" Mod, will there be conflicts?

I can imagine in the DLL or somewhere you are asking for the returned value of all functions called with that event. So if there is no return, or if the return is one time always false and one time true and false, maybe there are problems?
 
Here's a question: Using only the DLL mod without any components, the influence of hostile city states drops at 2.5 instead of 1.5 per turn. Any chance to fix this or is it intended?
 
Would you please implement Remove Radaring feature from the NQ mod?

"Radaring" means that when you tried to move your civilian unit to invisible location, tiles occupied with other player's unit show as red circle (not movable tile) so you can use this bug like "Map Hack" on singleplayer and even multiplayer.
This reddit post explain how this bug could be fixed.

It would be very nice to players who don't like cheating and of course multiplayer modpacks.
Thank you.

PS. It also would be good if GLOBAL_SEPARATE_GP_COUNTERS option value could be altered as the separate mod.
How it works is much better than other mods and I think more people should know about this cool feaure. ;)
 
V74 sneak peek ... airlift events ... for example, wizards teleporting between their towers ... on in this case ... dwarven units on a mine, can travel via tunnels (ie airlift) to any other mine within 5 tiles

attachment.php


Valid destinations (four of them) outlined in pale blue

The copper mine at the right is not a valid destination, despite being within range, as the tile is occupied

The mines at the bottom (between the deer and the incense, below the iron mine) are not valid destinations as they are too far away
 

Attachments

I wrote it in lua with your "GameEvents.GoodyHutCanNotReceive" Event.
Now the question is:
1) Does the function called this way have to return true or false?
The GoodyHutCanNotReceive event is a "TestAny" (or) event, so should default to returning false - you can always find the default by looking at the pro-forma code in CustomModOptions.xml

Or is it also okay to not return anything?
TestAll. TestAny and Accumulator event handlers must always return something (true, false and 0 are the respective default return values)

Or should I return false everytime?
For a TestAny event handler, yes

2) When I activate this new promotion and your "Goody Hut - No Auto-Mapping" Mod, will there be conflicts?
No.

The DLL calls all registered Lua event handlers for a specific event. For a TestAny event it ORs all the results together, for a TestAll event handler it ANDs them all together and for Accumulator event handlers it sums all the return values
 
@kjh285 - V74 includes the radaring code, and there are three new micro-mods - "Global - No Radaring Exploit (v 1)", "Global - No Science Overflow Exploit (v 1)" and "Global - Separate GP Counters (v 1)"
 
The GoodyHutCanNotReceive event is a "TestAny" (or) event, so should default to returning false - you can always find the default by looking at the pro-forma code in CustomModOptions.xml


TestAll. TestAny and Accumulator event handlers must always return something (true, false and 0 are the respective default return values)


For a TestAny event handler, yes


No.

The DLL calls all registered Lua event handlers for a specific event. For a TestAny event it ORs all the results together, for a TestAll event handler it ANDs them all together and for Accumulator event handlers it sums all the return values
Thank you very much for this detailed answer :)

Are you able to answer these questions too? I'm not sure if this can be done without DLL or at all.
http://forums.civfanatics.com/showthread.php?t=563781
 
Back
Top Bottom