
Loading Maps
#1
Posted 08 December 2005 - 05:12 AM
#2
Posted 08 December 2005 - 06:26 AM
#3
Posted 08 December 2005 - 06:41 AM
Edit by Kratos: Please refrain from posting piracy links. We happen to keep such policy on the xcomufo boards.
#4
Posted 09 December 2005 - 10:22 AM
#5
Posted 09 December 2005 - 11:25 AM

-Angry Lawyer
#6
Posted 09 December 2005 - 11:31 AM
#7
Posted 09 December 2005 - 11:38 AM
And Kratos, I'm sure I owe you a beating with some Floaters

-Angry Lawyer
#8
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 [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.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

[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).
http://ufo2000.sourceforge.net
#9
Posted 10 December 2005 - 06:47 AM

Thanks for the guidance, although the LUAing of the units might take longer than expected.
-Angry Lawyer
#10
Posted 11 December 2005 - 05:24 AM
I'm fairly sure he also invented microwaves and pineapples.
#11
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.
#12
Posted 11 December 2005 - 07:43 AM
That's the best thing I've read all daySerge INVENTED programming. He's bound to be good at it.
I'm fairly sure he also invented microwaves and pineapples.

-Angry Lawyer