senshidenshi
Switched the Red and Blue channels
Hey, senshi, I can code it, and I know precisely what it is. That said, I'm in class right now.
That's fantastic, alright

Hey, senshi, I can code it, and I know precisely what it is. That said, I'm in class right now.
Would anyone be able to help out with this?
-> When unit creates a GW/is expended, surrounding land units gain unique promotion.
I've got this ready, just want to know: any Great Person expended? Or just Writers/Artists/Musicians?
Great, I'll edit the code and post it tonightOh, I know this one!Helps that I designed the unit.
Yeah, it's for a specific unique unit (artist) as opposed to any random GP.
Oh, I know this one!Helps that I designed the unit.
Yeah, it's for a specific unique unit (artist) as opposed to any random GP.
Quick question - is there any way to get when a tile is pillaged?
SerialEventImprovementDestroyedQuick question - is there any way to get when a tile is pillaged?
SerialEventImprovementDestroyed
There is a work-around method that can be deployed to determine the current condition of all improvements, and whether the condition has changed since last checked, but it is not instantaneous in real-time, will really only work for BNW1, will not be useful for affecting or detecting any unit (or player) that just conducted the pillage, and requires persistence of a data-table across game-saves2 as well as some fairly 'hefty' processing every turn3. If any of those are 'concept killers' for you, there really isn't any point to going into any further detail.Quick question - is there any way to get when a tile is pillaged?
Hi I would to know how to test a unit has not moved on their turn (where move = anything that spends a move, so fortify, sleep, nothing, heal, intercept, etc don't count as moves, but attack, set up, move, etc count as one), using lua
I tried to hook PlayerDoTurn, then check has moved, or getmoves, or anything with a move name, and nothing seems like it will work. PlayerDoTurn is called after the units' moves are refreshed apparently.
Do I need to create my own event and find where to trigger it so that the units are not refreshed? or is there a way without dll mods
I made my own hook just so I dont stop dead, but I would still like to know if there was a simple (as in no dll) alternative, like a hook that already exists
function PlayerEndTurn()
local iPlayer = Game.GetActivePlayer()
local pPlayer = Players[iPlayer]
--stuff
end
Events.ActivePlayerTurnEnd.Add(PlayerEndTurn)
You seem to be conflating Game.GetActivePlayer() with whose computer is running the game. Game.GetActivePlayer() will give the ID# of the player currently being processed by the game, and includes all players of all types (human, AI, City-State, Barbarian).hmm, would that fire for every playertype instance or only me, the local client?, the name tells me only local
ie. local only, local client + ais, local client + remote client + ais, local+remote+ais+barbs+city states+whatnot
As far as your last bit, mod "stuff" is only loaded into the game after you press the "NEXT" button in the mods menu. DLL files are added through an 'OnGetDLLPath' Action, but I am not sure when that fires as opposed to XML/SQL/LUA -- I assume it does so before XML, etc. All XML and SQL from all mods load before any LUA code executes. Mod load order can also interplay with mod failures when two or more mods are 'writing' to the same game-data in the database, or are each importing their own version of a standard game-file, such as lua UI files, or the DLL file (though technically this isn't an 'import'). XML in UI <Context> wraps acts quite a bit different than XML in Database <GameData> wraps: <GameData> gets loaded when the game loads the mod, and once in the Database is static except if changed by another mod's conflicting <GameData>; <Context> info is only for UI modding for building the UI panels and pop-ups.can make check then so that the ai benefits if their last turn is on the improv I guess.
new question, I tried to add a new mission button, and it doesnt show at all, I copied MISSION_AIR_SWEEP basically and nothing, and later added Visible 1, gave it a hotkey, a description, created a matching interfacemode
I did a lot of code that more or less makes it work like an air sweep, just slightly different internal rules. But I cant test it because it the button doesnt show up on my air units... what gives, what do I need to do to have the button show up, does it need a unique priority? I see the mission is on the tables, I am just not sure it will show on my planes at all...
hmm ok... nvm... it added the button to goddamn caravans instead of planes, I have 5 buttons, the >> to open next page, and delete on it, my button being the first on the five. Afaik Im testing that the domain is air, so caravans shouldnt cut it..., Hopefully that makes it simple to tell me what Im screwing up...
Got the mission to show as disabled on planes (by just checkign is domain air and testvisible true and leaving early, but when testvisible false I want to actually check if the marked plot is valid (datax and y), i'm using the same code as canAirSweep but it disables the mission...
The interface button still shows up only on the caravan though, its the same cansweep as the mission check but only caravan (ts not even air)
EDIT: Alright finally made the button appear on the planes... and while I know why it works NOW, I still have no idea why the old code did not work THEN. I did several bigger modifications, but the main thing that solved it is that in CvUnits I moved my new logic check above the big switch on CanDoInterfaceMode. Which means that before that the interfacemode was being consumed before it reached its own switch case (and somehow it was being treated as a caravan's interfacemode, becaus eit was showing on caravans of all places)... makes no sense to me but I'll guess it's about the dll loading before my xml entry gets into the database? arent data xmls loaded as soon as you enable the mod? "configuring data" and dlls only after you start a game? whatever, it works like it should now...