- Joined
- Jan 24, 2011
- Messages
- 4,801
I'm trying to be a good "resource requester" and actually finish this so everyone's help can be put to good use. I think I have the reactions more or less where I want them. I did get this error but seem to have cleared it by not allowing units to react from airfield terrain:
[CODE
D:\Test of Time\Scenario\Midway\events.lua:960: bad argument #1 to 'pairs' (table expected, got nil)
stack traceback:
[C]: in function 'pairs'
D:\Test of Time\Scenario\Midway\events.lua:960: in upvalue 'reHomePayloadUnit'
D:\Test of Time\Scenario\Midway\events.lua:2336: in upvalue 'doOnActivateUnit'
D:\Test of Time\Scenario\Midway\events.lua:390: in upvalue 'runDoOnActivateUnit'
D:\Test of Time\Scenario\Midway\events.lua:1136: in function <D:\Test of Time\Scenario\Midway\events.lua:995>
[/CODE]
However I am having a major issue with getting the reinforcements to show up after loading a saved game. These had worked previously so I'm not sure what I messed up to change things. I have an idea (see below) but so you understand where I'm coming from, what I would do is play a hotseat game against myself and save, exit the game, and reload each player's turn to replicate a true PBEM.
On turn 1, each player is asked to choose where their reinforcements will arrive. On a random turn after that, reinforcements should show up. Yet, they don't. I never tested it this way until now so I don't know if they ever did. I'm attaching the entire scenario files in case someone can help me figure this last thing out. Aside from if I find any bugs, I think once this is done, I can release the scenario or at least public ally make it available for playtest, but this is a critical error, so if anyone can help I appreciate it.
Anyway... Since it functions with state I am hoping that the below would correct it:
Does this too all need to be referenced here:
?
I have it here:
Any help would be greatly appreciated so I can wrap this one up. Thanks!
[CODE
D:\Test of Time\Scenario\Midway\events.lua:960: bad argument #1 to 'pairs' (table expected, got nil)
stack traceback:
[C]: in function 'pairs'
D:\Test of Time\Scenario\Midway\events.lua:960: in upvalue 'reHomePayloadUnit'
D:\Test of Time\Scenario\Midway\events.lua:2336: in upvalue 'doOnActivateUnit'
D:\Test of Time\Scenario\Midway\events.lua:390: in upvalue 'runDoOnActivateUnit'
D:\Test of Time\Scenario\Midway\events.lua:1136: in function <D:\Test of Time\Scenario\Midway\events.lua:995>
[/CODE]
However I am having a major issue with getting the reinforcements to show up after loading a saved game. These had worked previously so I'm not sure what I messed up to change things. I have an idea (see below) but so you understand where I'm coming from, what I would do is play a hotseat game against myself and save, exit the game, and reload each player's turn to replicate a true PBEM.
On turn 1, each player is asked to choose where their reinforcements will arrive. On a random turn after that, reinforcements should show up. Yet, they don't. I never tested it this way until now so I don't know if they ever did. I'm attaching the entire scenario files in case someone can help me figure this last thing out. Aside from if I find any bugs, I think once this is done, I can release the scenario or at least public ally make it available for playtest, but this is a critical error, so if anyone can help I appreciate it.
Anyway... Since it functions with state I am hoping that the below would correct it:
You haven't 'linked' the state table to log.lua.
In Events.lua, you want something like
Code:state.logState= state.logState or {} log.linkState(state.logState)
Does this too all need to be referenced here:
Code:
civ.scen.onSave(function ()
print(type(state))
return civlua.serialize(state)
-- return lualzw.compress(civlua.serialize(state))
end)
?
I have it here:
Code:
civ.scen.onLoad(function (buffer)
...
state.logState= state.logState or {}
log.linkState(state.logState)
end)
Any help would be greatly appreciated so I can wrap this one up. Thanks!