Me Bad At TransScript: OnDestroy

Freeform discussion about anything related to modding Transcendence.
Post Reply
User avatar
Aeonic
Militia Commander
Militia Commander
Posts: 469
Joined: Sun Jun 14, 2009 1:05 am
Location: Designing his dream ship.

Okay, so Atarlost left the Foomerians with some OnDestroy code that summons a Huntress when ships are destroyed based on some probabilities. His code looks like this:

Code: Select all

<Events>
	<OnDestroy>
		(FooShipDestroyed 3)
	</OnDestroy>
</Events>
Now I want to borrow a bit of code from the Sung dragon slaver which deletes any qainlong archcannons and replaces them with a damaged version, only I just want it to delete any weapons in the foomerian ship wreckage with the "ionpulsecannon" tag. So I borrowed the chunk from the dragon slaver and attempted to do this:

Code: Select all

<Events>
	<OnDestroy>
		(FooShipDestroyed 3)

		(block Nil
			; remove any ion pulse cannons from the wreck.
			(enum (objGetItems aWreckObj "w +ionpulsecannon;") theItem
				(objRemoveItem aWreckObj theItem)
				)
	</OnDestroy>
</Events>
Except, it doesn't work. And I understand so little about how Transcendence's scripting works that I don't have a clue why.

BTW, does anyone know of a way to make it so the Huntress ship (which is currently my avatar) create a lovely big explosion when one of the rear drive armor segments is depleted?
Last Cause Of Death: Destroyed by Karl Svalbard's last Lucifer missile, right after I blew him up. And the crowd cheers.
Image
User avatar
Atarlost
Fleet Admiral
Fleet Admiral
Posts: 2391
Joined: Tue Aug 26, 2008 12:02 am

Each event can only contain a single statement so you need to put the FooShipDestroyed statement inside the block like so:

Code: Select all

<Events>
	<OnDestroy>
		(block Nil
			; summon vengance ship
			(FooShipDestroyed 3)

			; remove any ion pulse cannons from the wreck.
			(enum (objGetItems aWreckObj "w +ionpulsecannon;") theItem
				(objRemoveItem aWreckObj theItem)
				)
	</OnDestroy>
</Events>
Otherwise only the first statement is processed.

I'm not sure why you want to remove them though. They're kind of dubious weapons when not turreted. Maybe remove half of them randomly if too many are showing up in loot.
User avatar
Aeonic
Militia Commander
Militia Commander
Posts: 469
Joined: Sun Jun 14, 2009 1:05 am
Location: Designing his dream ship.

Bah, I can just make them virtual if I don't want them to appear in wreckage.
Last Cause Of Death: Destroyed by Karl Svalbard's last Lucifer missile, right after I blew him up. And the crowd cheers.
Image
User avatar
Atarlost
Fleet Admiral
Fleet Admiral
Posts: 2391
Joined: Tue Aug 26, 2008 12:02 am

Why do you want to keep them out of player hands?
User avatar
Aeonic
Militia Commander
Militia Commander
Posts: 469
Joined: Sun Jun 14, 2009 1:05 am
Location: Designing his dream ship.

Well, given that they're about as valuable as a laser cannon and there are tons of them on top of the fact that Foomerian ship wrecks are already loaded, I found in my playing experience that the pulse cannons just feel like clutter. I mean, if you take down a Huntress you have a chance of finding up to six different weapons in the wreckage - light blasters, heavy blasters, rapid pulses and heavy pulses, and each in their damaged state as well. So I thought I'd remove them from the wreckage and see how that goes.
Last Cause Of Death: Destroyed by Karl Svalbard's last Lucifer missile, right after I blew him up. And the crowd cheers.
Image
User avatar
Atarlost
Fleet Admiral
Fleet Admiral
Posts: 2391
Joined: Tue Aug 26, 2008 12:02 am

I think you want to do something like this:

Code: Select all

<Events>
	<OnDestroy>
		(block Nil
			; summon vengance ship
			(FooShipDestroyed 3)

			; remove any ion pulse cannons from the wreck.
			(enum (objGetItems aWreckObj "w +ionpulsecannon;") theItem
				(if (leq 2 (random 1 3))(objRemoveItem aWreckObj theItem))
				)
	</OnDestroy>
</Events>
So you still find some in loot, but not so absurdly many.
User avatar
Aeonic
Militia Commander
Militia Commander
Posts: 469
Joined: Sun Jun 14, 2009 1:05 am
Location: Designing his dream ship.

Why have them in the loot at all if they're useless and just take up space and get in the way? All they're doing is creating more junk to sort through.
Last Cause Of Death: Destroyed by Karl Svalbard's last Lucifer missile, right after I blew him up. And the crowd cheers.
Image
User avatar
Atarlost
Fleet Admiral
Fleet Admiral
Posts: 2391
Joined: Tue Aug 26, 2008 12:02 am

Same reason you have low end stuff appear in loot at all: so you know what you're up against. If you can't loot it you can't do more than guess how dangerous it actually is.

They do have more longevity than just about anything else at their level, doing halfway decent damage to higher level armors. Just because they're not overpowered doesn't mean someone isn't going to find a use for them.
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

you can maybe count them and remove all but one ?
User avatar
Atarlost
Fleet Admiral
Fleet Admiral
Posts: 2391
Joined: Tue Aug 26, 2008 12:02 am

Most people aren't going to care that there's too much loot. They'll just deal with them the way they deal with crappy loot now: ignore it unless they're in dire straits. I don't know anyone who complains about too many turbolasers in Charon frigate or Tripoli wrecks or who complained about too many lancers from worldships in 0.99.
User avatar
Aeonic
Militia Commander
Militia Commander
Posts: 469
Joined: Sun Jun 14, 2009 1:05 am
Location: Designing his dream ship.

That's because turbolasers and lancers can be re-sold to arms dealers and tinkers. They're also a whole lot of the same weapon on a single ship, while Foomerian wrecks have a lot of different weapons. If I hadn't found them to be annoying, I wouldn't have bothered trying to remove them.
Last Cause Of Death: Destroyed by Karl Svalbard's last Lucifer missile, right after I blew him up. And the crowd cheers.
Image
Post Reply