Placing Units with Lua

GildedDuke

Chieftain
Joined
Jul 3, 2012
Messages
26
I've got some code working as a firetuner button, but I am having trouble adding it to the mod to run on startup. I am trying to place a series of airplanes on carriers at startup, as the mapbuilder doesn't handle carriers well. I previously discussed the problem here http://forums.civfanatics.com/showthread.php?t=493904 .

After some suggestions I got a firetuner button working with
unit = JapanNumber:InitUnit(GameInfoTypes["UNIT_CARRIER"], 73, 51); as its method of placing new units (JapanNumber being the player who is currently playing Japan)

After some suggestions in the other thread, I tried to set this up to run in TurnsRemaining.lua however I think I am doing something wrong. I don't think the file is loading at all, I have tried with just a print command, and that will not even load. When I run the mod now I get a series of " NotificationPanel: Attempt to remove unknown Notification 16" errors in firetuner upon the game starting, with no change or text printed in the log. I have tried with it loaded into both VFS and not loaded into VFS, but it still gives the same notifications.

Is there something that I am missing here? This is my first time doing Lua.
 
Did some further testing, it looks like the Attempt to remove unknown notification error isn't coming from the LUA, but instead it being a scenario with a lot of tech and trade route updates at the start of the game. I'm still not getting any of the prints though, making me think it just isn't being loaded at all (as opposed to thinking it was loaded and bugged before)
 
Back
Top Bottom