Shield adjustment problems

Freeform discussion about anything related to modding Transcendence.
Post Reply
User avatar
Patupi
Militia Lieutenant
Militia Lieutenant
Posts: 123
Joined: Fri Apr 06, 2012 9:24 pm

OK, I'm still new to modding but I've been going over existing stuff (mostly the Transcendence source) and I had a go at an odd shield... but now I'm stuck. I'm pretty sure I can't do it as planned due to a lack of a command to take a local variable and use it to change the 'HP bonus' stat. I'm guessing the new Dynamic type that people are talking about would allow me to actually make a new shield (and dispose of the old one) each time you use it... but I'm not sure about how the dynamic type thing works yet.

What I had was based loosely on the Jotun deflector, but instead of upping hitpoints and power use I tried to apply a new HP Bonus based on current charge status:
<ItemType UNID="&itKineticPhasedShield;"
name= "Kinetic Phased Shield"
level= "9"
value= "130000"
mass= "5000"
frequency= "rare"
unknownType= "&itUnknownAlienDevice;"
attributes= "Alien; MajorItem; Military"

description= "This alien shield generator has controls to adjust its strength."
>

<Image imageID="&rsItems1;" imageX="192" imageY="0" imageWidth="96" imageHeight="96"/>

<Shields
hitPoints= "100"
regen= "180"
depletionDelay= "150"
powerUse= "800"
weaponSuppress= "kinetic"

HPBonusPerCharge= "0"
powerBonusPerCharge="0"
maxCharges= "5"
/>

<Invoke installedOnly="true">
(block (charges chargesDelta newStrength maxCharges)
(setq charges (itmGetCharges gItem))
(setq maxCharges 5)

(if (ls charges maxCharges)
(setq chargesDelta 1)
(setq chargesDelta (subtract 0 maxCharges))
)
(if (eq charges 0)
(setq hpBonus "-30, 650, -30, 25, -30, 25, -30, 25, -30, 25, -30, 25")
(shpRechargeItem gSource gItem chargesDelta)
(objSendMessage gSource Nil (cat "Phase shield set to Ballistic" ))
)
(if (eq charges 1)
(setq hpBonus "-30, 25, -30, 650, -30, 25, -30, 25, -30, 25, -30, 25")
(shpRechargeItem gSource gItem chargesDelta)
(objSendMessage gSource Nil (cat "Phase shield set to Blast" ))
)
(if (eq charges 2)
(setq hpBonus "-30, 25, -30, 25, -30, 650, -30, 25, -30, 25, -30, 25")
(shpRechargeItem gSource gItem chargesDelta)
(objSendMessage gSource Nil (cat "Phase shield set to Thermo" ))
)
(if (eq charges 3)
(setq hpBonus "-30, 25, -30, 25, -30, 25, -30, 650, -30, 25, -30, 25")
(shpRechargeItem gSource gItem chargesDelta)
(objSendMessage gSource Nil (cat "Phase shield set to Plasma" ))
)
(if (eq charges 4)
(setq hpBonus "-30, 25, -30, 25, -30, 25, -30, 25, -30, 650, -30, 25")
(shpRechargeItem gSource gItem chargesDelta)
(objSendMessage gSource Nil (cat "Phase shield set to Nano" ))
)
(if (eq charges 5)
(setq hpBonus "-30, 25, -30, 25, -30, 25, -30, 25, -30, 25, -30, 650")
(shpRechargeItem gSource gItem chargesDelta)
(objSendMessage gSource Nil (cat "Phase shield set to Singularity" ))
)
)
</Invoke>
</ItemType>
As far as I can tell this wont work as 'hpBonus' is just a local variable, not the stat in the shield definition, right? I tried to look for a shield command that would parse the hpBonus variable into the stats for the shield, but those functions are pretty sparse, and seem more to do with reading shield stats than altering them.

Where I stopped was where I was about to add the 'weaponSuppress' change for each mode of the shield... but that too isn't a local variable, it's a shield stat. :(

Anyone got any ideas on this?
User avatar
Atarlost
Fleet Admiral
Fleet Admiral
Posts: 2391
Joined: Tue Aug 26, 2008 12:02 am

Yeah, you can't change stuff in the xml.

What you can do is make multiple shields, give all but one a frequency of notrandom and make the invoke cycle between them. See the Variable Absorption Shield in the Northwind Device Pack for a two state version.
Literally is the new Figuratively
User avatar
Patupi
Militia Lieutenant
Militia Lieutenant
Posts: 123
Joined: Fri Apr 06, 2012 9:24 pm

I did think of doing multiple shields (as I mentioned in the post above) but didn't know how to switch. Thanks for the pointer to NW devices. I'm checking it out to see how they did it. I'm still feeling around about how all this works as yet.
User avatar
Patupi
Militia Lieutenant
Militia Lieutenant
Posts: 123
Joined: Fri Apr 06, 2012 9:24 pm

Quick query, is there a list of invoke keys for devices? Both vanilla and current mods? I want a short cut key to switch shield mode but don't want to duplicate any other key bindings.
sdw195
Militia Captain
Militia Captain
Posts: 779
Joined: Wed Nov 18, 2009 1:01 am
Location: Still looking for the csc Antarctica
Contact:

I don't think there is a mod list, but irc, the tdb has a list of them right after the unids, in that big commented out area,

also, i think "Z" is not used :D
Image
Image
Image
Image
"Dash_Merc - George is a genius, in that he created this game engine that is infinitely extendable"
"<@sheepluva>Good night everybody, may the source be with you." <-- FOSG dev
"You only need THREE tools in life - WD-40 to make things go, Duct Tape to make things stop And C-4 to make things go away"
RPC
Fleet Admiral
Fleet Admiral
Posts: 2876
Joined: Thu Feb 03, 2011 5:21 am
Location: Hmm... I'm confused. Anybody have a starmap to the Core?

I made a wiki page that has the Vanilla Use Keys on it.
Tutorial List on the Wiki and Installing Mods
Get on Discord for mod help and general chat
Image
Image
Der Tod ist der zeitlose Frieden und das leben ist der Krieg
Wir müssen wissen — wir werden wissen!
I don't want any sort of copyright on my Transcendence mods. Feel free to take/modify whatever you want.
User avatar
Patupi
Militia Lieutenant
Militia Lieutenant
Posts: 123
Joined: Fri Apr 06, 2012 9:24 pm

Ya know, I've never seen Transcendence say 'Blah blah'... is that when she ship blows up? :P
Post Reply