Outpost Universe Forums
Projects & Development => Outpost 2 Programming & Development => Topic started by: Mcshay on July 20, 2006, 05:43:01 PM
-
I've compiled all of the functions I've wrote to help me code op2 missions into two files to help other people get their missions done faster and easier. I'm going to put the files up here for download to help who ever might want to use them. From time to time I'll update the files with new functions. I've also tried to explain everything as fully as I reasonably can to help new coders get a hold on things, if you need further explaination, feel free to ask me.
File Downloads: Last updated on Tuesday August 8th, 2006
Generic Files:
Op2FF.h - Full Header (http://users.outpostuniverse.net/mcshay/Op2FF/Op2FF.h)
Op2FF.h - Abridged Header (http://users.outpostuniverse.net/mcshay/Op2FF/Abridged%20Header/Op2FF.h)
Op2FF.cpp - Source (http://users.outpostuniverse.net/mcshay/Op2FF/Op2FF.cpp)
Greenworld Files:
Op2FF.h - Full Header (http://users.outpostuniverse.net/mcshay/Op2FF/GreenWorldVersion/Op2FF.h)
Op2FF.h - Abridged Header (http://users.outpostuniverse.net/mcshay/Op2FF/GreenWorldVersion/Abridged%20Header/Op2FF.h)
Op2FF.cpp - Source (http://users.outpostuniverse.net/mcshay/Op2FF/GreenWorldVersion/Op2FF.cpp)
To use the files, download them into the folder where you have your CodeBlocks project file. Then open the project and go to Project -> Add files... then select one of the Op2FF files and repeat for the other. Now both of the Op2FF files should be included in your project when it compiles. Finaly, you need to add the line:
near the top of Main.cpp (I would normaly put in below the line #include <OP2Helper.h>).
Also, read the Notes section of either header file for additional instructions.
I chose to have the functions availiable in this way over a library file (like op2Extra) to let the coder modify the files to their needs, and to remove the dependence on an independent library file.
If you have any functions you would like included in future versions, please talk to me on the irc.
-
Looks pretty good, should be pretty useful to many people :)
You might want to note that the EndGame() function ends the game in success (as if you've just won a multiplayer mission).
-
Thanks for this work :)
-
Today I updated the files.
EndGame would cause an error if you didn't use it in your mission, so I changed some things around (basicaly i had to flip two lines of code, one in the DllMain patch and one in Op2FF.h).
I also made the SetDisasters() function. It will create disasters in your map at hopefuly like in other multiplayer maps if disasters was checked in. However it needs some setup like EndGame. The coder has to change 4 macros in OP2FF.h to reflect the offset for the map ((+31,-1) or (-1,-1)) and the map width and height. The reason for the offsets is also explained.
Edit:
Files updated again to correct a problem in EndGame. It would end the game for everyone, instead of the local player.
I also put a Notes section into Op2FF.h that has important information concerning variables passed to the functions.
-
Added files for GreenWorld (with water) maps. The only new feature for this set of files, is the CheckBridges() function (when a call to it is placed in AIProc), which manages all bridges defined in the header.