Jump to content

Thygrrr

Member
  • Content Count

    169
  • Joined

  • Last visited

  • Medals

Everything posted by Thygrrr

  1. IMPORTANT: Don't use this or any other tools in any way to breach the EULA. Bohemia Interactive is very permissive when it comes to modders, let's give them good reason to keep it this way. Thanks to Dram and Foxhound for giving feedback before I posted this. CarrierTools A work in progress, and its initial version it's really just some random script snippets, but it's all you need to start modding the game! Where can I get it? Can I help? Can I share this? Contributions and forks are welcome, my code is public domain! Download latest revision as ZIP View the repository on Bitbucket pac1.py - data file unpacker What does it do? Carrier Command: Gaea Mission ships with three large data files (data00.cc, data01.cc, and data02.cc), later referred to as PAC1 files, that are mounted as a virtual file system. Like many games, it also supports real files - it's even configured to do so by default, making modding very easy. I took a look at these big files and while I have no access to an Enforce3 SDK, the format is straightforward enough to write a simple reader that can convert it into individual files, which is kind of the prerequisite to modding. This first version of my CarrierTools is just this simple reader! Who can use it? Everyone, if you a) adhere to the EULA, and b) have a rough idea about how install Python and how to run a Python script. How does it work? You need Python 2.7 properly installed. Simply drag the .cc files onto the batch (extract.bat) file, or manually run the python script like so: python pac1.py extract data02.cc [destination] If everything is sufficiently nearby (i.e. you are in the right directory, and your python.exe can be found in your system's PATH), you should end up with a screen full of spam and a directory called data02.cc.unpacked that contains all the files from the package. Browse to your heart's content! New: I have also added a repackaging functionality, that works like this: python pac1.py package mydirectory [destination] How do I make a mod for Carrier Command: Gaea Mission? I am still trying to figure the details out. Maybe the CarrierTools need some extra features first. I have been able to make very basic mods, but they are little more than tests, so I won't share them. Instead, you should experiment and take any content you wish to add / override and place it in the directory where the original data0?.cc files are located. For instance, if you wanted to change the intro video, create a folder video and place an appropriate video named intro.wmv in it. The game should, upon launch, display the new intro video instead of the original one. Is there a way to distribute mods as a package? Yes, but it's a little tricky to install them - and it works differently for steam and non-steam versions. I am still working on improving this process. Put all your mod components into a directory named like you want your mod to be named, and then pack that directory using pac1.py or by dragging that directory onto the package.bat that I conveniently include with the CarrierTools. Put the resulting .pak into your Carrier Command directory. Depending on the version of the game, you need to do different things. (steam)Open the ccsettings.xml that belongs to your player's profile - this is NOT the one in the Carrier Command directory, it's the one where your save games are. Add the line <path directory="mymodname.pak" /> to the top of the filesystems list, replacing mymodname with the name of your mod, obviously. (sprocket/retail) Name your mod patch01.pak (or maybe later) and place that in the Carrier Command Directory. Alternative: on version 1.2, unpack patch00.pak and put the mod into it as well (overwriting the originals), then re-pack.
  2. I stripped the GUTS-API stub from the repo, it was leading me nowhere. Development on CarrierTools will be dormant until a proper patch is out.
  3. Yeah. You should put in some debug test output to see if it really works (it's also not trivial to include your mod, even if it's packaged right)
  4. No you must put your scripts and other modded directories into another directory (e.g. mymodfolder) and package THAT.
  5. "FIDO JE MOCNY" means something like "Fido rules", or "Fido is powerful".
  6. Thygrrr

    Hard Facts of Life

    I just hope they open up the game for modding more and move more native side code to script side code (or at least optionalize it). I don't believe they can fix the AI without a rewrite.
  7. Thygrrr

    Mod Script Findings

    It's a proprietary, interpreted scripting language, with some features resembling C++. I think it's part of the Enforce engine, you don't need a compiler, the game interprets/compiles the script at runtime. No idea why you need a correct definition - Notepad++ will do fine with it, I use it every day. It recognizes the files as either c++ or c, which is not too far off. You may want to add a few keywords/typewords to your style configurator if your as o.c. as I am when it comes to good syntax highlighting: proto native event string class
  8. solrac42, that depends on the weapon. All the turreted weapons (i.e. the ones that require Armor Mk.1) are 360° already. Harbinger Guided Missiles I want guided ordnance for my Walruses. For old time's sake!
  9. This is a freshly terraformed moon. Of course the weather is crazy.
  10. Not sure. It just crossed my mind that the most productive mod (i.e. to find out if the API is solid) would be a stock mod, that means making the vanilla, unmodded game work with the guts API. It probably won't be too hard (I know pretty much exactly the parts I had to rewrite while gutting the game, so I can put in the appropriate recoded functionality on the stock side - but I will need to cut some corners because otherwise I'd have to redistribute a significant portion of the original game code, and I wouldn't want to do that). That means the stock mod will still inherently not be very extensible. So what. :)
  11. Thygrrr

    Mod Script Findings

    https://bitbucket.org/thygrrr/carriertools/ See my thread in this forum in instructions. http://forums.bistudio.com/showthread.php?140967-TOOL-CarrierTools-(modding-tool-inside)
  12. Modding API Framework Added I am nearly done stripping down the game. I decided not to split up some specific files from the stock code, but instead included them. I have pushed the code to the bitbucket repository. Please note: This is a very early WIP. It doesn't have a mod dispatch yet. It's not even nicely documented. (mod dispatch will work by instantiating a custom CGame child class for each mod - still working out a nice way to do this at runtime). When the mod loader API is done, I will provide a minimal mod that tries to spawn an island and a carrier and nothing more, just to ensure I didn't break anything (I have yet to see the game side again - currently, my guts / minimal mod / carrier command total conversion are not playable). ---------- Post added at 23:28 ---------- Previous post was at 23:19 ---------- It's a little late now, I'll clean up the guts code tomorrow. Maybe I can figure out a nice mod dispatch technique soon (i.e. the API loading at least one generic mod at runtime). Game Modes etc. can later be dispatched by the mods themselves if desired.
  13. Thygrrr

    Mod Script Findings

    Okay, and that's all in the "Carrier Command on Windows 7" folder, or is it in some kind of sub folder? (like my steam numbers in the picture I posted). Thanks! ---------- Post added at 20:45 ---------- Previous post was at 19:26 ---------- keyword private There is a "private" keyword. Used on some destructors (to disallow explicit deletion, as it seems). Slightly weird way to do this. ... and another insight: //! Player class Player extends ScriptableCore { //! inspect relationship proto native bool IsEnemyOf( Player other ); //! retrieve in-game name proto native owned string GetName(); }; (the AI representation of Players and other game objects appears to be completely disjunct from the game and visual representations - not entirely sure if that makes sense but it makes our work even harder, because there is an additional layer of abstraction and a black box round trip to native code in the way now) ---------- Post added at 22:35 ---------- Previous post was at 20:45 ---------- Named Types Type("Carrier") returns the class as a type object. Used for type comparisons, and can possibly even be used for runtime instantiations (with the Spawn(...) function call). Still looking for a decent way to execute script code at script runtime (i.e. including additional code and maybe even running a "main" method in there) ---------- Post added at 22:38 ---------- Previous post was at 22:35 ---------- No truly abstract classes Classes that have abstract functions (no function body) can actually be instantiated. I assume the function calls are no-ops in that case.
  14. I enjoyed parts of the FPS mode. It does its job as a storytelling element well. Unfortunately, it doesn't do its job as an FPS well, meaning even the sneaking parts are tedious and the building interiors are very monotonous.
  15. Thygrrr

    Hard Facts of Life

    Sorry to be bursting your bubble here, with a game overdue as long, this is definitely not the publisher's fault, but the developer's and team lead's. CCGM was announced in 2006, if I recall correctly. Usually, a game is announced during or at the end of preproduction, meaning when the actual coding starts. This means the thing was at least three years overdue. If you look at the game's innards, you see three things: a remarkable engine with lots of possiblilities and a very powerful scripting engine lots of stuff that has been inexplicably hardcoded where it shouldn't need to be a pile of scripts that are the most hacked-together, disorganized, scattered, unmaintainable code I have seen in a long time You will also see that probably most of the work was spent on the single player campaign (every .ent file in the data files contains a substantial amount of scripted game code, plus every cutscene XML does, as well). And everywhere you look, so many trivial things are natively hard coded for no apparent reason, I hope it'll be possible to softcode around them in scripts without the game laying dead in the water. I really hope the game can be salvaged by us modders. I do this as a personal enrichment more than with an actual expectation of success.
  16. Thygrrr

    Mod Script Findings

    That directory should not contain any packed files. I mean the profile directory, not the game directory. It should roughly look like this, but I need to know the exact structure:
  17. Thygrrr

    Mod Script Findings

    Cutscenes & Script Code in XMLs Cutscenes use lots of embedded script code that runs in the scope of script.c and the other .c files. This means you CAN programmatically execute code. That means you CAN write a Mod Loader, as long as the mods are non-destructive. I'll cook up a proof of concept. ---------- Post added at 22:13 ---------- Previous post was at 22:12 ---------- Request: Can someone list all the files and subdirectories in their Documents/Carrier Command on Windows 7 folder? ---------- Post added at 22:38 ---------- Previous post was at 22:13 ---------- Keword proto Not exactly what the "proto" keyword is for. I thought it was for pure virtual / abstract methods. This is not true. Fully abstract methods are implemented simply by omitting the method body. The correct derived instance methods are then called.
  18. Thygrrr

    Mod Script Findings

    proto native void SetWidgetEventHandler(widget parent, ScriptedWidgetEventHandler eventHandler); OMG. And there I was wondering if I had to write my own dispatcher for widget events (because ccgame.c registers a somewhat crappy-written global one). This is so powerful. :-) I wonder if the Enforce scripting language can do multiple inheritance. ---------- Post added at 17:51 ---------- Previous post was at 16:10 ---------- Slowly getting there with the gutting. Anyone in need of a half-decent logger can use this thing I just hacked together... //File logger.h //Written by Thygrrr, this file is in the public domain class Logger { int logfile; int padding; //Main utility function, takes a class or NULL from which it automatically derives the ClassName. void log(class source, string message) { string src; if (source) { src = ClassName(source); } else { src = "()"; } string line = ""; int len = strlen(src); //Automatically extend the padding to our new maximum source length. if (len > padding) { padding = len; } for (int i = padding - len; i > 0; i--) { line += " "; } line += src; line += ": " line += message; FPrintln(logfile, line); } //Constructor, takes a sigle filename. The file will be written into the current profile directory. void Logger(string filename) { logfile = OpenFile("$profile:" + filename, FILEMODE_WRITE); log(this, "Logger('" + filename + "')"); } //Destructor void ~Logger() { log(this, "~Logger()"); CloseFile(logfile); } } and put this into script.c near the start, but after proto.h is included. #include "scripts/logger.h" Logger logger; and this at the end int main(string cliparams) { logger = new Logger("global.log"); return 0; } Please note that this doesn't properly destroy the logger object at the end (meaning you will lack one line of log, the last line from Logger itself).
  19. Thygrrr

    Mod Script Findings

    It's crazy. And seeing how the game tanks on metacritic (zero positive critic reviews, as of today), I expect two official patches, tops. And most likely not the clean rewrite the game's scripted part needs. That's why I do it. I hope they open up their multi player functionality in case they crippled it, because if the engine can be convinced to leave it to the script side, it should be possible (not easy!) to build multi player as a community project.
  20. Thygrrr

    Mod Script Findings

    I've moved from trying to refactor the game to thoroughly gutting it. The scripts are full of circular dependencies and some very disadvantageous design "patterns". I should have a "minimal mod" ready this weekend or so, "minimal" meaning you and your (probably empty) carrier at a neutral island. I will have refactored every core component (CGame, CCCampaign, CCPlayer, CCMPmode, CCTelecontrol, IslandModel, _entity and its descendants, etc.) to be cleanly object oriented, and there will be no singletons (except for what proto native GetGame() returns from the engine, and this is only to be used in the entry points for the engine). I will then re-add functionality from the classic campaign parts of the scripts (keeping it clean and separate from the gaea mission stuff, which, under this mod, will be deactivated!). The "gutted" mod will probably be part of CarrierTools. It should help people write clean mods instead of hacks. I will also write a mod installer that works with profiles, making it possible that mods peacefully coexist without blocking each other, by using specifically configured subfolders (on steam, it won't work with the current sprocket/retail versions I'm afraid). This installer will also help us developers to try ot other peoples' mods without damaging or interfering with their own development versions. ---------- Post added at 10:27 ---------- Previous post was at 10:05 ---------- I can't guarantee my mod will work though. Lots of stuff is woven into the engine (seemingly for oftentimes dubious reasons). :)
  21. Thygrrr

    Weapon range table

    Awesome, thanks!
  22. Thygrrr

    [MOD] Island Mod

    A patch01.pak would be better and smaller.
  23. Tages is one of the harshest DRMs, actually. Steam version uses steam DRM, which is very fair and good.
  24. Thygrrr

    Mod Script Findings

    Totally not. :-) Why should we ask random strangers to help us out on something the devs will solve for us soon enough, and better? ---------- Post added at 23:47 ---------- Previous post was at 22:58 ---------- RTTI You can make your type casts safer by querying the RTTI where appropriate to ensure an object is of a certain type: if ( IsInherited( pTarget,Type("Carrier")) ) { Carrier carrier = pTarget; //... do stuff ---------- Post added at 23:50 ---------- Previous post was at 23:47 ---------- Torpedo Fake Damage Well, the damage rules for Torpedos are funny: /! When torpedo hits target void OnTorpedoHitTarget( Projectile pTorpedo, InteractiveEntity pTarget ) { if ( pTarget == NULL ) return; if ( IsInherited( pTarget,Type("Carrier")) ) { Carrier carrier = pTarget; InteractiveRepairZone rz = carrier.GetLocalRepairZone( ECARRIER_ZONE_MANTALIFTS ); if ( rz.GetHealth() > 0.7 ) rz.SetHealth( 0.5, true); else rz.SetHealth( 0, true); rz = carrier.GetLocalRepairZone( ECARRIER_ZONE_WALRUSLEFT ); if ( rz.GetHealth() > 0.7 ) rz.SetHealth( 0.5, true); else rz.SetHealth( 0, true); rz = carrier.GetLocalRepairZone( ECARRIER_ZONE_WALRUSRIGHT ); if ( rz.GetHealth() > 0.7 ) rz.SetHealth( 0.5, true); else rz.SetHealth( 0, true); rz = carrier.GetLocalRepairZone( ECARRIER_ZONE_CRUISEMISSILE ); if ( rz.GetHealth() > 0.7 ) rz.SetHealth( 0.5, true); else rz.SetHealth( 0, true); rz = carrier.GetLocalRepairZone( ECARRIER_ZONE_CONTROLTOWER ); if ( rz.GetHealth() > 0.7 ) rz.SetHealth( 0.5, true); else rz.SetHealth( 0, true); rz = carrier.GetLocalRepairZone( ECARRIER_ZONE_DEFENSE ); if ( rz.GetHealth() > 0.7 ) rz.SetHealth( 0.5, true); else rz.SetHealth( 0, true); rz = carrier.GetLocalRepairZone( ECARRIER_ZONE_OFFENSE ); if ( rz.GetHealth() > 0.7 ) rz.SetHealth( 0.5, true); else rz.SetHealth( 0, true); rz = carrier.GetLocalRepairZone( ECARRIER_ZONE_SUPERSTRUCTURE ); if ( rz.GetHealth() > 0.7 ) rz.SetHealth( 0.5, true); else rz.SetHealth( 0, true); rz = carrier.GetLocalRepairZone( ECARRIER_ZONE_ENGINES ); if ( rz.GetHealth() > 0.7 ) rz.SetHealth( 0.5, true); else rz.SetHealth( 0, true); rz = carrier.GetLocalRepairZone( ECARRIER_ZONE_REPAIRSYSTEM ); if ( rz.GetHealth() > 0.7 ) rz.SetHealth( 0.5, true); else rz.SetHealth( 0, true); } }
×