Author Topic: Modding Questions and Catch the Sun!  (Read 2201 times)

Xaneas

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Modding Questions and Catch the Sun!
« on: December 04, 2014, 12:48:10 PM »
Hey Guys,

i hope someone can answer some questions:

1. does the mod folder work?
2. how does the "GridOffset" work in the shipsets hulls.txt?
3. what is the Texture Resolution limit for Objects?
4. what is the Polygon limit for Objects?

Thanks for any help.

btw. a Star Ruler 2 mod section in this forum would be nice.

Catch the Sun!
My first test model for Star Ruler 2:
« Last Edit: December 04, 2014, 01:04:46 PM by Xaneas »

Thy Reaper

  • BMS Lead Developer
  • BMS Administrator
  • Hopeless
  • *
  • Posts: 3237
  • Karma: +397/-8
    • View Profile
    • Blind Mind Studios
Re: Modding Questions and Catch the Sun!
« Reply #1 on: December 04, 2014, 01:07:59 PM »
The mods folder does work. You need a folder containing your mod, and within that folder should be a file "modinfo.txt" with a single line like "Name: Xaneas's Mod". You can launch using that mod by adding -mod "Xanea's Mod" to your launch parameters. You overload files in the base game by mimicing the folder structure of the base game (e.g. data/objects.txt within your mod folder to replace the object definitions).

GridOffset, GridSize, and the ASCII art layout are no longer relevant.

Textures have no particular limit besides whatever is imposed by the graphics card, but keep them below 4 gigapixels.

Models may have up to 65,535 vertices with no particular polygon limit.

We'll add a modding section when we get the first pass of official mod support done soon(ish).

Xaneas

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Modding Questions and Catch the Sun!
« Reply #2 on: December 04, 2014, 01:34:40 PM »
Wow, thanks for the fast reply!

zeziba

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Modding Questions and Catch the Sun!
« Reply #3 on: December 05, 2014, 12:22:18 AM »
That is some good info. on the modding theme, I added some inter-solar system weapons but anything over 20,000 u in range crashes the game after a bit. It could also be the fact that I beefed everything up or that I added several new types of lasers and missiles, have yet to decide. Also I like the fact you guys added some templates into the data structure. I was wondering if you could make a master template so if we change something or add something we can see a web of things we need to update.

Point in case is I added a category for subsystems in flag ships so i can test some different things out. I made a category called test objects, when loaded in game it creates a sub menu called sc_test_objects. Where is the menu file at so i can add the constraints for my test objects there.

Another question on the modding, i added several new starting conditions so that I can test some things out. I saw in one of the data files that you use repeat as a command but when used in the file it fails to repeat. Can I use a repeat function in the government profile? Or do I have to make a function it can call, and if that is the case where do I put it?

Like:
Code: [Select]
Repeat(5)
    InHomeSystem( MakeAsteroid() )

Another thing I would like to add is if you make a planet with a radius over 25, they only build about 10-20% of the tiles. At 24 after about 30 mins of in-game time they always cover the planet. When I make a 48 radius planet even after waiting for 40 mins at x10 speed they only cover 15% of the surface. Is there a way to get them to completely cover the surface?

Back to the subsystems I tried to make a new modifier subsystem that decreases the energy required and I could not figure out the variable to modify. When i made a mass modifier it worked like a charm, so if you guys could provide a hard copy of the variables used or point me to where they are stored I would appreciate that.

I have about 200 more questions but we will get to them soon enough. Also I second a modding section!!!

GGLucas

  • Dr. Evil
  • BMS Staff
  • Delusional
  • *
  • Posts: 1877
  • Karma: +300/-6
    • View Profile
Re: Modding Questions and Catch the Sun!
« Reply #4 on: December 05, 2014, 07:55:16 AM »
Quote
when loaded in game it creates a sub menu called sc_test_objects.

That's a locale entry, you'll need to define a new entry with that name. Check the top of locales/english/subsystems.txt.

Quote
Can I use a repeat function in the government profile?

You cannot. Different types of data files have access to different (but overlapping) sets of hooks. Specifically, only files in data/systems/ support that "Block syntax", where you can indent hooks to add them to a particular block, because they work differently from other files (they're more complicated due to needing more complicated logic for system generation).

Your best bet here is to just repeat the actual line 5 times :P

Quote
Is there a way to get them to completely cover the surface?

It's based on their population. You'd have to mod the script code that takes care of that if you wanted to change the ratio of population to developed tiles.

Quote
energy required

Assuming you mean "Power", since energy is a resource and wouldn't really make much sense here: That's not in a variable at the moment, you can see it in the "Requires:" block in the subsystems that need it. You could change it to be something like:

Code: [Select]
PowerCost := 10 * Size
Requires:
    ...
    Power = PowerCost

Then you'd have a variable to modify. You can add as many variables with any names you want.

Note that you'd also have to add a "Modifier function" in order to actually modify that variable, like in data/subsystems/generic.txt but for PowerCost. It would look something like this:

Code: [Select]
Template: var/PowerCost       //This template applies to any subsystem that has the "PowerCost" variable.
    Modifier: PowerCostFactor(factor)  //Add a new modifier function with 1 argument
        PowerCost := PowerCost * factor //Multiply the subsystem's power cost by the specified factor

I suspect you may have figured out how modifier functions work already, but I figured it'd be nice to have a reference.

Quote
Or do I have to make a function it can call, and if that is the case where do I put it?

This is getting more into script modding, and isn't needed for most tasks. But if you wanted to start customizing what types of hook functions are available, the various types of hooks are defined in files that follow the pattern of scripts/definitions/*_effects.as. Traits in particular take their hooks mostly from bonus_effects.as and trait_effects.as.

If you have any more questions (either of you), feel free to post them here, or pop into the IRC chat channel sometime. I'm usually around in the evening most of the time in the IRC to answer any modding or game related questions for you.
« Last Edit: December 05, 2014, 08:07:19 AM by GGLucas »

dalolorn

  • Sentient
  • **
  • Posts: 199
  • Karma: +7/-0
  • ABEM Developer
    • View Profile
Re: Modding Questions and Catch the Sun!
« Reply #5 on: December 22, 2014, 06:14:47 AM »
Wasn't sure if I should make a new thread for this or not, but...

What might be broken with this model? It's not showing in the game, and tests (swapping textures with a Remnant ship, as immortalized in a screenshot I took and uploaded to Steam) revealed that it is not the textures' fault. I'm guessing (and hoping I'm wrong) it has something to do with the way Blender exported it, but in reality I haven't got a clue as to what's wrong.

Edit: Luckily, I had another 3D modeling tool. I originally intended to try porting a different kind of model (Space Empires 5 .x models, to be exact) to see if it was a model error, but when Blender lacked the plugin to import the new test model, I remembered MilkShape could work with those. (I think.) So, before trying that option, I went and imported the broken model I uploaded, mucked about with the texture settings just in case, and exported it. It seems Blender's OBJ plugin doesn't output SR2-readable (or human-readable, as I quickly determined) files.

Anyway, problem solved, though my ships are flying sideways - an oversight I will be quick to correct. :)

Re-edit: Intriguing. According to MilkShape, it's not the Arbiter that's sideways - it's SR2's ships. Anyway, for obvious reasons, I've gone and become a conformist, turning the ship sideways. :)
« Last Edit: December 22, 2014, 08:59:51 AM by dalolorn »

Thy Reaper

  • BMS Lead Developer
  • BMS Administrator
  • Hopeless
  • *
  • Posts: 3237
  • Karma: +397/-8
    • View Profile
    • Blind Mind Studios
Re: Modding Questions and Catch the Sun!
« Reply #6 on: December 22, 2014, 11:43:47 AM »
Dalo, your model doesn't have any normals. I'll need to add a fallback or error message when that's the case.