George: how does CanBeInstalled/CanBeUninstalled work?

Freeform discussion about anything related to modding Transcendence.
Post Reply
User avatar
alterecco
Fleet Officer
Fleet Officer
Posts: 1658
Joined: Wed Jan 14, 2009 3:08 am
Location: Previously enslaved by the Iocrym

I just noticed that we have these events, and would like to use them.
How do they work? I can get them to run, but no matter what I return they do nothing.
george moromisato
Developer
Developer
Posts: 2998
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

<CanBeInstalled> is called on an item from inside shpCanInstallArmor and shpCanInstallDevice.

gSource is the object that we're installing on.
gItem is the item being installed.

You can return True if the item can be installed.
Or you can return a string, which is the message that will be shown to the user to tell them why the item cannot be installed.

<CanBeUninstalled> is called on an item from inside shpCanRemoveDevice. [There is currently no way to prevent an armor segment from being uninstalled.]

In both cases, the current screens that allow the user to install/uninstall items at a station will make these checks.
User avatar
alterecco
Fleet Officer
Fleet Officer
Posts: 1658
Joined: Wed Jan 14, 2009 3:08 am
Location: Previously enslaved by the Iocrym

ahh, I need to just return a string! I think that must have been the only option i did not try... Thanks, will add this to the wiki
Post Reply