Author Topic: Irritating artillery  (Read 4830 times)

0 Members and 1 Guest are viewing this topic.

Offline Boomer

  • 28
Irritating artillery
I've been trying to make an "artillery" weapon for freespace and I've got it to work, but then I came to the end to test the final product, and the bloody ships won't fire it!  I'll post the code here, it's just infuriating....

$Name:          Tunneler
$Model File:        piranha.pof
$Mass:          1.0
$Velocity:      40.0
$Fire Wait:     8.0
$Damage:        200         ;; damage applied when within inner radius
$Blast Force:       3000.0
$Inner Radius:      50.0         ;; radius at which damage is full (0 for impact only)
$Outer Radius:      150.0         ;; max radius for attenuated damage
$Shockwave Speed:   40           ;; velocity of shockwave.  0 for none.
$Armor Factor:      4.0
$Shield Factor:     0.01
$Subsystem Factor:  25.0
$Lifetime:      40.0
$Energy Consumed:   0.0       ;; Energy used when fired
$Cargo Size:        1.0       ;; Amount of space taken up in weapon cargo
$Homing:          YES
 ;; the following indented fields are only required when $Homing is YES
 +Type:        ASPECT        ;; Legal: HEAT, ASPECT
 +Turn Time:   1.5
 +Min Lock Time: 2.0       ;; Minimum lock time (in seconds)
 +Lock Pixels/Sec: 70          ;; Pixels moved per sec while locking
 +Catch-up Pixels/Sec:100        ;; Pixels moved per sec while catching up
 +Catch-up Penalty:      30        ;; Extra pixels to move after catching up
$LaunchSnd:     96          ;; The sound it makes when fired
$ImpactSnd:     88          ;; The sound it makes when it hits something
$FlyBySnd:      -1
$Rearm Rate:        0.02       ;; number of missiles/sec that are rearmed
$Flags:         ("Bomb" "Big Ship" "Huge" "Spawn Artillery Baby, 150" "Remote Detonate" "local ssm" )
$Trail:            ;; Trail cannot be set if Exhaust is set
 +Start Width:      0.5         ;; Width of trail nearest missile
 +End Width:      1.75        ;; Width of trail before it "evaporates"
 +Start Alpha:  1.0
 +End Alpha:  0.0
 +Max Life:        1.5         ;; how many seconds before trail disappears
 +Bitmap:      MissileTrail04      ;; Bitmap used to draw trail
$Icon:          iconmissile04
$Anim:          LoadMissile04
$Impact Explosion:      none
$Local SSM:
 +Warpout Delay:    2500
 +Warpin Delay:     6000
 +Stage 5 Velocity: 500
 +Warpin Radius:    1000
 +Lock Range:       15000

If I take out the Spawn flag it works, but the spawn flag is necessary to the character of the weapon.  Any suggestions?  It's driving me crazy!
:shaking: :hopping: :mad2:
Viva la UBERBOMB!

"I have no gods, only questions." -Me

A man once came to me and asked me to express a profound thought.  I told him.....<Static>...

Look on the bright side, it looks absolutely nothing like a penis.-Turambar

I reject your reality and substitute my own!

 

Offline FireCrack

  • 210
  • meh...
"Spawn arltillery bayby, 150"

Is that right, or should there be a comma after spawn?
« Last Edit: June 27, 2005, 12:18:57 am by 2073 »
actualy, mabye not.
"When ink and pen in hands of men Inscribe your form, bipedal P They draw an altar on which God has slaughtered all stability, no eyes could ever soak in all the places you anoint, and yet to see you all at once we only need the point. Flirting with infinity, your geometric progeny that fit inside you oh so tight with triangles that feel so right."
3.141592653589793238462643383279502884197169399375105820974944 59230781640628620899862803482534211706...
"Your ever-constant homily says flaw is discipline, the patron saint of imperfection frees us from our sin. And if our transcendental lift shall find a final floor, then Man will know the death of God where wonder was before."

 

Offline phreak

  • Gun Phreak
  • 211
  • -1
spawn will only work on turrets if there are at least 2 fighters within 1500 meters of the turret
Offically approved by Ebola Virus Man :wtf:
phreakscp - gtalk
phreak317#7583 - discord

 

Offline Boomer

  • 28
Oh, great, so it's a coding issue?
Wonderful....:deadpan:
back to the drawing boards...
Viva la UBERBOMB!

"I have no gods, only questions." -Me

A man once came to me and asked me to express a profound thought.  I told him.....<Static>...

Look on the bright side, it looks absolutely nothing like a penis.-Turambar

I reject your reality and substitute my own!

 

Offline phreak

  • Gun Phreak
  • 211
  • -1
it was put in place since the only spawn weapons on capitals are piranhas and synaptics,  its just an easy out so they don't need to gain a target lock on something in order to launch them.
Offically approved by Ebola Virus Man :wtf:
phreakscp - gtalk
phreak317#7583 - discord

 

Offline FireCrack

  • 210
  • meh...
Should realy have another flag for that, like

$DontDoFighterProxCheck


osr somthing...
actualy, mabye not.
"When ink and pen in hands of men Inscribe your form, bipedal P They draw an altar on which God has slaughtered all stability, no eyes could ever soak in all the places you anoint, and yet to see you all at once we only need the point. Flirting with infinity, your geometric progeny that fit inside you oh so tight with triangles that feel so right."
3.141592653589793238462643383279502884197169399375105820974944 59230781640628620899862803482534211706...
"Your ever-constant homily says flaw is discipline, the patron saint of imperfection frees us from our sin. And if our transcendental lift shall find a final floor, then Man will know the death of God where wonder was before."

 

Offline Solatar

  • 211
What kind of artillery effect are you going for?

 

Offline StratComm

  • The POFressor
  • 212
  • Cameron Crazy
    • http://www.geocities.com/cek_83/index.html
Quote
Originally posted by FireCrack
Should realy have another flag for that, like

$DontDoFighterProxCheck


osr somthing...


If I'm understanding Phreak correctly, what he's trying to say is that right now, the swarm tag on capship turrets bypasses the normal AI all together, instead relying on a primitive "are targets in range" check.  What you'd actually need is an overhaul of a chunk of AI behavior, which is a slightly more complicated request than a bug as such.
who needs a signature? ;)
It's not much of an excuse for a website, but my stuff can be found here

"Holding the last thread on a page comes with an inherent danger, especially when you are edit-happy with your posts.  For you can easily continue editing in points without ever noticing that someone else could have refuted them." ~Me, on my posting behavior

Last edited by StratComm on 08-23-2027 at 08:34 PM

 

Offline phreak

  • Gun Phreak
  • 211
  • -1
actually i think its a 1 line fix.  i'll see if G5k will let me add this in before 3.6.7
Offically approved by Ebola Virus Man :wtf:
phreakscp - gtalk
phreak317#7583 - discord

 

Offline phreak

  • Gun Phreak
  • 211
  • -1
here's the offending code

Code: [Select]

//If this is a spawning type weapon, shoot it!
if ( wip->wi_flags & WIF_SPAWN )
{
if (( num_ships_nearby >= 3 ) || ((num_ships_nearby >= 2) && (frand() < 0.1f))) {
turret_fire_weapon(i, ss, parent_objnum, &gpos, &ss->turret_last_fire_direction);
} else {
ss->turret_next_fire_stamp = timestamp(1000); // Regardless of firing rate, don't check whether should fire for awhile.
}

//we're done with this weapon mount
continue;
}


after modifications, this should work fine

Code: [Select]

//If this is a spawning type weapon, shoot it as long as they're told otherwise.
if (( wip->wi_flags & WIF_SPAWN ) && (!wip->wi_flags2 & WIF_NO_AUTOSHOOT))
{
if (( num_ships_nearby >= 3 ) || ((num_ships_nearby >= 2) && (frand() < 0.1f))) {
turret_fire_weapon(i, ss, parent_objnum, &gpos, &ss->turret_last_fire_direction);
} else {
ss->turret_next_fire_stamp = timestamp(1000); // Regardless of firing rate, don't check whether should fire for awhile.
}

//we're done with this weapon mount
continue;
}
Offically approved by Ebola Virus Man :wtf:
phreakscp - gtalk
phreak317#7583 - discord

 

Offline Flipside

  • əp!sd!l£
  • 212
Hmmmm... Capital Ships always have infinite missiles iirc?

I wonder if that could be altered to account for, for example, torpedos a'la StarLancer? A modified Fenris carrying, say,  4 Meson torpedoes would actually become an item of concern for a Ravana, for example? Or would it be better to use sexp's for that sort of thing?

 

Offline Singh

  • Hasn't Accomplished Anything Special Or Notable
  • 211
  • Degrees of guilt.
the Turret-lock and fire-turret sexps are your friends :)
"Blessed be the FREDder that knows his sexps."
"Cursed be the FREDder that trusts FRED2_Open."
Dreamed of much, accomplished little. :(

 

Offline NGTM-1R

  • I reject your reality and substitute my own
  • 213
  • Syndral Active. 0410.
The problem is that you can't specify the turret to fire a number of times before it turret-locks, so it will not, and cannot, be an exact science. And folks will notice that.
"Load sabot. Target Zaku, direct front!"

A Feddie Story

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
Yes, except that there is no fire-turret sexp.  There's the old fire-beam, but no fire-turret... yet, we hope.
The Trivial Psychic Strikes Again!

 

Offline Black Wolf

  • Twisted Infinities
  • 212
  • Hey! You! Get off-a my cloud!
    • Visit the TI homepage!
Quote
Originally posted by ngtm1r
The problem is that you can't specify the turret to fire a number of times before it turret-locks, so it will not, and cannot, be an exact science. And folks will notice that.


But if you control when the turret fires (through the suggested "turret-fire" sexp) it'd work out fine.
TWISTED INFINITIES · SECTORGAME· FRONTLINES
Rarely Updated P3D.
Burn the heretic who killed F2S! Burn him, burn him!!- GalEmp

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Pretty much what I would have suggested BW. This is something that it would be nice to have specified in the table or in FRED but which could be implemented using events fairly easily anyway.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 
Solution: Create an invisible model with no collision detection and label it as a fighter. Give it no weapons or anything, make it invulnerable, and put about 20 of them in the mission on the enemy side, ordering them to attack your ship. They won't do any damage to it, and no one will notice them, but their proximity will allow your weapons to fire.
Sig censored by people with no sense of humor

 

Offline Boomer

  • 28
Thanks guys.  I tried DW's way and I've gotten the best results:devil:

If you're lucky, once I get the bugs worked out, I'll release it to the public, see if you guys can't have some fun with it!
Viva la UBERBOMB!

"I have no gods, only questions." -Me

A man once came to me and asked me to express a profound thought.  I told him.....<Static>...

Look on the bright side, it looks absolutely nothing like a penis.-Turambar

I reject your reality and substitute my own!

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Fire-turret should be put on the fast track after 3.6.7, methinks. :)

 

Offline phreak

  • Gun Phreak
  • 211
  • -1
you know goob, i was also thinking of adding the "no autofire" flag too :)
Offically approved by Ebola Virus Man :wtf:
phreakscp - gtalk
phreak317#7583 - discord