CurtSibling
ENEMY ACE™
Great work, sir! So, can you tell us where the image should be stored, and what formats are supported?
Image sizes are best described in pixels.
Image sizes are best described in pixels.
I suppose trial and error is the way to go here. I will try some options - Thanks for showing the text code here.The picture itself is an 8 bit RGB bitmap.
Great work, sir! So, can you tell us where the image should be stored, and what formats are supported?
Image sizes are best described in pixels.
A question about the eventTriggers, file...Do the un-used functions need to be kept in the file? Or can I delete any I plan not to use? Does Lua care?
This is more to have the file clear of chaff and easier to work with.
if true then
-- all the code you don't want to see
end
function triggerEvents.onTurn(turn)
context[getContext()]["onTurn"](turn)
universal["onTurn"](turn)
delay.doOnTurn(turn)
legacy.onTurnEventsAndMaintenance(turn)
if unit.owner == object.tRussians and civ.hasTech(object.tRussians, object.aSovEuropeanFront) then
justOnce("Soviet European Front", function()
civ.ui.text("German observation posts report increased Russian military traffic. The OKW signals for high alert...")
civlua.createUnit(object.uRedArmy, object.tRussians, {{19,33,0},{25,21,0},{27,17,0}}, {count=20, randomize=false, veteran=false})
civlua.createUnit(object.uArtillery, object.tRussians, {{19,33,0},{25,21,0},{27,17,0}}, {count=10, randomize=false, veteran=false})
civlua.createUnit(object.uLightTank, object.tRussians, {{19,33,0},{25,21,0},{27,17,0}}, {count=10, randomize=false, veteran=false})
civlua.createUnit(object.uTB3, object.tRussians, {{19,33,0},{25,21,0},{27,17,0}}, {count=3, randomize=false, veteran=false})
civlua.createUnit(object.uRedArmy, object.tRussians, {{21,41,0},{30,30,0},{36,28,0}}, {count=20, randomize=false, veteran=false})
civlua.createUnit(object.uArtillery, object.tRussians, {{21,41,0},{30,30,0},{36,28,0}}, {count=10, randomize=false, veteran=false})
civlua.createUnit(object.uLightTank, object.tRussians, {{21,41,0},{30,30,0},{36,28,0}}, {count=10, randomize=false, veteran=false})
civlua.createUnit(object.uTB3, object.tRussians, {{21,41,0},{30,30,0},{36,28,0}}, {count=3, randomize=false, veteran=false})
civlua.createUnit(object.uRedArmy, object.tRussians, {{22,46,0},{28,46,0},{39,43,0}}, {count=20, randomize=false, veteran=false})
civlua.createUnit(object.uArtillery, object.tRussians, {{22,46,0},{28,46,0},{39,43,0}}, {count=10, randomize=false, veteran=false})
civlua.createUnit(object.uLightTank, object.tRussians, {{22,46,0},{28,46,0},{39,43,0}}, {count=10, randomize=false, veteran=false})
civlua.createUnit(object.uTB3, object.tRussians, {{22,46,0},{28,46,0},{39,43,0}}, {count=3, randomize=false, veteran=false})
diplomacy.setWar(object.tRussians,object.tGermans)
diplomacy.setVendettaWith(object.tRussians,object.tGermans)
civ.playSound("INFO.wav")
end)
end
Great work, sir! So, can you tell us where the image should be stored, and what formats are supported?
Image sizes are best described in pixels.
civ.ui.loadImage() actually accepts a file path, not just a file name, that will be searched relative to the scenario directory. So to load an image from a subdirectory within the scenario directory, you would just type something like:Many thanks
I've stored the images in the scenario folder.
As for the size of the images: I'm using 242 x 195 pixels
Just wondering if this code looks OK?
local diplomacy = require("diplomacy")
if civ.hasTech(object.tRussians, object.aSovEuropeanFront) then
gen.justOnce("SovietEuropeanFront",function()
civ.ui.text("German observation posts report increased Russian military traffic. The OKW signals for high alert...")
civlua.createUnit(object.uRedArmy, object.tRussians, {{19,33,0},{25,21,0},{27,17,0}}, {count=20, randomize=false, veteran=false})
civlua.createUnit(object.uArtillery, object.tRussians, {{19,33,0},{25,21,0},{27,17,0}}, {count=10, randomize=false, veteran=false})
civlua.createUnit(object.uLightTank, object.tRussians, {{19,33,0},{25,21,0},{27,17,0}}, {count=10, randomize=false, veteran=false})
civlua.createUnit(object.uTB3, object.tRussians, {{19,33,0},{25,21,0},{27,17,0}}, {count=3, randomize=false, veteran=false})
civlua.createUnit(object.uRedArmy, object.tRussians, {{21,41,0},{30,30,0},{36,28,0}}, {count=20, randomize=false, veteran=false})
civlua.createUnit(object.uArtillery, object.tRussians, {{21,41,0},{30,30,0},{36,28,0}}, {count=10, randomize=false, veteran=false})
civlua.createUnit(object.uLightTank, object.tRussians, {{21,41,0},{30,30,0},{36,28,0}}, {count=10, randomize=false, veteran=false})
civlua.createUnit(object.uTB3, object.tRussians, {{21,41,0},{30,30,0},{36,28,0}}, {count=3, randomize=false, veteran=false})
civlua.createUnit(object.uRedArmy, object.tRussians, {{22,46,0},{28,46,0},{39,43,0}}, {count=20, randomize=false, veteran=false})
civlua.createUnit(object.uArtillery, object.tRussians, {{22,46,0},{28,46,0},{39,43,0}}, {count=10, randomize=false, veteran=false})
civlua.createUnit(object.uLightTank, object.tRussians, {{22,46,0},{28,46,0},{39,43,0}}, {count=10, randomize=false, veteran=false})
civlua.createUnit(object.uTB3, object.tRussians, {{22,46,0},{28,46,0},{39,43,0}}, {count=3, randomize=false, veteran=false})
diplomacy.setWar(object.tRussians,object.tGermans)
diplomacy.setVendettaWith(object.tRussians,object.tGermans)
civ.playSound("INFO.wav")
end)
end
-- If the Soviets take a city during their European Front Invasion
if defender == object.tGermany then
gen.justOnce("SovietsAttackGermany",function()
civ.ui.text("Stalin has daringly unleashed a concerted strike upon German positions. He hopes to dislocate any future aggression from the fascists. An inspired move, or potential disaster? Time will tell...")
civ.playSound("RUS.wav")
end)
end
...s\CIV2 TOT\1_Overlords Update\LuaCore\generalLibrary.lua:2759: The Global table doesn't have a value associated with object.
stack traceback:
[C]: in function 'error'
...s\CIV2 TOT\1_Overlords Update\LuaCore\generalLibrary.lua:2759: in metamethod '__index'
...\LuaTriggerEvents\UniversalTriggerEvents\onCityTaken.lua:5: in function 'UniversalTriggerEvents\onCityTaken.onCityTaken'
...OT\1_Overlords Update\LuaTriggerEvents\triggerEvents.lua:239: in function 'triggerEvents.onCityTaken'
C:\CIV2 Games\CIV2 TOT\1_Overlords Update\events.lua:298: in function <C:\CIV2 Games\CIV2 TOT\1_Overlords Update\events.lua:294>
Not sure why - But bow when any city is captured, Lua gives this error:
\LuaTriggerEvents\UniversalTriggerEvents\onCityTaken.lua:5: in function 'UniversalTriggerEvents\onCityTaken.onCityTaken'
local object = require("object")
How can I force the event to kick off on the exact turn the Russians gain this tech? Here is the current trigger code:
Updated the files, and now some extra errors.
function triggerEvents.beforeProduction(turn,tribe)
context[getContext()]["beforeProduction"](turn,tribe)
universal["beforeProduction"](turn,tribe)
delay.doBeforeProduction(turn,tribe) -- at the moment this
-- is an empty function, but we might want to use it,
-- so it is here for future compatibility
end
After moving the code to afterProduction, the event flawlessly triggers at the right moment, but now does not declare war on the Germans...
Does the diplomacy change instruction need to be put somewhere else, I wonder?
function triggerEvents.afterProduction(turn,tribe)
context[getContext()]["afterProduction"](turn,tribe)
universal["afterProduction"](turn,tribe)
delay.doAfterProduction(turn,tribe)
if civ.hasTech(object.tRussians, object.aSovEuropeanFront) then
gen.justOnce("SovietEuropeanFront",function()
civ.ui.text("German observation posts report increased Russian military traffic. The OKW signals for high alert...")
civlua.createUnit(object.uRedArmy, object.tRussians, {{19,33,0},{25,21,0},{27,17,0}}, {count=9, randomize=false, veteran=false})
civlua.createUnit(object.uArtillery, object.tRussians, {{19,33,0},{25,21,0},{27,17,0}}, {count-5, randomize=false, veteran=false})
civlua.createUnit(object.uLightTank, object.tRussians, {{19,33,0},{25,21,0},{27,17,0}}, {count=5, randomize=false, veteran=false})
civlua.createUnit(object.uTB3, object.tRussians, {{19,33,0},{25,21,0},{27,17,0}}, {count=3, randomize=false, veteran=false})
civlua.createUnit(object.uRedArmy, object.tRussians, {{21,41,0},{30,30,0},{36,28,0}}, {count=9, randomize=false, veteran=false})
civlua.createUnit(object.uArtillery, object.tRussians, {{21,41,0},{30,30,0},{36,28,0}}, {count=5, randomize=false, veteran=false})
civlua.createUnit(object.uLightTank, object.tRussians, {{21,41,0},{30,30,0},{36,28,0}}, {count=5, randomize=false, veteran=false})
civlua.createUnit(object.uTB3, object.tRussians, {{21,41,0},{30,30,0},{36,28,0}}, {count=3, randomize=false, veteran=false})
civlua.createUnit(object.uRedArmy, object.tRussians, {{22,46,0},{28,46,0},{39,43,0}}, {count=9, randomize=false, veteran=false})
civlua.createUnit(object.uArtillery, object.tRussians, {{22,46,0},{28,46,0},{39,43,0}}, {count=5, randomize=false, veteran=false})
civlua.createUnit(object.uLightTank, object.tRussians, {{22,46,0},{28,46,0},{39,43,0}}, {count=5, randomize=false, veteran=false})
civlua.createUnit(object.uTB3, object.tRussians, {{22,46,0},{28,46,0},{39,43,0}}, {count=3, randomize=false, veteran=false})
makeAggression
civ.makeAggression(object.tRussians, object.tGermans) -> void
diplomacy.setVendettaWith(object.tRussians,object.tGermans)
civ.playSound("INFO.wav")
end)
end
end
local legacy = require("legacyEventEngine")
local negotiationSettings = {}
function negotiationSettings.negotiation(talker,listener)
legacy.doNegotiationEvents(talker,listener)
--return false
return legacy.canNegotiate(talker,listener)
--return true
end
return negotiationSettings
Tried this, but getting a syntax error...If I cannot get it to work, I might relegate the war declaration to macro events.
makeAggression
civ.makeAggression(object.tRussians, object.tGermans) -> void
civ.makeAggression(object.tRussians, object.tGermans)