The Grand Overlay Showcase
As overlays were one of the major developments in Ver 1.0 this thread will be a show & tell of how overlays can be used.
Coming soon: The Syrtian War adventure mod!
A Turret defense genre mod exploring the worst era in Earth's history.
Can you defend the Earth from the Syrtian invaders?
Stay tuned for updates!
A Turret defense genre mod exploring the worst era in Earth's history.
Can you defend the Earth from the Syrtian invaders?
Stay tuned for updates!
Code: Select all
<!-- Overdrive Shield -->
<ItemType UNID="&itOverdriveShield;"
name= "overdrive shield"
level= "3"
value= "2500"
mass= "1800"
frequency= "rare"
modifiers= "MajorItem"
description= "The overdrive shield has its own micro reactor, using some of the ship's fuel when overdrive mode is activated."
>
<Image imageID="&rsItems1;" imageX="192" imageY="0" imageWidth="96" imageHeight="96"/>
<Shields
hitPoints= "200"
regen= "0"
depletionDelay= "360"
powerUse= "5"
/>
<Invoke InstalledOnly="True" key="O">
(block Nil
(if (not (objGetData gPlayerShip "Overdrive"))
(objAddOverlay gPlayerShip &ovOverdrive; (ObjGetPos gPlayership) 0)
(plyMessage gPlayer "Overdrive mode is already active.")
)
)
</Invoke>
</ItemType>
<OverlayType UNID="&ovOverdrive;">
<Effect>
<Image imageID="&rsDominaEffects1;"
imageX="288"
imageY="0"
imageWidth="96"
imageHeight="96"
imageFrameCount="3"
imageTicksPerFrame="3"/>
</Effect>
<Events>
<OnCreate>
(block nil
(objSetData gPlayerShip "Overdrive" True)
(objSetOverlayData gSource aOverlayID "charge" (multiply (shpGetShieldMaxHitPoints gPlayership) 2))
)
</OnCreate>
<OnDamage>
(block (dmgType)
;; here we can simulate hpBonus by specifying custom
;; resistances for each damage type
;; currently all damage is reduced by 20% when overdrive is active
(setq dmgType (itmGetDamageType (itmCreate aWeaponType 0)))
(switch
;; laser damage
(eq dmgType 0)
(setq aDamageHP (divide (multiply aDamageHP 100) 80))
;; kinetic damage
(eq dmgType 1)
(setq aDamageHP (divide (multiply aDamageHP 100) 80))
;; particle damage
(eq dmgType 2)
(setq aDamageHP (divide (multiply aDamageHP 100) 80))
;; blast damage
(eq dmgType 3)
(setq aDamageHP (divide (multiply aDamageHP 100) 80))
;; ion damage
(eq dmgType 4)
(setq aDamageHP (divide (multiply aDamageHP 100) 80))
;; thermo damage
(eq dmgType 5)
(setq aDamageHP (divide (multiply aDamageHP 100) 80))
;; positron damage
(eq dmgType 6)
(setq aDamageHP (divide (multiply aDamageHP 100) 80))
;; plasma damage
(eq dmgType 7)
(setq aDamageHP (divide (multiply aDamageHP 100) 80))
;; antimatter damage
(eq dmgType 8)
(setq aDamageHP (divide (multiply aDamageHP 100) 80))
;; nano damage
(eq dmgType 9)
(setq aDamageHP (divide (multiply aDamageHP 100) 80))
;; graviton damage
(eq dmgType A)
(setq aDamageHP (divide (multiply aDamageHP 100) 80))
;; singularity damage
(eq dmgType B)
(setq aDamageHP (divide (multiply aDamageHP 100) 80))
;; dark acid damage
(eq dmgType C)
(setq aDamageHP (divide (multiply aDamageHP 100) 80))
;; dark steel damage
(eq dmgType D)
(setq aDamageHP (divide (multiply aDamageHP 100) 80))
;; dark lightning damage
(eq dmgType E)
(setq aDamageHP (divide (multiply aDamageHP 100) 80))
;; dark fire damage
(eq dmgType F)
(setq aDamageHP (divide (multiply aDamageHP 100) 80))
;; we were hit by a missile
(not dmgType)
(setq aDamageHP (divide (multiply aDamaageHP 100) 80))
;; just in case we didn't match already...
aDamageHP
)
)
</OnDamage>
<OnUpdate>
(block Nil
;; the shield consumes some fuel when in overdrive mode
(shpConsumeFuel gplayership 50)
;; now we determine the regen rate
(switch
;; if the deplete delay has been run, remove the overlay
(leq (objGetOverlayData gSource aOverlayID "charge") -100)
(block Nil
(objRemoveOverlay gSource aOverlayID)
(objSetData gPlayerShip "Overdrive" Nil)
)
;; if the charge has run out simulate deplete delay
(leq (objGetOverlayData gSource aOverlayID "charge") 0)
(block Nil
(objIncOverlayData gSource aOverlayID "charge" -1)
)
;; if the shields are at 0 we use what we can
(eq (shpGetShieldDamage gPlayerShip) (shpGetShieldMaxHitPoints gPlayership))
(block (Chunck)
(setq Chunck (max (objGetOverlayData gSource aOverlayID "charge")
(shpGetShieldMaxHitPoints gPlayership))
)
(shpRechargeShield gSource Chunck)
)
;; if theres heavy shield damage we heal alot
(and (geq (shpGetShieldDamage gPlayerShip) 50)
(geq (objGetOverlayData gSource aOverlayID "charge") 25)
)
(block Nil
(shpRechargeShield gSource 25)
(objIncOverlayData gSource aOverlayID "charge" -25)
)
;; if theres medium shield damage we help regen
(and (geq (shpGetShieldDamage gPlayerShip) 20)
(geq (objGetOverlayData gSource aOverlayID "charge") 10)
)
(block Nil
(shpRechargeShield gSource 10)
(objIncOverlayData gSource aOverlayID "charge" -10)
)
;; if theres light shield damage we help finish up
(and (geq (shpGetShieldDamage gPlayerShip) 1)
(geq (objGetOverlayData gSource aOverlayID "charge") 1)
)
(block Nil
(shpRechargeShield gSource 1)
(objIncOverlayData gSource aOverlayID "charge" -1)
)
;; Shields are at max, slowly burn off excess
(objIncOverlayData gSource aOverlayID "charge" -1)
)
)
</OnUpdate>
</Events>
</OverlayType>
This is a shield, a rather worthless shield by itself, but it can be activated and pushed into overdrive mode.
Once activated it adds an overlay to your ship, providing the shield regen boosting the bonusHP resistances to each specific damage type by 20% and consumes a small amount of fuel.
This shield works fantastically for those who like to jump into a big swarm of enemies then run away once the overdrive wears off. Not a great pick for a freighter pilot.
Coming soon: The Syrtian War adventure mod!
A Turret defense genre mod exploring the worst era in Earth's history.
Can you defend the Earth from the Syrtian invaders?
Stay tuned for updates!
A Turret defense genre mod exploring the worst era in Earth's history.
Can you defend the Earth from the Syrtian invaders?
Stay tuned for updates!
Code: Select all
<!--- Laser Turret --->
<ItemType UNID="&itLightAutoTurret;"
name= "laser turret"
level= "2"
value= "750"
mass= "1500"
frequency= "rare"
unknownType= "&itUnknownEnhancer2;"
modifiers= "MajorItem"
description= "The laser turret will auto detect and fire at enemy ships within 20 ls. It can be switched on and off at will."
>
<Image imageID="&rsItems1;" imageX="96" imageY="0" imageWidth="96" imageHeight="96"/>
<MiscellaneousDevice
powerUse= "20"
/>
<Events>
<OnInstall>
(block Nil
(objAddOverlay gPlayerShip &ovLightAutoTurret; (objGetPos gPlayerShip) 0)
(objSetData gPlayerShip "TurretActive" True)
(objSetKnown gSource)
)
</OnInstall>
</Events>
<Invoke InstalledOnly="True" key="T">
(block Nil
(if (not (objGetData gPlayerShip "TurretActive"))
(block Nil
(objSetData gPlayership "TurretActive" True)
(plyMessage gPlayer "Turret is Active")
)
(block Nil
(objSetData gPlayerShip "TurretActive" Nil)
(plyMessage gPlayer "Turret is Inactive")
)
)
)
</Invoke>
</ItemType>
<OverlayType UNID="&ovLightAutoTurret;"
>
<Events>
<OnCreate>
</OnCreate>
<OnUpdate>
(block Nil
;; check if the turret is active
(if (eq (objGetData gPlayerShip "TurretActive") True)
(block (target fireAngle)
;; find an enemy ship within 20ls
(setq target (item (sysfindobject gSource "sEN:20") 0))
(if target
(block (fireAngle)
(setq fireAngle (sysVectorAngle (sysVectorSubtract (objGetPos target) (objGetPos gPlayerShip))))
(sysCreateWeaponFire
&itLaserCannon;
gSource
(objGetPos gSource)
fireAngle
100
target
)
)
)
)
)
)
</OnUpdate>
</Events>
</OverlayType>
This is the long awaited companion to the ICX missile turret.
A secondary weapon for the player ship!
Once installed, the laser turret will auto scan for enemies in close range of your ship and happily blast away at them.
It also comes equipped with a safety feature, it can be turned off manually if you are near some friendly stations or ships.
Coming soon: The Syrtian War adventure mod!
A Turret defense genre mod exploring the worst era in Earth's history.
Can you defend the Earth from the Syrtian invaders?
Stay tuned for updates!
A Turret defense genre mod exploring the worst era in Earth's history.
Can you defend the Earth from the Syrtian invaders?
Stay tuned for updates!
** moved from elsewhere in the forum...**
At least, it will look like a Ranx Dread.
Everything else will still be the same: speed, cargo cap, weapons, armor, etc but it will look like something else.
The new ship graphic will turn appropriately with your ship with no discernable lag. Your shots do not hit the ship, neither do the enemies though. You can't downsize your current ship, say from the freighter to a battlepod. It just looks silly.
Code: Select all
<OverlayType UNID="&ovRanxDread;">
<Effect>
<Image imageID="&rsLargeShips1;" imageX="960" imageY="0" imageWidth="192" imageHeight="192" rotationCount="20"/>
</Effect>
</OverlayType>
Everything else will still be the same: speed, cargo cap, weapons, armor, etc but it will look like something else.
The new ship graphic will turn appropriately with your ship with no discernable lag. Your shots do not hit the ship, neither do the enemies though. You can't downsize your current ship, say from the freighter to a battlepod. It just looks silly.
Coming soon: The Syrtian War adventure mod!
A Turret defense genre mod exploring the worst era in Earth's history.
Can you defend the Earth from the Syrtian invaders?
Stay tuned for updates!
A Turret defense genre mod exploring the worst era in Earth's history.
Can you defend the Earth from the Syrtian invaders?
Stay tuned for updates!
- Arisaya
- Fleet Admiral
- Posts: 5535
- Joined: Tue Feb 05, 2008 1:10 am
- Location: At the VSS Shipyards in the frontier, designing new ships.

Really all you'd need is a way of forcing an animation frame based upon target direction, but if you wanted to be fancy, you could also have it turn to fact its target too (has to be fast, otherwise it won't face it in time by the time it fires)!
(shpOrder gPlayership 'barrelRoll)
<New tutorials, modding resources, and official extension stuff coming to this space soon!>
<New tutorials, modding resources, and official extension stuff coming to this space soon!>
- Arisaya
- Fleet Admiral
- Posts: 5535
- Joined: Tue Feb 05, 2008 1:10 am
- Location: At the VSS Shipyards in the frontier, designing new ships.

Mostly since I want to do rotating turrets on capships.
But for playerships, what could be done is giving them a specific turret, and giving them a 'turret slot' into which a weapon can be installed... something like that.
(shpOrder gPlayership 'barrelRoll)
<New tutorials, modding resources, and official extension stuff coming to this space soon!>
<New tutorials, modding resources, and official extension stuff coming to this space soon!>
Code: Select all
<ItemType UNID="&itVariableShield;"
name= "variable shield"
level= "7"
value= "35000"
mass= "3000"
frequency= "rare"
modifiers= "MajorItem"
description= "The variable shield has controls to adjust its polarity and resist certain energy types."
>
<Image imageID="&rsItems1;" imageX="192" imageY="0" imageWidth="96" imageHeight="96"/>
<Shields
hitPoints= "300"
regen= "32"
depletionDelay= "480"
powerUse= "600"
/>
<Events>
<OnInstall>
(block Nil
(objAddOverlay gPlayerShip &ovVariableShield; (objGetPos gPlayerShip) 0)
(objSetData gPlayerShip "resist" 0)
)
</OnInstall>
</Events>
<Invoke InstalledOnly="True" key="V">
(block (resist)
(if (not (objGetData gPlayerShip "resist"))
(objSetData gPlayerShip "resist" 0)
)
(setq resist (objGetData gPlayerShip "resist"))
(switch
(eq resist 0)
(block Nil
(objSetData gPlayerShip "resist" 1)
(plyMessage gPlayer "Shield set to Kinetic Resist")
)
(eq resist 1)
(block Nil
(objSetData gPlayerShip "resist" 2)
(plyMessage gPlayer "Shield set to Particle Resist")
)
(eq resist 2)
(block Nil
(objSetData gPlayerShip "resist" 3)
(plyMessage gPlayer "Shield set to Blast Resist")
)
(eq resist 3)
(block Nil
(objSetData gPlayerShip "resist" 4)
(plyMessage gPlayer "Shield set to Ion Resist")
)
(eq resist 4)
(block Nil
(objSetData gPlayerShip "resist" 5)
(plyMessage gPlayer "Shield set to Thermo Resist")
)
(eq resist 5)
(block Nil
(objSetData gPlayerShip "resist" 6)
(plyMessage gPlayer "Shield set to Positron Resist")
)
(eq resist 6)
(block Nil
(objSetData gPlayerShip "resist" 7)
(plyMessage gPlayer "Shield set to Plasma Resist")
)
(eq resist 7)
(block Nil
(objSetData gPlayerShip "resist" 0)
(plyMessage gPlayer "Shield set to Laser Resist")
)
)
)
</Invoke>
</ItemType>
<OverlayType UNID="&ovVariableShield;">
<Events>
<OnDamage>
(block (dmgType resist)
(setq dmgType (itmGetDamageType (itmCreate aWeaponType 0)))
(setq resist (objGetData gPlayerShip "resist"))
(switch
(eq dmgType resist)
(setq aDamageHP 0)
(setq aDamageHP (divide (multiply aDamageHP 5) 4))
)
)
</OnDamage>
</Events>
</OverlayType>
This shield is able to be tuned into different damage types and provide 100% reduction of the chosen damage type, while making all others less resistant by 20%.
Rotating turrets is still quite difficult, they can be animated to swivel or they can be affixed to match the player ship's rotation. Doing both is not currently possible nor is having them point where they are shooting. If overlays supported image variants it could be possible. Currently we cannot access the overlay image in script.Wolfy wrote:Really all you'd need is a way of forcing an animation frame based upon target direction,
You could create a ship/auton with the turret image and manually move it to the appropriate position in an event but it would have to fire very fast or you would see a lag.
Coming soon: The Syrtian War adventure mod!
A Turret defense genre mod exploring the worst era in Earth's history.
Can you defend the Earth from the Syrtian invaders?
Stay tuned for updates!
A Turret defense genre mod exploring the worst era in Earth's history.
Can you defend the Earth from the Syrtian invaders?
Stay tuned for updates!
- alterecco
- Fleet Officer
- Posts: 1658
- Joined: Wed Jan 14, 2009 3:08 am
- Location: Previously enslaved by the Iocrym
I tried this earlier, and it does not work well. The lag is very visible.Prophet wrote: You could create a ship/auton with the turret image and manually move it to the appropriate position in an event but it would have to fire very fast or you would see a lag.
- Arisaya
- Fleet Admiral
- Posts: 5535
- Joined: Tue Feb 05, 2008 1:10 am
- Location: At the VSS Shipyards in the frontier, designing new ships.
I had the idea about half an hour ago to make extra UI stuff via overlays.
By making a 1-facing overlay that always appears on the playership's center OR on the targetted ship in some applications, you can have images pop up on the HUD.
For example, a certain ROM might add a little damage-type icon to the lower right near the targeting circle to indicate the damagetype which will be most effective against the targeted ship for example.
That's just an example. There will be plenty of things you can do with this.
By making a 1-facing overlay that always appears on the playership's center OR on the targetted ship in some applications, you can have images pop up on the HUD.
For example, a certain ROM might add a little damage-type icon to the lower right near the targeting circle to indicate the damagetype which will be most effective against the targeted ship for example.
That's just an example. There will be plenty of things you can do with this.

(shpOrder gPlayership 'barrelRoll)
<New tutorials, modding resources, and official extension stuff coming to this space soon!>
<New tutorials, modding resources, and official extension stuff coming to this space soon!>
Holographic stealth device
It disguises the player as an enemy, using overlays. Its probably not balanced, but it is functional.
For use on player ships only(uses gPlayerShip), but it could be converted.
It disguises the player as an enemy, using overlays. Its probably not balanced, but it is functional.
For use on player ships only(uses gPlayerShip), but it could be converted.
Very nice job Bobby. I especially like the custom dockscreen image. I look forward to installing it on my freighter to sail past those pesky ranx.
Coming soon: The Syrtian War adventure mod!
A Turret defense genre mod exploring the worst era in Earth's history.
Can you defend the Earth from the Syrtian invaders?
Stay tuned for updates!
A Turret defense genre mod exploring the worst era in Earth's history.
Can you defend the Earth from the Syrtian invaders?
Stay tuned for updates!
- Aeonic
- Militia Commander
- Posts: 469
- Joined: Sun Jun 14, 2009 1:05 am
- Location: Designing his dream ship.
I'm assuming a device like this would deactivate as soon as the player attacked, or if it doesn't, it should. That way its only good for checking things out ahead of time.
Last Cause Of Death: Destroyed by Karl Svalbard's last Lucifer missile, right after I blew him up. And the crowd cheers.


I wanted it to, but am not aware of an <onWeaponFired> event. the other option is to apply a peaceful constraint effect, but that seems hard-coded to the cyberdeck device. It deactivates if the player starts taking hits.
it does deactivate if the player docks(not immediately, does <onObjDocked> work on an overlay?), so you can't dock at an enemy station and loot it, but if you're fast you still can.
it does deactivate if the player docks(not immediately, does <onObjDocked> work on an overlay?), so you can't dock at an enemy station and loot it, but if you're fast you still can.