| General | Hosted Sites | Civ5 | CivRev | Civ4Col | Civ4 | Civ3 | Civ2 | Civ1 | Misc | Marketplace |
![]() |
|
|
Welcome to Civilization Fanatics' Center. You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support. |
|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Bytes and Nibblers
Join Date: Nov 2005
Location: Texas
Posts: 10,263
|
I've got this algorithm:
PHP Code:
PHP Code:
Code:
ERROR GiveMilitaristicRewards Montezuma current=11 threshold=10 (free unit) ERROR GiveMilitaristicRewards Montezuma current=11 threshold=10 (free unit) Spoiler:
__________________
![]() We are the Modders. CiV will be assimilated. We will enhance its biological and technological distinctiveness with our own. Resistance is futile. Communitas Expansion Pack Wiki - Discussion - News Forum Icons ~ Starting Civ5 Mods ~ Forum Tables Last edited by Thalassicus; Aug 20, 2011 at 06:15 PM. |
|
|
|
|
|
#2 |
|
Deity
Join Date: Oct 2004
Posts: 2,379
|
I don't have access to your files (and just starting with modding), but spamming more debug-code might help in this case. As far as I can tell the code you posted is correct, but I'm not a LUA-specialist so might be wrong. To verify I'd log the value of 'milRewardCurrent' just before calling SavePlayer(player, "milRewardCurrent", milRewardCurrent), to test whether SavePlayer gets the right value.
If that's ok, then log the value of 'value' inside SavePlayer. If that is also correct, the problem seems to be inside SaveDB.setValue EDIT: Just to be sure: is the bug consistent?
__________________
Never argue with dumb people, they take you down to their level and beat you with experience. FAQs Are Bugs You Haven’t Fixed Yet [Drew McLellan] Last edited by Sengir; Aug 23, 2011 at 04:02 AM. |
|
|
|
|
|
#3 |
|
Deity
Join Date: Oct 2004
Posts: 2,379
|
Tried it myself by loading your mod, but I can't reproduce it. Do you have a save or a sure-fire way to make it happen?
__________________
Never argue with dumb people, they take you down to their level and beat you with experience. FAQs Are Bugs You Haven’t Fixed Yet [Drew McLellan] |
|
|
|
|
|
#4 |
|
Bytes and Nibblers
Join Date: Nov 2005
Location: Texas
Posts: 10,263
|
I haven't been able to replicate the problem; I'm going off a bug report of a user of the mod. It might be there's some secondary problem causing this one, though it's strange it could happen at all... the algorithm seems straightforward. I guess if people keep reporting this bug I'll investigate further.
__________________
![]() We are the Modders. CiV will be assimilated. We will enhance its biological and technological distinctiveness with our own. Resistance is futile. Communitas Expansion Pack Wiki - Discussion - News Forum Icons ~ Starting Civ5 Mods ~ Forum Tables |
|
|
|
|
|
#5 |
|
Deity
Join Date: Oct 2004
Posts: 2,379
|
Hmm, annoying. I suppose the user doesn't have a save either... It is indeed strange that it happens at all, that's why I'm annoyed at not being able to solve it
__________________
Never argue with dumb people, they take you down to their level and beat you with experience. FAQs Are Bugs You Haven’t Fixed Yet [Drew McLellan] |
|
|
|
|
|
#6 | |
|
Warlord
Join Date: Mar 2012
Location: Missouri
Posts: 201
|
~Found your utilities...so question asked and answered~
Quote:
I hate to bug you with such niggling details, but I'm trying to pull player traits for a small mod, and I can't get your method above to work for me. I can't find a GetTrait player method in the API documentation. Is this a function you developed? I tried your other trait pull method, which also doesn't work for me. Code:
local trait = player:GetTraitInfo() Last edited by FramedArchitect; Sep 26, 2012 at 04:00 PM. |
|
|
|
|
|
|
#7 | |
|
King
Join Date: May 2011
Posts: 943
|
Quote:
Player -> Civilization ID (through Player.GetCivilizationType) -> Civilization type (through GameInfo.Civilizations) -> Leader type (through GameInfo.Civilization_Leaders) -> all traits types (through GameInfo.Leader_Traits) References: * Lua and UI Reference (look at GameInfo especially) * Civ5Cvilizations.xml * Civ5LeadersTables.xml Edit: err... The GameInfo content is missing... Well... I will fix this. Basically use things like * GameInfo.Civilizations[civID].Type to get the type from the ID * GameInfo.Civilization_Leaders{CivilizationType = civType}().LeaderType to get the first (and unique) leader for the given civtype.
__________________
Reseed! Preview and regenerate map in-game. Ingame Editor (IGE): An in-game editor for terrain, units, cities, civilizations, etc. Lua and UI reference Last edited by DonQuiche; Sep 27, 2012 at 06:46 AM. |
|
|
|
|
|
|
#8 | |
|
Warlord
Join Date: Mar 2012
Location: Missouri
Posts: 201
|
Quote:
Thal developed above utility to bypass this laborious linking. Btw, love your IGE for its tuner logs. |
|
|
|
|
![]() |
| Bookmarks |
|
| Thread Tools | |
|
|