What problems are they? I can't do c++ much, but my lua isn't too bad.
BTW: when testing scripts for lua, be sure to try some larger files to see if they work. Something above 10kb... My scripts can't load if they reach usually something in the 7-8 kb range. Not sure why, but I must see if others are affected...
If you're willing to help out, I'd be delighted to accept assistance... I'm rather busy atm, and I kind of have this thing about loosely typed programming languages, being that I think they're an abomination. So if you're willing to have a go at cobbling together some functions we'll be needing...
function isPointInside ( point, topLeft, bottomRight )
-- check if point is in the rectangle specified by topLeft and bottomRight
-- return true if it is, false if not
end
function createGroup ( faction, unitType, groupSize, location )
-- the name says it all
end
That's actually all I can think of right now, there will be more though... I want createGroup() to ultimately record 'information' about the group, probably just the 'leader' ID. So we can later test to see if they've made it to a certain waypoint... but I'm not sure what LUA offers in terms of data structures we might store that in... so I'll have to look into it.
I'm suggesting we work within the bounds of what Glest 3.2 offers for this... Let's push it to the limits of what it can do... this will no doubt help give some ideas of what new things would be nice, or what current things are too slow in LUA and may be deserving of more 'help' from the engine.
Making our own 'Fake' (and inaccurate) Timer:The main problem is of course the lack of a timer... but I have a solution, not a fantastic one perhaps, but it's something. It wont work for 'general purpose' scenarios, but for this one it should work fine, because we are taking complete control of the AIs unit creation, and we can assure the human never gets close to the AI 'Base'...
What we'll do is make a new techtree/factions and 'hobble' the computer player's faction. We'll give him a single worker unit at the start of the game, and
no mechanism to create more. We'll be controlling the unit creation for them, so the computer player wont actually need resources, but the AI doesn't know this! We give it 1000 wood and a 1000 stone (or more...), plenty of energy if we are just modifying a magic faction, and 0 gold. The AI will evaluate all this and assign his lone worker to mine gold.
-- with all of the above set up...
<resourceHarvested>
if ( resourceAmount ( "gold", 1 ) > 0 )
-- The AI just collected some gold... this should happen at
-- fairly regular intervals
tick (); -- LOOK AT ME... I'm a crappy TIMER!
-- now take the gold back, to reset for next time...
giveResource ( "gold", 1, -20 );
end
</resourceHarvested>
Should work, but I haven't tested it yet...