Posted by Data in Cortex Command - July 10th, 2007

Independent Data ModulesSo here’s an update on what we’ve been working on. There was a bit of a slump in productivity in June as we moved our offices, but we’ve picked up the pace in the past week.

A big problem with making mods for Cortex Command has been that any new names you defined in your data module could collide with ones found in any other random mod out there. So, if anyone tried to load both your and that other mod at the same time, very strange and unexpected things would occur (someone else’s arms and legs on your guy!). Or just crash the game with little clue as to what conflict caused it.

So we took a break from working on the new editors to solve this problem. Now, user made data modules form their own ‘name-spaces’, and thus can define whatever names they want, as long as they don’t conflict with anything in the official Base.rte module. This means your SuparGun will coexist peacefully with that other guy’s SuparGun, as long as you both follow some simple rules:

  • Your instance names can’t be the same as anything in the official data module Base.rte
  • In your own data module you can use anything defined in the official module, Base.rte. You can safely make copies or reference them as you wish.
  • You CAN’T, however, use anything defined in any data module other than the official one, or the one you’re working on. This would cause an interdependency between two user made data modules, and will cause errors if they get separated. Just put everything dependent on each other into one module… you can organize it thoroughly. Look at how Base.rte is organized for tips.

Back to work on the Scene and Gib Placement editors!

You can follow any responses to this entry through the RSS 2.0 feed.
Trackback from your own site.


67 Responses to “Independent Data Modules”

  1. Alenth - # July 10th, 2007 at 4:05 pm

    Namespacing?

    I love you!

  2. iwillcontrolyou - # July 10th, 2007 at 4:05 pm

    So…..this means we could have like 8 different AK-47s?

    In any case yay for end of naming conflicts!

  3. iwillcontrolyou - # July 10th, 2007 at 4:06 pm

    Oh, never mind that AK comment.

  4. Nfsjunkie91 - # July 10th, 2007 at 4:07 pm

    Very nice work. Could this apply to materials and such too?

  5. Data - # July 10th, 2007 at 4:14 pm

    You can easily make differnt AK’s.. just use “CopyOf = AK-47″ and then rename it with “InstanceName = New Shiny AK-47″. Then just define some other properties after that to customize it as you wish. They will override the ones originally in the plain AK-47

  6. Data - # July 10th, 2007 at 4:29 pm

    Materials is something we’ll have to tackle too, but it’s tricker since they all have to fit on a palette. It should be doable though.

  7. p3lb0x - # July 10th, 2007 at 5:35 pm

    oooooh…. i shall say no more

  8. Tazers - # July 10th, 2007 at 6:07 pm

    Data, your skills are awesomes.

  9. Carp - # July 10th, 2007 at 6:11 pm

    Nifty. And- offices?
    They’re going professional, folks.

  10. Delgado - # July 10th, 2007 at 6:47 pm

    Woah offices

  11. Barbalute - # July 10th, 2007 at 6:55 pm

    Neat, this should be cool. Didn’t know you had an office.

  12. zalo - # July 10th, 2007 at 8:24 pm

    Does this mean we can make grenades that can gib itself, or a copy of itself that gibs the original, that goes on forever? Probably not.

    Gib Placement editor will be useful for a lot of things.

    Nice work, I hope that you use some of Build 13’s good qualities like smooth scrolling for the next build, and smooth slow motion :D.

  13. iwillcontrolyou - # July 10th, 2007 at 9:16 pm

    But “New Shiny AK-47″ isn’t the same as “AK-47″…so much for confusion.

    Damn.

  14. Data - # July 10th, 2007 at 10:09 pm

    iwillcontrolyou: No i’m talking about something different than the post is about. Yes several user mods could each have a “My AK-47″ and they would all coexist when they are all loaded at the same time.

    If you want to make different AK’s within the same mod (data module), you still have to give them differnt names, like i described in the previous comment.

    Make sense?

  15. Cayne - # July 10th, 2007 at 11:29 pm

    Awesome work data! Thanks for the update… I hope the office move went smoothly.

  16. someone lol - # July 11th, 2007 at 2:26 am

    ey 15′th coment lol

  17. Blob - # July 11th, 2007 at 5:00 am

    Wooho, Cool! But the bad thing is that we could not use things from other .rte’s. Good Work!

  18. JeCa - # July 11th, 2007 at 6:00 am

    Wait, now I’m confused. If you make a mod called “First Mod.rte” with “FirstMag” in it, won’t you be able to use that mag in “Second Mod.rte” without copying it, even if you’ve got both and they load in the correct order? Otherwise, great work. Gib Editors??! O_o

  19. PromoStarr - # July 11th, 2007 at 8:12 am

    YAY moding just got easier :D

  20. Alenth - # July 11th, 2007 at 10:17 am

    I think he used namespacing, and judging from the ability to use stuff from base, I think it uses the last one that was defined.

    Say Base.rte had a Mag
    Then A.rte used that Mag
    B.rte made it’s own Mag and used it.
    C.rte uses Mag, it would use the one defined in B.

    I think I’m right… means that load order gets sort of important…

  21. Alenth - # July 11th, 2007 at 10:18 am

    Oh sorry, I didn’t read the whole thing -.-

    Nothing can load between mods, which kills the usefulness of ASH33s patch. And it might kill the libraries in DMod.

  22. carpet_ninja - # July 11th, 2007 at 11:06 am

    ok…… i didn’t understand anything.

    explane it to me like a 5 year old please

  23. iwillcontrolyou - # July 11th, 2007 at 11:48 am

    @Data: I get it, but I meant no having 5 AK-47s in reference to the “no conflict with Base.rte” thing. They may be AKs, but they won’t have the exact same name.

  24. Kurrus - # July 11th, 2007 at 12:29 pm

    When will you repair the forum, Data?

  25. Data - # July 11th, 2007 at 12:45 pm

    Jeca and Alenth, yeah, if you want to make sure things work every time and in every situationyeah you can’t have two user made mods refer to each other’s stuff at all. Otherwise, if load order happens to be right and everyhting else aligns, things MIGHT work, but it’s a bad way to make reliable mods. We might in fact have checks that warn about that in the future.

    Kurrus: what’s wrong with it?

  26. Alteisen - # July 11th, 2007 at 1:16 pm

    Data, about the materials palette, how does the count go on it?

    It from upper left to lower right corner sideways or downwards?

  27. JeCa - # July 11th, 2007 at 2:40 pm

    Thanks DaTa, that’s good to know. Guess I’ll have to be more organised in the future then…

  28. Kurrus - # July 11th, 2007 at 4:26 pm

    Wizard James…

    Also, this looks quite interesting. Will make things much easier too.

  29. DarkLord7854 - # July 11th, 2007 at 11:24 pm

    Wish we could get a hot-fix now, it’s a real bugger to go in manually and re-edit the mods >.>

  30. Blob - # July 11th, 2007 at 11:25 pm

    So if in B14 I’l make map and want to place some actors from other mods I can just wrote CopyOf = ModActor and give him CopyOf = ModGun. But in next build I cannot make this. But if in MyMap.rte/index.ini I will wrote paths to actor.ini from other .rte and gun.ini(and all stuff that actor.ini and gun.ini uses) It will work, right? Or not?

  31. billli999 - # July 12th, 2007 at 1:09 am

    Data, why is it not possible to have rounds and things like that have a sprite to face the direction they are going in? A line that says something like RoundRotation = 0/1 ? 0 means no rotation.

  32. billli999 - # July 12th, 2007 at 1:10 am

    would that be possible (sorry for double post)

  33. JeCa - # July 12th, 2007 at 4:01 am

    Well, if it has Rotation it’ll just spin rapidly. What you need is a Horizontal Flip command. If I recall corectly, there’s a variable for every actor called [HFlip = 0/1] which pressumably determines wether the character’s head (or body) is supposed to flip when you change direction. If there was a similar line in the bullet code for for sprite-using MOs (MOS?) and TDExplosives then that might work. Not sure how hard it’d be to make however, or how much lagg it’d cause (if the game was to calculate the velocity of the object and set it’s sprite accordingly).

    But yea, I think that’s up to the creators to figure out :). A new variable to easeier create “Trails” (see the fuel rod gun or carpet bomber for examples) without having to match the casings would also be nice, although it may cause a spam with different rocket mods.

  34. robburdon - # July 12th, 2007 at 7:06 am

    Data, I’m pretty sure i understand, but can mods rely on things in base.rte, for instance, can my rocket rely on the normal rocket thrusters or do I have to copy out the code into my mod?

  35. billli999 - # July 12th, 2007 at 9:32 am

    I know you were adressing data, but to save him writing another message I will tell you:

    YES.

  36. Data - # July 13th, 2007 at 12:33 am

    Billi, yes that’s definitely going to be done soon. Just haven’t gotten around to it yet. Ie some property to say that a sprite based particle will align its rotation with its velocity vector.

    Robburdon, yes your mods can do CopyOf directly off of anything in the Base.rte as much as you want.

  37. Foogooman - # July 13th, 2007 at 8:31 am

    Ooh! Fancy buisness going on! Keep it up.

  38. Calle - # July 14th, 2007 at 4:39 am

    So you’re actually working on the level editor? That’s hot!

  39. Exalion - # July 14th, 2007 at 7:00 pm

    the biggest problem is the materials.
    there are about 100 empty index numbers (index123 is undefined)
    but that means only 100 new materials.
    this may Cause issues.
    can you address this at a later date?
    finish the gib placement stuff first, but please set this system back to the way it was in b13, WITHOUT materialo index numbers if possible, or make a limitless amount of index placespots.
    eg:
    base.rte uses first 100, then it goes on forever, meaning limitless materials.

  40. Foogooman - # July 14th, 2007 at 7:44 pm

    DATA! Help! I can’t play Cortex Command, I keep getting this error!

    http://s88.photobucket.com/albums/k189/Foogooman/?action=view&current=error.jpg

  41. Foogooman - # July 14th, 2007 at 8:35 pm

    seems to happen when I play in full screen.

  42. whitty - # July 16th, 2007 at 8:19 pm

    DATA - EMAIL ME ASAP

    whenever i go to start CC ever since i got the boulder gun mod, this keep coming up:

    Abortiong in file.\system\reader.cpp, line 467, because:

    wrong type in reader when passed to serializable::creat() in base.rte/setting.ini at line !

    the last frame has been dumped to ‘aborscreen.bmp’

  43. whitty - # July 16th, 2007 at 8:20 pm

    o ya, you can prolly see me email cuz u the admin to thuis but here it is anyway:

    mesadaniel@fastmail.fm

    if anyone else knows the problem, email me

  44. JeCa - # July 17th, 2007 at 5:13 am

    Why Email? If the solution is written here other people with the same problem will know how to fix it, and noone will email you after you’ve recieved the answer.
    About the problem, a lot of different things could be wrong, and only you can really fix it. However, this is probably the easiest way to do it:

    Open the relevant .ini file (the one where it says the problem occurs).
    In the notepad, open up the Display menu at the top of the window and make sure the location status (or whatever it’s called in english) option is ticket.
    Now you will see what line the cursor is on, so that you can scroll down to the mentioned line (in this case, 467).
    Compare that line to similar ones in other mods, and make sure they’re built up in the same manner. Also make sure that the line doesn’t redirect the reader to an object that doesn’t exist (or if there are any typos anywhere).

    Hope it helps.

  45. JeCa - # July 17th, 2007 at 5:22 am

    Sorry For Doulbe Post, but I just realised that you said the problem was in the settings.ini file. If that’s the case, then I can’t help you. First and foremost, my settings file only has ~270 lines, and secondly I can’t imagine what could be wrong with your settings file, unless it’s been infected by some kind of malware or you descided to mock around with it. Sorry.

  46. whitty - # July 17th, 2007 at 1:59 pm

    ive tried to reinstall it 3 times but it still happens

  47. JeCa - # July 17th, 2007 at 2:30 pm

    hmmm, do you mean the game or the mod? Because if it first occured when you installed the mod, but still happens after you’ve removed it, then something seems to be seriuosly wrong. If the game works fine without the mod, then re-installing the mod probably won’t work. I had a similar problem with apocalypse towers in B13, and nothing except removing the mod seemed to help back then :/ .

    Although I highly doubt it’s relevant to this position, I’ll post the content of my settings.ini file (down to the key mappings) here, should there be a problem with your settings. I’d like to post my entire file, but my uploaders doesn’t seem to appreciate my efforts at the moment, and I think it’d be a little too long to post here.

    Settings
    ResolutionX = 640
    ResolutionY = 480
    ColorDepth = 8
    PaletteFile = ContentFile
    FilePath = Base.rte/palette.bmp
    Fullscreen = 1
    PixelsPerMeter = 20
    DeltaTime = 0.0166667
    RealToSimCap = 0.0319784
    HSplitScreen = 0
    VSplitScreen = 0
    DefaultSceneToLoad = Horiz Land
    EnableParticleSettling = 1
    EnableMOSubtraction = 1
    SoundVolume = 48
    MusicVolume = 0

  48. whitty - # July 17th, 2007 at 7:37 pm

    yea whenever i take out all the mods it works, but i dont know why. it has happened ever since i downloaded the boulder gun.

  49. JeCa - # July 18th, 2007 at 5:54 am

    Dunno. Check through the thread where you got the mod and see if anyone else has got the same problem. Or ask the creator of the mod. There’s bound to be someone there who knows more than me about this thing. :)

  50. coilgunner - # July 19th, 2007 at 2:06 pm

    sweet! keep it up sounds awesome.

  51. Ya Fruit - # July 20th, 2007 at 1:34 am

    Great! Very useful yes!

  52. MaximDude - # July 20th, 2007 at 2:11 am

    This is aweasome
    What else build 15 will have? New craft? New weapons? New actors? New maps? TURRETS?

  53. Shalafi - # July 20th, 2007 at 5:20 am

    @MAXIMDUDE:
    No, Data only will add new things in the final version. That will be one of the things that will make it worth the money.

  54. codex - # July 21st, 2007 at 12:48 am

    Yeah, maybe so — but I think one of the things that has made Cortex Command so great is the community testing new stuff. And if we don’t occasionally see the odd new feature (that’s not an ‘under the hood’ thing), it might start to lose its appeal.

  55. JeCa - # July 21st, 2007 at 4:47 am

    True, true. But look;
    # Gibbable ships and new ships, working on these, some may appear in next test build
    # New guys and guns.. may save for real game too
    # Ability to force reload of all ini’s without restarting game, will be in next build.
    New gibbable ships may appear in next build. That’s probably a good thing, since it’s (almost) completely new to the game. New characters will probably work in about the same way as old ones, but gibbable ships are new to the concept.

    Also I wonder when DaTa’s gonna try start optimizing the engine. If that’s the last thing he’s going to do, then that would almost be worth paying for in itself.

  56. Kazuki - # July 21st, 2007 at 9:28 am

    So I see you’re a bit more active now, Data…

    Does this mean you’ll update the blog a little more often? D:

  57. lazermaniac - # July 23rd, 2007 at 4:37 pm

    Would this RTE independence eliminate the material index conflicts as well? Right now, if you download many different mods, their material indexes overlap and CC crashes with an error that says “Material Index ### already used by [Name of material].” or something in those lines.

  58. Nikola - # July 24th, 2007 at 2:21 am

    Hey Niklas I saw your work in The Player PDF Magazine !!!

  59. Data - # July 24th, 2007 at 8:40 am

    We’re going to find a solution for the material too, yeah.

    The editor is really coming together. Next build is going to be a lot of fun

  60. MaximDude - # July 24th, 2007 at 2:09 pm

    WOOOOOOOO!! NEXT BUILD! YAY!!!!
    I just hope it wont get all out mods screwy…

  61. Fat Zombie - # July 24th, 2007 at 3:32 pm

    Hey, Data: someone else asked this but you didn’t answer, and I’d also like to know the answer to this.

    Will there be the option to create emitter-type objects as rounds or weapons that can be fired? Not as in the actual guns, but as ammo?
    Some sort of easier and more reliable way of creating rounds that have emitters or trails, so that we could finally have reliable working rocket-propelled ammunition or other things of that ilk?

  62. Data - # July 24th, 2007 at 7:26 pm

    zombie, yeah we’ll rearrange things to make effects like that easier to do at some point soon

  63. BreenedandScrooned - # July 24th, 2007 at 8:23 pm

    This is pretty off-topic, but do square objects still dig?

  64. MaximDude - # July 25th, 2007 at 1:37 am

    Ohhh Data
    Will the timer on explosives be fixed?
    Cause it wont allow setting the timer to -1 for impact explosives or stuff that never explode
    It just insta explodes killing you and lagging

  65. AquaGeneral - # July 25th, 2007 at 3:16 am

    Hey Data…
    Is there any news on pool able water?

    Because on the forums lots of people would like that feature.

    If you cant talk about something such as this its okay.

  66. Fat Zombie - # July 28th, 2007 at 5:48 am

    Yay! Thanks, Data!

  67. someone lol - # July 28th, 2007 at 9:28 am

    ey data plz reles the game lol

Leave a Reply