emitted shot exploding on shooter

emitted shot exploding on shooter

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

User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

emitted shot exploding on shooter

Post by smoth »

I have a mech with 2 shots. 1 is fired regular and the other is fired as an emit to replicate twin linked guns.

Image
shot A is the emited shot.

When the mech is moving, shot A will explode on the mech if it is fired in front of the ms

the weapon def

When stationary it fires fine.

Any idea what I can do to prevent the shot from exploding on the mech?
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: emitted shot exploding on shooter

Post by knorke »

I always wondered if you emit a weapon, how does the projectile know which direction/speed etc to go? (and where will homing missiles home to?)

Anyway, if it does not work, couldnt you use projectiles=2 or
burst=2,
burstdelay=very short
?
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: emitted shot exploding on shooter

Post by smoth »

Burst only fires out of 1 emit point.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: emitted shot exploding on shooter

Post by FLOZi »

smoth wrote:Burst only fires out of 1 emit point.
Pretty sure you can use Query or Shot to move between points?
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: emitted shot exploding on shooter

Post by smoth »

Nope. I tried before with the rx79 plus.
unless something has changed.
User avatar
Niobium
Posts: 456
Joined: 07 Dec 2008, 02:35

Re: emitted shot exploding on shooter

Post by Niobium »

smoth wrote:Nope. I tried before with the rx79 plus.
unless something has changed.
Check out the Scalpel (nsaclash) hover in Zero-K, fires 2 rockets simultaneously from different points using 1 weapon and projectiles=2
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: emitted shot exploding on shooter

Post by smoth »

when did this get added? I don't remember such a tag? Also will try when I get home.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: emitted shot exploding on shooter

Post by knorke »

smoth wrote:Burst only fires out of 1 emit point.
works by returning different emit points in QueryWeapon()
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: emitted shot exploding on shooter

Post by smoth »

Burst also requires a delay. This is a twin linked weapon.

Example of query return script please?
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: emitted shot exploding on shooter

Post by knorke »

http://code.google.com/p/springtutorial ... issile.lua or xta/ba for .bos version (ie arm raven)
User avatar
Erik
Posts: 283
Joined: 20 Aug 2009, 20:49

Re: emitted shot exploding on shooter

Post by Erik »

It works if you use QueryWeapon with alternating points AND setting projectiles=2.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: emitted shot exploding on shooter

Post by smoth »

eric, twin linked means firing together simultaneously as one.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: emitted shot exploding on shooter

Post by knorke »

oh, in that case you just have to use QueryWeapon with alternating points AND setting projectiles=2
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: emitted shot exploding on shooter

Post by KDR_11k »

The demo unit for that feature was the bunny from Lolimod, fires twin rocket launchers in a 3 round burst (i.e. 6 projectiles in total) with each projectile launching at a different angle.

Use ShotX to cycle through your firepoints, QueryWeapon gets called by the aiming code as well.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: emitted shot exploding on shooter

Post by Forboding Angel »

Cannon (anything that didn't trigger another weapon)
Aka plasma. Shoots a ballistic projectile. Unlike the DGun it aims properly. Can't be emit-sfxed properly, maybe a ballistic DGun can fill that role.
Long story short, you can't emit cannon shots. Just give it another weapon and slave to 1. That will achieve the desired behavior. I agree though, I prefer to emit weapons when I can just for efficiency's sake, but with a cannon projectile you cannot to it. The projectile will explode usually the moment it is emitted (A lot of this has to do with the fact that the emitted cannon projectile gains no velocity and just falls to the ground usually (if it didn't explode outright).

So, your choices are, A: give it another weapon, slave 2 to 1, or B: use a different weapontype. Shitty.

I suggest petitioning the devs to fix cannon weapontype emits.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: emitted shot exploding on shooter

Post by smoth »

Forboding Angel wrote:1. That will achieve the desired behavior. I agree though, I prefer to emit weapons when I can just for efficiency's sake, but with a cannon projectile you cannot to it.
No other weapon can get high trajectory. Dealwithit.jpg.
Forboding Angel wrote:The projectile will explode usually the moment it is emitted
You didn't read the thread. it emits fine. It doesn't fall to the ground etc.
Forboding Angel wrote:(A lot of this has to do with the fact that the emitted cannon projectile gains no velocity and just falls to the ground usually (if it didn't explode outright).
maybe your weapon def was incorrect.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: emitted shot exploding on shooter

Post by KDR_11k »

Forboding Angel wrote:
Cannon (anything that didn't trigger another weapon)
Aka plasma. Shoots a ballistic projectile. Unlike the DGun it aims properly. Can't be emit-sfxed properly, maybe a ballistic DGun can fill that role.
Long story short, you can't emit cannon shots.
That's outdated information. You can emit cannon shots these days.

Still, for twin-linked guns the projectiles tag is the better option. The ShotX function can cycle between firing points in a multi-projectile attack just fine. Emit-sfx makes more sense if you want to force the weapon on a different trajectory than the engine would aim at (e.g. the spread attack pattern on KP's touhou units). Linking two actual weapons on the unit only makes sense if they're not alike.

Anyway, emit-sfxing for aimed shots is not a good idea because the aim of the parts on the model is often off as the aiming function only gets called in certain intervals. It's usually too small to notice but when you use it for aiming shots it'll amplify the aiming error.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: emitted shot exploding on shooter

Post by smoth »

yeah, I am moving it to that kdr, I was just addressing forbs incorrect points.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: emitted shot exploding on shooter

Post by smoth »

I tried the code and it doesn't like fireweapon it seems to require the function shot instead.

any idea on this?
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: emitted shot exploding on shooter

Post by knorke »

smoth wrote:I tried the code and it doesn't like fireweapon it seems to require the function shot instead.

any idea on this?
tl;dr
Post Reply

Return to “Game Development”