Three Modding Questions

Freeform discussion about anything related to modding Transcendence.
Post Reply
robotarozum
Miner
Miner
Posts: 35
Joined: Sat Nov 30, 2013 10:05 pm

1. Is there a way to have a device hardwired to a ship - unable to be removed/uninstalled/etc.? Is there a way to have that device hardwired to the ship except for interactions with specific stations?

My plan is to have a ship with two specific weapons for the entirety of the game:
One that is a tactical/nondamage weapon and therefore can remain constant without impinging on balance.
One that is direct damage, and only upgradeable at a station I intend to design and place in static systems.

So far I tried the "virtual" tag but that was worse than nothing at all, because a player could accidentally install a generic weapon and lose the special weapon forever. My current solution is setting the maxweapons setting to 1: this forbids the player from installing any weapon at least in the ordinary case, but I'm not sure how it will interact with special cases (e.g. Lamplighter) or with my planned exceptional stations, and it doesn't help me for any devices besides weapons.

.

2. Is there a way to manually add a weapon (or any other object) to a ship in an existing saved game? Alternatively, is there a way to directly spawn a ship and a particular target or set of targets?

I have found that certain inherent ship characteristics (e.g. max speed) will update when the extension xml is updated, but starting device complement does not. Specifically, I want to test a weapon against an Ares Commune, but I do not relish the prospect of going all the way through the game from scratch to reach it. In my case, the ship has a non-vanilla weapon already and I can just substitute one for the other, but that is rather brute force and I might not always have that option.

.

3. Is there a way to make a drive item a usable device? Is there a way to make a usable device a weapon?

My plan is to have a ship with an exceptional engine that can be redirected to weapon duty (for players of Star Chamber, yes, this is a shameless copy of / homage to Mysterium Feedback Laser). The only devices I know of that do direct damage are missile defense, and in the xml they use an AutoDefense tag which does not satisfy my needs. I see things like Invoke and Events tags, and within Events I see OnInvokedByPlayer... but I'm at a loss as to how to use any of that.

The idea is that using the drive fires a significant amount of damage backwards but ionizes the drive (I also have no clue how to do this) and leaves the ship with its significantly inferior "base" characteristics (even though the drive would be installed at game creation).

.

I appreciate any tips for these issues.
EditorRUS
Militia Lieutenant
Militia Lieutenant
Posts: 148
Joined: Tue Oct 30, 2012 6:30 pm

robotarozum wrote:1. Is there a way to have a device hardwired to a ship - unable to be removed/uninstalled/etc.? Is there a way to have that device hardwired to the ship except for interactions with specific stations?
Set the level = 25 and write next:
<OnUninstall>
(objSendMessage gSource Nil (cat (itmGetName gItem) " cannot be unistalled once installed."))
(objSetObjRefData gSource "Hardwired1" gItem)
(sysAddObjTimerEvent gSource 1 "Reinstall")
Nil
</OnUninstall>

<Reinstall>
(shpInstallDevice gSource gItem)
</Reinstall>

Well, you know. You also can write an item table with permitted weapons and write <OnInstall> block on the ship.

2. Is there a way to manually add a weapon (or any other object) to a ship in an existing saved game? Alternatively, is there a way to directly spawn a ship and a particular target or set of targets?
Since you can't add any extension after you have started a game, you can't add any weapon from the extension. Well, you can add your weapon in a mod that already was loaded and use the console to add the weapon on the ship. Or, you can just download any godmode you like and teleport to Ares space.
3. Is there a way to make a drive item a usable device? Is there a way to make a usable device a weapon?
Currently, i am making EMC (see "bullets, missile, ...") and that's the way more harder weapon to be coded.
Well, drives and weapons are all inherit ItemType, so, you can add <Invoke>.
<Invoke> has next arguments:
key - a key you have to press to use.
installedOnly - can be used only when installed
uninstalledOnly - opposite to upper one

<Invoke> must be placed after <ItemType> block, not inside any of other blocks (that means not inside <Events>)

<ItemType UNID="&UNID&"
name="BLAH-BLAH"
<Invoke key="A" installedOnly="1">
(block Nil
(plySendMessage "The item was used")
)
</Invoke>
Shaman
Commonwealth Pilot
Commonwealth Pilot
Posts: 95
Joined: Fri Sep 20, 2013 2:03 pm

For testing there is this nice extension
http://forums.kronosaur.com/viewtopic.php?f=8&t=872

Summons the needed ship instantly.
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

2. Is there a way to manually add a weapon (or any other object) to a ship in an existing saved game? Alternatively, is there a way to directly spawn a ship and a particular target or set of targets?
I use, as many other modders do, alterecco's godmod :
https://github.com/alterecco/GalacticOm ... master.zip
https://github.com/alterecco/DockScreen ... master.zip

You can spawn any item, ship or station, teleport, change data like money/ranks/fuel. It's an extremely useful modders tool.

Otherwise, you can load up a game in Debug mode and use the game console for simple adjustments.
Teorias
Anarchist
Anarchist
Posts: 12
Joined: Mon Oct 22, 2007 9:44 am

Set the level = 25 and write next:
<OnUninstall>
(objSendMessage gSource Nil (cat (itmGetName gItem) " cannot be unistalled once installed."))
(objSetObjRefData gSource "Hardwired1" gItem)
(sysAddObjTimerEvent gSource 1 "Reinstall")
Nil
</OnUninstall>

<Reinstall>
(shpInstallDevice gSource gItem)
</Reinstall>
How exactly does one make this work? An example of actual implementation would be nice.
Thanks in advance.
EditorRUS
Militia Lieutenant
Militia Lieutenant
Posts: 148
Joined: Tue Oct 30, 2012 6:30 pm

Oh, sorry. I found more easy solution:

<OnUninstalled>
(block Nil
(shpInstallDevice gSource gItem)
(objSendMessage gSource (cat (itmGetName gItem) " cannot be unistalled"))
)
</OnUninstalled>

Well: <OnUninstall> is called before uninstall, OnUnistalled after.

And forgot about 25 level.
robotarozum
Miner
Miner
Posts: 35
Joined: Sat Nov 30, 2013 10:05 pm

Thanks, this was helpful.
Post Reply