Posted 09 December 2005 - 11:25 AM
Posted 09 December 2005 - 11:38 AM
And Kratos, I'm sure I owe you a beating with some Floaters
Posted 09 December 2005 - 12:05 PM
In main.lua there is a code that prepares a list of available maps/weapon sets. Check definitions of functions 'AddXcomTerrain' and 'AddEquipment'. There is a log written to 'init-scripts.log' on loading of the game, it lists all the maps/wepoans and their crc32 values. We rely on the fact that it is *very* low probability to get crc32 collision accidently . Also we have 'AddUnit' function which registers different animation types, and can be used as a base for a complete units modding support. And see 'Connect::do_planner' function, it contains code that performs local and remote maps/weapons sets comparison.
Midly-related question - does anyone know where in the code UFO2000 actually detects whether a map/weapon set is available to you or not (i.e no TFTD weapons or maps if you don't have the game installed)? Because I've spent the last hour searching, with no results
You can start from trying to port sectoid/muton/floater/snakeman animation code to lua. There is already animation for 'ethereal' and 'civilian' available (no surprise - they were the easiest animation functions to implement ). Check 'extensions/unit-chameleon' directory.
 Crc32 is not secure though, so replacing it with cryptographical hash function like MD5 or SHA1 is maybe not a bad idea. Anyway, if anyone would try to deceive crc32 check, he will just get synchronization problems when playing the game (and we will also have hard time trying to figure out the source of these bugs), that's not a protections against cheating, it is a protection against synchronization bugs.
PS. To get familiar with lua programming, you can check 'script' directory, there is a collection of scripts written for different purposes and they may serve as examples. To get lua interpreter, you can run 'make tools' to get lua.exe (it is a standard lua interpreter, but with sqlite3 database support compiled in).
Posted 10 December 2005 - 06:47 AM
Thanks for the guidance, although the LUAing of the units might take longer than expected.
Posted 11 December 2005 - 05:24 AM
I'm fairly sure he also invented microwaves and pineapples.
Posted 11 December 2005 - 06:15 AM
would it be possible to release all the current maps in the next release of u2k? would save alot of hassles. And isnt there a terrain file for tftd maps in the map depo?
Edited by Sporb, 11 December 2005 - 06:19 AM.