Preventing weapon installation on a playership

Freeform discussion about anything related to modding Transcendence.
Post Reply
User avatar
Song
Fleet Admiral
Fleet Admiral
Posts: 2801
Joined: Mon Aug 17, 2009 4:27 am

So I'm working on a ship that has no weapons slots, and I'm having some trouble getting the game to recognise it. At present I'm using the 1.04-era format for slots, and then using the normal MaxWeapons to try to make sure it works:

Code: Select all

deviceSlotsNonWeapons=			"8"
			maxWeapons=			"0"
However, this isn't working. When buying a weapon at a station, the offer to install the weapon will still work. Is this a bug, or am I using the format wrong? And if it is a bug, is there a piece of code that could be used to manually prevent weapons installation under all circumstances?
Mischievous local moderator. She/Her pronouns.
User avatar
AssumedPseudonym
Fleet Officer
Fleet Officer
Posts: 1190
Joined: Thu Aug 29, 2013 5:18 am
Location: On the other side of the screen.

 Yep, you have to handle that through events.

Code: Select all

<Events>
  <CanInstallItem>
    (block nil
      (if (eq (itmGetCategory gItem) 4)
        (setq return "Weapons cannot be installed on this ship.")
        (setq return true)
      )
    )
    return
  </CanInstallItem>
</Events>
 …Or something to that effect.
Image

Mod prefixes: 0xA010 (registered) and 0xDCC8 (miscellaneous)

My mods on Xelerus: Click here!

Of all the things I’ve lost in life, I miss my mind the least. (I’m having a lot more fun without it!)
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

try this:

Code: Select all

maxDevices=			"8"
maxWeapons=			"0"
maxNonWeapons=			"8"
[EDIT]
Tested, strange, I can install up to 8 weapons on my test ship :?
User avatar
AssumedPseudonym
Fleet Officer
Fleet Officer
Posts: 1190
Joined: Thu Aug 29, 2013 5:18 am
Location: On the other side of the screen.

 Yeah, I’d already wrestled with that one — http://forums.kronosaur.com/viewtopic.p ... 136#p57136 — before <CanInstallItem> was fixed to work more on just armor. As near as I can tell, setting a max value to 0 acts as a delimiter. If you need to keep something from being installed, it looks like events is the only current way of pulling it off.
Image

Mod prefixes: 0xA010 (registered) and 0xDCC8 (miscellaneous)

My mods on Xelerus: Click here!

Of all the things I’ve lost in life, I miss my mind the least. (I’m having a lot more fun without it!)
Post Reply