Jump to content
XCOMUFO & Xenocide

Loading Maps


Madow

Recommended Posts

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 :(

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 [1]. 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.

 

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.

 

[1] 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).

Link to comment
Share on other sites

and gravity Drool.gif

 

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
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...