"Borg" Shield

Freeform discussion about anything related to modding Transcendence.
Post Reply
User avatar
Arisaya
Fleet Admiral
Fleet Admiral
Posts: 5535
Joined: Tue Feb 05, 2008 1:10 am
Location: At the VSS Shipyards in the frontier, designing new ships.

Rather than how the luminous use several damage specific shields, I'm trying to make a shield that can switch between damage types while operating.
ie:
1) get's hit
2) records damage type
3) is vulnerable for a while then changes damage types.

I'd also like to implement a manual override control so that, say, facing the ares it won't keep changing between positron, ion and thermo.
(shpOrder gPlayership 'barrelRoll)

<New tutorials, modding resources, and official extension stuff coming to this space soon!>
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

create a number of shields with the desidered immunities and use my switching code to switch between them ?

[EDIT] And, you have to recharge the shield at the same hp it was before the switch using shpGetShieldDamage and shpRechargeShield.
User avatar
Arisaya
Fleet Admiral
Fleet Admiral
Posts: 5535
Joined: Tue Feb 05, 2008 1:10 am
Location: At the VSS Shipyards in the frontier, designing new ships.

digdug wrote:create a number of shields with the desidered immunities and use my switching code to switch between them ?

[EDIT] And, you have to recharge the shield at the same hp it was before the switch using shpGetShieldDamage and shpRechargeShield.
switching code? (have a link or example?)
mind showing me how to use the shpGetShieldDamage and shpRechargeShield?
All I know how to script is the stuff i've seen from George's work and other various mods.
(shpOrder gPlayership 'barrelRoll)

<New tutorials, modding resources, and official extension stuff coming to this space soon!>
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

here for the switching code.
http://xelerus.de/index.php?s=mod&id=56

here for the shield functions (description and syntax)
http://xelerus.de/index.php?s=functions&c=shield


for recharging the shield to the same level:

.you already know the maxhitpoints of the shields (assuming they are all identical but the immunity), so no need to use shpGetShieldMaxHitPoints.
.before switch setq the current damage by maxhp-shpGetShieldDamage
.switch the shield
.recharge the new shield with the value previously stored using shpRechargeShield
Sponge
Militia Commander
Militia Commander
Posts: 250
Joined: Sun Jan 28, 2007 7:51 pm

You should probably include some timer events, because otherwise the shield will be changing with every new hit. Make it so it can only change every 20 seconds or something like that.
User avatar
Arisaya
Fleet Admiral
Fleet Admiral
Posts: 5535
Joined: Tue Feb 05, 2008 1:10 am
Location: At the VSS Shipyards in the frontier, designing new ships.

Sponge wrote:You should probably include some timer events, because otherwise the shield will be changing with every new hit. Make it so it can only change every 20 seconds or something like that.
I was asking for help since i have no idea how to script anything like this, though i did realise that.
(shpOrder gPlayership 'barrelRoll)

<New tutorials, modding resources, and official extension stuff coming to this space soon!>
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

Is there an OnHit or OnDamage or OnDamageType event for shields? I seem to recall reading that there wasn't really an effective method to tell when a shield got hit, other than OnShieldDown which only gives you access to when the shield fails.

Luminous shields are changed through a destroyed event where the luminous drone fires a script when it gets destroyed to tell the luminous station to make a different configuration for the next drone(s) it is producing.

So how will you manage to know when the shield got hit? I suppose that you could continuously check with shipGetShieldDamage, but would that perform well? And how would you know the damage type that hit the shield?
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

I was thinking about cycling throught the shields by "U"sing the shield device.

To Periculi: There is no OnHit event, that would solve this problem, and would be extremely useful for many many ideas a lot of people had in the past.

Luminous calls a couple of hardcoded aGlobals: aDestroyer and aObjDestroyed, they involve the destruction of the calling ship, so they are not useful in this case. (at the best of my knowledge, lol)
Bobby
Militia Captain
Militia Captain
Posts: 675
Joined: Wed Jul 25, 2007 7:39 pm

here is my attempt at this idea: after being "u"sed the shield gets swaped with a new one, and is charged to the same hp as the other, problem is it deletes other shields of the same unid in your cargo hold(i tried to fix this and ended up creating them, i had 62 laser switch shelds!).
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

Bobby, you are not declaring "shieldunid" in the block

Code: Select all

(block (store enshield charge)
and you can add an additional argument to the put the objRemoveItem :number of items to remove:

Code: Select all

(objRemoveItem gPlayerShip (itmCreate shieldunid 1) 1)

If you don't declare the number of items to remove, transcendence is going to remove all of them from the cargo ?
Post Reply