Help with unit weapon

Help with unit weapon

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
tyran_nick
Posts: 47
Joined: 07 Mar 2010, 12:42

Help with unit weapon

Post by tyran_nick »

I m trying to make a rather strange unit. The concept is that it is build like a VTOL, flies to the target area, shoots itself to the ground, becoming immobile and then acting like a volcano.

The unit is setup as two different fbis, one for the flying unit and one for the stationary ground unit. I need two different units because I use cob to model the animations and I m not sure how to have both lups for the airjets which use the activeon and the unit transformation in 1 animation. Any suggestions on that would be very welcome!

So here is the unit during deployment:
Image

The weapon of the unit is designed to fire vertically with really bad accuracy, so that it scatters plasma around as if it was something like a volcano. Now my problem is that when I target near the unit most of the shots burst in the air, while when I target away the shots hit the ground (or units normally). Any ideas how to make the unit hit the ground always?

Example of unit firing nearby:
Image
Notice that there are no craters on the ground and the unit has been firing for about a minute...

Example of firing far away from the unit:
Image
In this case the shots hit the ground as intended.

Here is the weapon code:

Code: Select all

[CORVOLC_WEAPON]
{
    name=VolcanoPC;
    turret=1;
    rgbcolor=1 0.4 0.3;
    range=1050;
    reloadtime=0.4;
    weaponvelocity=650;
    energypershot=5000;
    areaofeffect=224;
    edgeeffectiveness=0.75;
    soundstart=XPLONUK4;
    soundhit=rockhit;
    //randomdecay=0.4;
    accuracy=6000;
    explosiongenerator=custom:VOLCBULLET_EXPLOSION;
    startsmoke=1;
    impulsefactor=1;
    impulseboost=0.5;
    cratermult=0.75;
    craterboost=0.5;
    noselfdamage=0;
    hightrajectory=1;
    firestarter=85;
    [DAMAGE]
    {
        default=1500;
    }
}
What am I doing wrong?
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: Help with unit weapon

Post by bobthedinosaur »

try messing with BurnBlow
Saktoth
Zero-K Developer
Posts: 2665
Joined: 28 Nov 2006, 13:22

Re: Help with unit weapon

Post by Saktoth »

This is a high trajectory weapon?

What you have here is basically an engine bug. In order to ensure that a projectile does not exceed its maximum range, plasma projectiles expire after some time, calculated based on the range to the target they are firing at.

Since the range of the target is very close, the projectiles only travel a short distance before expiring- despite the fact that this is a high trajectory weapon and the projectile needs to travel much further than that.

Burnblow wont help with this.

There are no solutions, but several workarounds.

You can change the projectile type to something other than the ballistic Cannon, say, a missile. Use the fixedlauncher, trajectoryheight missile weapon tags to get the high-trajectory effect, and a cegTag with no model or smoke trail to give it the desired appearance.

If you want to get really tricky, you can use torpedoes. Torpedoes behave like missile in water, but ballistic weapons above water. Unlike ballistic weapons, they obey the missile tags for their expiry time. They must be emit-sfx'd though in order to fire out of water, which is clumsy as hell.

All these things are probably more difficult than harassing the engine developers to fix it, though when that might happen, who knows. Hell, there might already be a tag to disable or set Cannon weapon expiry time but i doubt it.
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: Help with unit weapon

Post by bobthedinosaur »

I don't understand why the weapons systems where cut down into specific classes, when before TA styled weapon tags allowed for a mixture of properties (granted they didn't always work out), but it almost seems like we are more limited now with specific weapon types, even though are a ton of additional tags.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Help with unit weapon

Post by KDR_11k »

You can simply give it a crazy-high flighttime. That changes the fuse timer.
User avatar
tyran_nick
Posts: 47
Joined: 07 Mar 2010, 12:42

Re: Help with unit weapon

Post by tyran_nick »

The high flighttime was all that was needed, thanks! Now I need to tweek the accuracy a bit to make sure that it can actually hit something... :)

Saktoth's solution gave me the idea of making models for different "rock" sizes that could be used as projectiles. I suspect a randomisation between different weapons (each weapon a different projectile) could be done in .bos, but could I do a randomisation of the weapon's projectiles directly on the weapon definition file?
User avatar
bobthedinosaur
Blood & Steel Developer
Posts: 2702
Joined: 25 Aug 2004, 13:31

Re: Help with unit weapon

Post by bobthedinosaur »

not in the weapon file. what you can do is fire off a secondary weapon in the script when the 1st one goes off.
Post Reply

Return to “Game Development”