Weapon issues for Antares II player ship

Freeform discussion about anything related to modding Transcendence.
Post Reply
LlubNek
Anarchist
Anarchist
Posts: 3
Joined: Sun Mar 20, 2011 9:41 pm

I started making playable versions of the Antares I and Antares II a while back and recently came back to it, but I've run into a couple of problems.

First, 12 armour segments don't fit in the HUD. The numbers look ok, but the labels take up too much space. I don't really think there's much I can do about that.

Second, the Antares II uses two omnidirectional Heavy Recoilless Cannons placed at opposite ends of the ship which fire simultaneously. The code which implements this in the non-playable version is...
<Devices>
<Device deviceID="&itHeavyRecoillessCannon;" secondaryWeapon="true" posAngle="0" posRadius="25" omnidirectional="true"/>
<Device deviceID="&itHeavyRecoillessCannon;" secondaryWeapon="true" posAngle="180" posRadius="25" omnidirectional="true"/>
</Devices>
... which doesn't work for playable ships (neither weapon fires if secondaryWeapon is true, the weapons are independent rather than firing together, and, if either weapon is replaced, the attributes on the <Device> tags don't carry over).

Right now, I've just cloned the &itHeavyRecoillessCannon; device, made it use two slots instead of one and doubled the firing rate, but that kinda sucks.

What I'd like to do is make a weapon which can't be removed and doesn't actually fire a shot itself, but triggers whatever other primary weapons are installed, and create an event triggered whenever a weapon is installed to position it at one end of the ship or the other and make it omnidirectional. So... how much of that is possible, and how?

You can find my work in progress here:
http://rghost.net/4856205

Both Antares I and Antares II work well other than the issues mentioned above. I haven't made any attempt to balance these, but the Antares II seems to be about as difficult to play as the default player ships (at least in the early game). Escorting the Korolov EI200 is practically impossible since it's far faster, but it can generally defend itself well enough...
User avatar
Ttech
Fleet Admiral
Fleet Admiral
Posts: 2767
Joined: Tue Nov 06, 2007 12:03 am
Location: Traveling in the TARDIS
Contact:

LlubNek wrote:I started making playable versions of the Antares I and Antares II a while back and recently came back to it, but I've run into a couple of problems.

First, 12 armour segments don't fit in the HUD. The numbers look ok, but the labels take up too much space. I don't really think there's much I can do about that.

Second, the Antares II uses two omnidirectional Heavy Recoilless Cannons placed at opposite ends of the ship which fire simultaneously. The code which implements this in the non-playable version is...
<Devices>
<Device deviceID="&itHeavyRecoillessCannon;" secondaryWeapon="true" posAngle="0" posRadius="25" omnidirectional="true"/>
<Device deviceID="&itHeavyRecoillessCannon;" secondaryWeapon="true" posAngle="180" posRadius="25" omnidirectional="true"/>
</Devices>
... which doesn't work for playable ships (neither weapon fires if secondaryWeapon is true, the weapons are independent rather than firing together, and, if either weapon is replaced, the attributes on the <Device> tags don't carry over).

Right now, I've just cloned the &itHeavyRecoillessCannon; device, made it use two slots instead of one and doubled the firing rate, but that kinda sucks.

What I'd like to do is make a weapon which can't be removed and doesn't actually fire a shot itself, but triggers whatever other primary weapons are installed, and create an event triggered whenever a weapon is installed to position it at one end of the ship or the other and make it omnidirectional. So... how much of that is possible, and how?

You can find my work in progress here:
http://rghost.net/4856205

Both Antares I and Antares II work well other than the issues mentioned above. I haven't made any attempt to balance these, but the Antares II seems to be about as difficult to play as the default player ships (at least in the early game). Escorting the Korolov EI200 is practically impossible since it's far faster, but it can generally defend itself well enough...
as far as i can recall you can do someting like this http://xelerus.de/index.php?s=mod&id=703
Image
Image
LlubNek
Anarchist
Anarchist
Posts: 3
Joined: Sun Mar 20, 2011 9:41 pm

Ttech wrote:as far as i can recall you can do someting like this http://xelerus.de/index.php?s=mod&id=703
That's pretty much what I'm doing already.

The way it's set up for the CSC, you can't change the weapons or armour without effectively downgrading from 36 armour segments and 4 active weapons to 4 armour segments and 1 active weapon.

I'm trying to avoid that.

I'm pretty sure I can make a device that fires all installed weapons using <OnFireWeapon> and sysCreateWeaponFire, but I have no idea how to get the timing to match the installed weapons instead of the fake weapon I'd use to link them.
Lokasenna
Miner
Miner
Posts: 32
Joined: Sun Mar 06, 2011 6:33 pm

I'm a complete noob to Transcendence scripting, so I have no idea how this would specifically be done or if it's entirely possible, but in a general programming sense I'd try:

- Get the fire rate of each installed weapon.
- When the Fire Everything command is given, fire everything once for the initial burst and then start incrementing a counter for each tick that the command is still active.
- On each tick, for each weapon, if the current number of ticks is an even multiple of the fire rate, fire the weapon. That is, if a weapon fires every five ticks, it would fire on *0* 1 2 3 4 *5* 6 7 8 9 *10* and so on.

Assuming that's all doable, the only remaining issue I can think of would be finishing each weapon's "cooldown" when the command stops. As is, rapidly pressing the appropriate key would let you cheat the fire rate counter.

Perhaps you could keep the counter running until the slowest weapon has refreshed, and then reset it. If the command is given while the counter is anything but zero, it skips the initial blast and picks the counter up where it is.
User avatar
alterecco
Fleet Officer
Fleet Officer
Posts: 1658
Joined: Wed Jan 14, 2009 3:08 am
Location: Previously enslaved by the Iocrym

This has come up many times before, and is dubbed the Alpha Strike weapon. It is indeed possible to do it in script, using OnFire weapons. I think Atarlost built a version that does alpha striking, but I am not sure. What Lokasenna describes is basically correct.
User avatar
Atarlost
Fleet Admiral
Fleet Admiral
Posts: 2391
Joined: Tue Aug 26, 2008 12:02 am

Not I. I think it was digdug and it had some problems generalizing.
Literally is the new Figuratively
LlubNek
Anarchist
Anarchist
Posts: 3
Joined: Sun Mar 20, 2011 9:41 pm

Atarlost wrote:Not I. I think it was digdug and it had some problems generalizing.
Found it, thanks :) :
http://www.neurohack.com/transcendence/ ... php?t=3379

Would be nice if you could attach properties like posAngle, posRadius and omnidirectional to the weapon slots instead of the weapons. It would make the other end of this problem much easier to fix.
User avatar
Ttech
Fleet Admiral
Fleet Admiral
Posts: 2767
Joined: Tue Nov 06, 2007 12:03 am
Location: Traveling in the TARDIS
Contact:

LlubNek wrote:
Atarlost wrote:Not I. I think it was digdug and it had some problems generalizing.
Found it, thanks :) :
http://www.neurohack.com/transcendence/ ... php?t=3379

Would be nice if you could attach properties like posAngle, posRadius and omnidirectional to the weapon slots instead of the weapons. It would make the other end of this problem much easier to fix.
you could post that on trac
Image
Image
Post Reply