View unanswered posts | View active topics It is currently Thu Nov 28, 2024 11:25 am



Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
 Bunker Systems Request 
Author Message

Joined: Thu Apr 18, 2013 8:29 pm
Posts: 11
Reply with quote
Post Bunker Systems Request
Hello, I am very new to modding and I am currently learning how to mod with the code in CC. However, I am looking for help in how I could create 1 new object, and alter another. These are my objectives:

-In "Bunker Systems" Create another hanger that is 1-2 "blocks" wider and 4-5 "blocks" taller (This is because a standard drop ship cannot fit through a vanilla "hanger").

-In "Bunker Systems" Alter the "Drop Ship Dock" so that if a ship is set to "stay" and is right under the dock, it will stay completely still and not give off any flames, until given any other pie menu command (Deliver Cargo, Return, etc), at which point it will create thrust and be able to move away from the dock.

Any advice in coding would be appreciated, and I would appreciate it even MORE if someone was able to do this for me.

Thank you!


Sun Jan 08, 2017 10:41 pm
Profile
User avatar

Joined: Wed Jul 06, 2011 5:11 pm
Posts: 226
Reply with quote
Post Re: Bunker Systems Request
Not sure how to do the thing with the dropship but making the bunker modules is easy enough just using paint. Copy the image files in Base.rte for the bunker pieces you want to modify and edit them appropriately. There should be an FG, BG, and MAT file for the modules.

It's all pretty self explanatory but FG is what shows in the Foreground, BG is what shows in he Background of the module be it the empty space or where particles destroy any parts in the foreground. MAT tells the game engine what material to make the module out of. Every material in CC has an assigned color value. You can see all this in Base.rte/Materials.ini. The ones in default bunker modules are probably concrete and rock (I could be wrong here) and background space (dark purple) which is not the same as leaving the spot blank (magic pink).

Once you have your image files edited and saved properly in the Cortex Command color pallet, put all your files in their own folder, name it something cool like BestModules.rte or something. Now you need to tell the game where your images are. All you need is an .ini file. You could create a new one or copy one with bunker modules already in it from Base.rte. Put that .ini file in your folder with your images.

This is what the TerrainObject code looks like. This is generally how CC creates bunker modules. You want something like this in your .ini file.
Code:
AddTerrainObject = TerrainObject
   PresetName = Brain Vault <-- Rename your module to prevent PresetName conflicts
   GoldCost = 100
   AddToGroup = Bunker Modules  <-- Add your mods to your own group so you can find them easier
   // Foreground color bitmap
   FGColorFile = ContentFile
      Path = Base.rte/Scenes/Objects/Bunkers/BunkerModules/BrainVaultFG.bmp   <----Change this path to where your FG files is. (BestModules.rte/ModuleFG.bmp)
   // Material bitmap
   MaterialFile = ContentFile
      Path = Base.rte/Scenes/Objects/Bunkers/BunkerModules/BrainVaultMat.bmp  <----Change this path to where your MAT files is. (BestModules.rte/ModuleMAT.bmp)
   // Background color bitmap
   BGColorFile = ContentFile
      Path = Base.rte/Scenes/Objects/Bunkers/BunkerModules/BrainVaultBG.bmp  <----Change this path to where your BG files is. (BestModules.rte/ModuleBG.bmp)
   BitmapOffset = Vector   <-- See further for Bitmap Offset set-up
      X = -138
      Y = -94



To properly set up your BitmapOffset, get the dimensions of your bitmaps. Let's say your bitmaps are 30X50 pixels. The X Offset would be half your bitmap's X value. The Y offset would be half your bitmap's Y value.

30/2 = 15 therefore X Offset = -15 (the offsets are made negative)
50/2 = 25 therefore Y Offset = -25 (the offsets are made negative)

These rules apply for most (if not all) bitmap or sprite offsets in CC modding.

With your TerrainObject properly defined, save your .ini file.

Now you should have your 3 module bitmaps and your .ini for defining the module all in their own rte folder. The last step is to create an Index.ini file. Create (or copy) a new .ini file and Name it Index.ini. Put it in your BestModules.rte folder. Add this code to your Index.ini.

Code:
DataModule
   IncludeFile = BestModules.rte/MyModule.ini  <-- Point this to your bunker module definition you created earlier. These assignments are case sensitive!


Save your Index.ini. Now you should be ready to load the game and try your new module.

If you get error's try to see if you can fix it. You can check Base.rte/AbortScreen.bmp to see where the game crashed.
Feel free to come back and ask for more help if I wasn't clear enough, I would be glad to help further.

BTW: If you need help getting the images saved properly in the CC pallet I can provide a useful link. I use GIMP and Paint 1.6 (the old interface).


Mon Jan 09, 2017 9:23 pm
Profile

Joined: Thu Apr 18, 2013 8:29 pm
Posts: 11
Reply with quote
Post Re: Bunker Systems Request
Thanks for your help! But I do have one question though...

As of now, I was able to photoshop the new hangar (using GIMP), but I am a bit confused on the coding section. This is because following the initialization of the hangar, the doors seem like they must be created as well.

Additionally, I am a bit confused by the Bitmap Vectors, in terms of what their purpose is and how changing the values affects the game.

Attached is a file containing the code I am currently working with, how does it look so far?

Thanks for helping me by the way!


Attachments:
BunkerSystems.ini [2.02 KiB]
Downloaded 891 times
Tue Jan 10, 2017 5:01 am
Profile
User avatar

Joined: Wed Jul 06, 2011 5:11 pm
Posts: 226
Reply with quote
Post Re: Bunker Systems Request
Yes if you want your bunker module to have doors you will need to add them in the TerrainObject definition. Note that if you're not creating NEW doors and only using the ones from Base.rte then you don't need to re-define them. Also, the bitmap offsets tell the game where to find the center of your bitmap. If you want to add something, like doors or another kind of attachable, the offset will be drawn from that center point. Let's take a look at your code.

Code:
AddTerrainObject = TerrainObject
   PresetName = Bay
   AddToGroup = Bunker Systems
   GoldCost = 150
   FGColorFile = ContentFile
      Path = MyMods.rte/Hangar/BayAFG.bmp
   MaterialFile = ContentFile
      Path = MyMods.rte/Hangar/BayAMat.bmp
   BGColorFile = ContentFile
      Path = MyMods.rte/Hangar/BayABG.bmp
                                                                     <-- no bitmap offset here
   AddChildObject = SOPlacer     <--here you're adding the doors. Child object is the attached object. Parent object is the object you're attaching to
      PlacedObject = ADoor       <-- what the child object is. in this case ADoor
         CopyOf = Door Rotate Long   <-- Preset name of child object
      Offset = Vector         <-- where to place the object. because of the way CC does offsets, this will be 84 pixels to the right and 39 pixels up of your bitmapoffset (might be wrong here, offsets are wacky in this game)
         X = -84
         Y = -39
      Rotation = Matrix      <-- the rotation in degrees of the doors when placed. this value can be 0, 90, -90, or 180. This lets place one door in different orientations
         AngleDegrees = -90
   AddChildObject = SOPlacer           <-- here you're doing it all over again for the second door
      PlacedObject = ADoor
         CopyOf = Door Rotate Long
      Offset = Vector             <-- notice X offset is now a positive value (84), this is because you're placing the door on the other side of the bitmap offset (84 pixels left)
         X = 84
         Y = -39
      HFlipped = 1            <-- stands for Horizontal flip and is set to 1 (yes). If set to 0 it would equal no. Tell the game to horizontally flip the sprite for the child object
      Rotation = Matrix
         AngleDegrees = 90


If you're planning on adding that conveyor to the module (if this can even be done) you'll need to define it before the TerrainObject. Additionally, if it's completely unmodified from the Base version (except for name) you don't need to define it at all. You can reference anything in Base.rte in your own mods at any time after it loads.

Hope this helps and as usual feel free to ask if you still have questions! :)


Tue Jan 10, 2017 6:58 pm
Profile

Joined: Thu Apr 18, 2013 8:29 pm
Posts: 11
Reply with quote
Post Re: Bunker Systems Request
Thanks for the help!

I've got the code for the hangar ready to go.

Everytime I try to start the game, I get an error message reading "RTE Aborted Failed to find the MyMods.rte Data Module!"

Am I missing something in order to run this mod?

Thanks again!


Sun Jan 15, 2017 8:52 pm
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: Bunker Systems Request
Every mod needs an Index.ini file, with the first line in the file being
Code:
DataModule


Sun Jan 15, 2017 8:55 pm
Profile
User avatar

Joined: Wed Jul 06, 2011 5:11 pm
Posts: 226
Reply with quote
Post Re: Bunker Systems Request
Success? Post your mod here if you like. I'm interested in seeing how it turned out :)


Sun Jan 15, 2017 10:39 pm
Profile

Joined: Thu Apr 18, 2013 8:29 pm
Posts: 11
Reply with quote
Post Re: Bunker Systems Request
Sadly, no :(.

I keep getting the same error, even though I added an .ini file

I'll post the code soon!


Mon Jan 23, 2017 9:25 pm
Profile
User avatar

Joined: Wed Jul 06, 2011 5:11 pm
Posts: 226
Reply with quote
Post Re: Bunker Systems Request
If you post the .rte I could take a quick look to help out.


Wed Jan 25, 2017 4:34 am
Profile

Joined: Thu Apr 18, 2013 8:29 pm
Posts: 11
Reply with quote
Post Re: Bunker Systems Request
Here are the files that I have created.


Attachments:
Hangar.ini [693 Bytes]
Downloaded 911 times
Index.ini [55 Bytes]
Downloaded 895 times
Wed May 24, 2017 2:12 am
Profile
User avatar

Joined: Fri Sep 13, 2013 1:39 am
Posts: 157
Location: ᴱᵛᵉʳʸʷʰᵉʳᵉ
Reply with quote
Post Re: Bunker Systems Request
Savior59 wrote:
Here are the files that I have created.


Looks like it should work. Did you place the Index.ini in the first directory of the .rte folder (MyMods.rte)?


Wed May 24, 2017 11:35 pm
Profile

Joined: Thu Apr 18, 2013 8:29 pm
Posts: 11
Reply with quote
Post Re: Bunker Systems Request
I had the Index file under "DockingBay" which is under "MyMods.rte". I attempted to move it so it's just under "MyMods.rte" but that did not work either.


Thu May 25, 2017 1:37 am
Profile
User avatar

Joined: Wed Jul 06, 2011 5:11 pm
Posts: 226
Reply with quote
Post Re: Bunker Systems Request
Without the whole .rte it'll be hard to figure out what's causing he crash...


Thu May 25, 2017 7:00 am
Profile

Joined: Thu Apr 18, 2013 8:29 pm
Posts: 11
Reply with quote
Post Re: Bunker Systems Request
Sorry for the frustration, but the only things I can post are the files within the rte folder. Is there a way I can post the rte folder?


Fri May 26, 2017 7:13 pm
Profile
User avatar

Joined: Wed Jul 06, 2011 5:11 pm
Posts: 226
Reply with quote
Post Re: Bunker Systems Request
Compress it to a .rar archive.


Fri May 26, 2017 8:10 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 17 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.166s | 16 Queries | GZIP : Off ]