View Thread

 Print Thread
Fighters ammunitions
Rufus Shinra

I hope this first post on the forum won't displease the community, but I have a coding problem for which I've been working too many hours this week.

I've been working on improving (for my use) a mod found online, and one of the features I wanted to implement is the ammunition management for fighter- and corvette-class ships.
The theoretical solution is to put the missile launcher on a subsystem which will damage itself after each shot, that I understand.

But the problem is, the command line:
AddWeaponResult(NewWeaponType, "Hit", "SpawnWeaponFire", "Target", 0, 0, "Hgn_BurstCannonBurst"Wink
When I replace "Target" with "Owner", there isn't any visible effect.
There are three effect lines on my .wepn file, one for the damage on target and two for the damage on the subsystem (one with "Hit", the other with "Miss"Wink. But, when I start the game using this file, the damage in the "Owner" lines is done on the target, while the subsystem is still intact (of course, I tried that with a 1000-health and 100 second repair sub equipped with a weapon doing 1000000 damage to the said-sub at each shot). The sub is damageable, too, and the penetration and precision of the weapon is at 1 for subsystems.
I recently discovered the Friendly Fire option in the "tuning" file, and put it to 1.
I'm using the 1.1 game, FYI.

Does anyone have an idea on the thing(s) I missed ?

Thanks a lot,

Rufus Shinra
Sun Tzu
Browsing this forum has become my ultimate form of procrastination, but I will answer this query anyway:

As far as I remember 'Owner' does not actually work. There is a workaround consisting in having a shadow weapon with the same solution settings as the main one, firing missiles with no life duration and having a sphereburst damage (no visual or audio effect). That way, the main weapon mounted on a subsystem is damaged by the shadow weapon. It did work for weapons like missiles on slow ships. I am not sure it would work on fighters because the firing solutions and sphereburst effects would tend to be unpredictable on a small fast ship. All of this is out of memory, so if anybody has info fresher than 3 years or so, I'd be welcome to stand corrected.

Edited by Sun Tzu on 29-09-2009 15:54
Jump to Forum: