Author Topic: [SOLVED] Remnant ships have unwanted subsystems.  (Read 507 times)

Yulgalminakf

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
[SOLVED] Remnant ships have unwanted subsystems.
« on: June 23, 2015, 11:16:50 AM »
The Remnant are getting subsystems that I don't want them to have. I've looked deeply into it and found that in "remnant_designs.as", it passes in "Creeps", found in the file "empire.as", into the design_designer. I'd love to have access to the variable "Creeps" in order to change what technologies it has unlocked (I'm assuming that deeper in code we're not allowed to look at, "Creeps" automatically gets all tech unlocked).

However, whenever I try to import it into a script in file directory "scripts/definitions" using "import empire", I get an error saying it can't find empire. "import scripts.server.empire" nor "import server.empire" work. I also tried manually to use "#include", but that completely unravels all the include/import hierarchy, leaving many many linking errors.

The reason I wish to have it in "scripts/definitions" is because I want to be able to put into the modding api a "GenericEffect" class that can remove technologies from the creeps for me.

I am truly at a loss as to how to do this. Is what I'm trying even possible, or am I crazy?
« Last Edit: June 23, 2015, 07:36:38 PM by Yulgalminakf »

GGLucas

  • Dr. Evil
  • BMS Staff
  • Delusional
  • *
  • Posts: 1877
  • Karma: +300/-6
    • View Profile
Re: Remnant ships have unwanted subsystems.
« Reply #1 on: June 23, 2015, 02:43:17 PM »
The Creeps empire is created in scripts/server/empire_creation.as, which is also where it unlocks all the subsystems and modules for it.

The reason why your "import empire" fails is because definitions are loaded in all script engines (menu, server, client, shadow), but "empire" only loads into the server engine. You'll want to put your import in a #section server block like the hooks have for code that only applies to the server engine.

That said, you'll probably want to use a subsystem tag for this. Like a "NoRemnantUnlock" tag and then check for def.hasTag(ST_NoRemnantUnlock) in the loop where it does setUnlocked() in empire_creation.

Yulgalminakf

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Remnant ships have unwanted subsystems.
« Reply #2 on: June 23, 2015, 05:56:33 PM »
Thank you thank you thank you! I've been banging my head on my keyboard all day trying to figure this out. I ended up with a hack that did what I wanted, but it was ugly as sin. Now I can do it the proper way. :)
« Last Edit: June 23, 2015, 07:35:39 PM by Yulgalminakf »

dalolorn

  • Sentient
  • **
  • Posts: 199
  • Karma: +7/-0
  • ABEM Developer
    • View Profile
Re: [SOLVED] Remnant ships have unwanted subsystems.
« Reply #3 on: June 24, 2015, 04:37:14 AM »
A simpler, more compatibility-friendly option would be to remove tags from the subsystems. This would remove the need to alter various core scripts (thus breaking compatibility with any other mods that change them, and needing to stay on top of any future changes the devs make to those scripts) and still achieve the desired effects. (Most of those tags don't seem to do anything other than help the AI/developer figure out what they are, anyway - IsWeapon, for example.)