Thalassicus / cep-bnw

Civ V Communitas Expansion Pack
32 stars 22 forks source link

Indexing Bugs (Worlds, GameSpeeds, HandicapInfos) #201

Closed skodkim closed 10 years ago

skodkim commented 10 years ago

(formerly IGE incompatible with New Features Build) Hi

I know it isn't an official build but when testing the New Features Build I get the following error from IGE (Ingame Editor):

civ5screen0027

Any ideas?

skodkim commented 10 years ago

Without other mods than CEG I also get errors in lua.log.

Started new game ->founded city->opened tech tree->went to city view->opened production queue->quit game

lua log

GrantSP commented 10 years ago

Ok I'm going to try my sleuthing here.

YieldLibrary.lua line has the attempt to index field '?' (a nil value) error, that means we haven't defined something. CEAI_Events.lua line 786 has an error related to speedinfo MT_Misc.lua has the function Game.GetSpeedYieldMod(yieldID) It has no references to either YieldTypes.YIELD_CS_MILITARY or YieldTypes.YIELD_CS_GREAT_PEOPLE

I am guessing they will need to be added in to the function.

I really hope I am at least 30% right, that would be an improvement. :smiley:

stackpoint commented 10 years ago

Don't worry about new-features not being officially supported since the next build will probably include it. I'll take a look.

stackpoint commented 10 years ago

Okay, so this is probably related to a bug I caused a few builds ago regarding starting a map with a mapsize Duel. What gamespeed did you attempt to start the game with?

GrantSP commented 10 years ago

Looks my strike-rate hasn't improved!

Back to the books for me.

skodkim commented 10 years ago

Marathon (tiny map, deity level, pangaea map, Rome)

stackpoint commented 10 years ago

My table copying code is causing the index 0 entries in the CepWorlds, CepHandicapInfos, and CepGameSpeeds to bug out. So right now the game options:

Are currently bugged. I'm not sure why this is the case though.

stackpoint commented 10 years ago

All other game modes aren't bugged so feel free to use them with the latest build.

stackpoint commented 10 years ago

Okay, so the problem is that the "primary key" and "unique" aren't set (ID, Type). I don't know how to do this using SQL so I may need to just rebuild the table completely using xml.

GrantSP commented 10 years ago

Don't give up so fast. :) Just kidding. I think I may have some ideas on this, let me get back home and I'll have a crack at it.. There are a few ways to get the primary and unique keys to set. I think Thal uses 1or2 methods to do something similar. Have a look at the code, there may something that does what you want already in there.

stackpoint commented 10 years ago

Looks like SQLite doesn't support the ALTER TABLE [table_name] MODIFY ... command: http://www.sqlite.org/lang.html

Looks like I'll be doing this in xml unless you have any ideas @GrantSP. All I need to do is set the PRIMARY KEY and UNIQUE constraints to an existing table.

stackpoint commented 10 years ago

The methods that I've seen in CEP depends on the CREATE TABLE instead of ALTER TABLE.

GrantSP commented 10 years ago

Ahh... There the ones I was thinking about. That's a shame. Sql is so elegant compared xml, IMO.

stackpoint commented 10 years ago

SQLite is missing some key functions for duplicating tables it seems.

GrantSP commented 10 years ago

; (

GrantSP commented 10 years ago

Just a thought as I haven't seen your code yet. Can you DROP the existing tables and then CREATE new ones with the primary and unique keys?

stackpoint commented 10 years ago

I'm trying to make an exact copy of the table so I don't need to DROP the existing table. The problem is automating the copying of the columns and setting the PRIMARY KEY.

stackpoint commented 10 years ago

Should be fixed here: https://github.com/Thalassicus/cep-bnw/commit/691900018b81815821e83e86eb03f093599bf9ad