How to? - Make a Wreck explode during docking

Freeform discussion about anything related to modding Transcendence.
Post Reply
IceMephit
Militia Lieutenant
Militia Lieutenant
Posts: 124
Joined: Thu Oct 22, 2009 4:46 pm
Location: Maine

Is it possible to have a wrecked ship explode when a playership docks with it, before the dockscreen? Just curious. I wanted to add a nasty suprise to looting. It would have to be a percentage chance to happen, maybe a base percent adj by ship size/class. And can I make it bypass the ships shields? I figure, if your docked with it, some portion of the ship hads to breach your shields. That portion would not encounter shielding, just armor. Just curious?

Thanx!!!
For Sale: One slightly used EI500 freighter. Hull damaged, primary weapon defective, shields inoperable. Must be towed to Dry-dock. Make an offer!!
Bobby
Militia Captain
Militia Captain
Posts: 675
Joined: Wed Jul 25, 2007 7:39 pm

It would certainly be possible.


I pulled this out of the events tag on the arena.

Code: Select all

			<OnObjDocked>
				(if (and (eq aDockTarget gSource) (not (eq aObjDocked gPlayerShip)))
					(block (arenaRank)
						(setq arenaRank (objGetGlobalData gSource "arenaRank"))

						(switch
							(eq arenaRank 'gladiator)
								(block Nil
									(objMoveTo aObjDocked gSource)
									(shpCancelOrders aObjDocked)
									(objSuspend aObjDocked)
									)

							(block Nil
								(objMoveTo aObjDocked (sysVectorPolarOffset gSource 270 300))
								(objUnregisterForEvents gSource aObjDocked)
								(shpCancelOrders aObjDocked)
								(shpOrderGate aObjDocked)
								)
							)
						)
					)
			</OnObjDocked>

(eq aObjDocked gPlayerShip) should tell you if it's the player that docked, you can then run your custom event to explode the wreck or whatever else you want to do, like contaminate the player's ship, emp it, etc.

(scrExitDock gScreen) can be used to kick the player out of the dockscreen before he/she can do anything.

There's a new function (objDamage) which I believe skips shields, see the pteravores for an example of its use.
User avatar
Song
Fleet Admiral
Fleet Admiral
Posts: 2831
Joined: Mon Aug 17, 2009 4:27 am

Well, if it's possible to make wrecks explode on undocking (which, given it happens in RC3 with the annoying NPC looters, IS)...then it should be possible to make them explode ON docking.

Just be careful it doesn't happen with really important things....

(Iocrym Command Ship wreck explodes with Thermoexplosion4, killing you before you can get the control rod= :twisted: )
Mischievous local moderator. She/Her pronouns.
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.

how do you control the explosion level of the wreck explosion?
(shpOrder gPlayership 'barrelRoll)

<New tutorials, modding resources, and official extension stuff coming to this space soon!>
Post Reply