Author Topic: New feature request - random tracer rounds  (Read 9279 times)

0 Members and 1 Guest are viewing this topic.

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: New feature request - random tracer rounds
i wouldnt say that. the purpose of a tracer is to let the gunner see where his shots are going. this is so critical to aiming that pilots were willing to give up their position with tracer fire for it. that said even if you can burn magnesium in space, im sure they would go through some work to get those shots to glow in space. even if it meant gluing a super bright led to the back.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: New feature request - random tracer rounds
Oh I agree that you can have tracer rounds in space. There are plenty of reactions that don't require oxygen.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
« Last Edit: May 19, 2007, 01:32:51 am by jr2 »

 

Offline Unknown Target

  • Get off my lawn!
  • 212
  • Push.Pull?
Re: New feature request - random tracer rounds
Anyway, any hope of this being implemented?

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: New feature request - random tracer rounds
Dunno, how well can you code?

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: New feature request - random tracer rounds
Anyway, any hope of this being implemented?

What are the table field(s) desired? I said I would do this if it would be used, so as long as that's the case, I should have the time to take care of it.

Besides some kind of $Tracer Frequency: field (Which would be set to 1 for all weapons by default), how should tracers behave? Should they do any less damage?
-C

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: New feature request - random tracer rounds
It's worth mentioning that Lightspeed and I had a long discussion about this for the TVWP's ballistic ammo weapons, with me agitating strongly for tracers.  In the end Lightspeed convinced me to use laser graphics for the visual effects, reasoning that tracers would be the only shots you'd see anyway.

So, basically, the same as Backslash's 5x damage, 1/5x time idea.

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Re: New feature request - random tracer rounds
how should tracers behave? Should they do any less damage?

Quote from: http://en.wikipedia.org/wiki/Tracer_rounds
Tracers can also serve to direct fire at a given target, because it is visible to other combatants. The disadvantage is that they betray the shooter's position: the tracer path leads back to its source. To make it more difficult for an enemy to do this, most modern tracers have a 'delay element' that results in the trace becoming visible some distance from the muzzle. Its lethality is similar to conventional ammunition. However, the mass loss and the burning aspects can make the consequences of the impact slightly different.

Dunno about space combat sims, but in Real LifeTM, there's your answer.

 
Re: New feature request - random tracer rounds
I hadn't heard about the magnesium pellet, that's pretty cool. I'll ask my brother what he's using.

It's old stuff now, but 30 years ago our rounds were tipped with a purplish or orangish paint, and the round glowed orange red which was pretty damn cool. I don't know what the ratio was for machine gunners, but for the M-16 on night fire exercises we loaded 1:4 or 1:5 IIRC. It for sure was not a random load because the army counts every damn thing. How else is anything left for the black market?

Although we wanted to (it's hard to see at night d'uh) we didn't load every round a tracer because as jr2 noted your position could be located. The main reason though was because tracers cost a lot more than regular rounds!  :lol:

I haven't seen the show, but if every round glows, verisimilitude must prevail.

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: New feature request - random tracer rounds
It should be extremely simple just to script (Lua) such behaviour for certain (or all) weapons.
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Re: New feature request - random tracer rounds
It should be extremely simple just to script (Lua) such behaviour for certain (or all) weapons.

Erm, so... go ahead?  I mean, if you know how, I imagine you could script it, and then post what you scripted here, and all of you coder geeks can fiddle with it until it's all nice and ready for us to use.  :D

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: New feature request - random tracer rounds
Anyway, any hope of this being implemented?

What are the table field(s) desired? I said I would do this if it would be used, so as long as that's the case, I should have the time to take care of it.

Besides some kind of $Tracer Frequency: field (Which would be set to 1 for all weapons by default), how should tracers behave? Should they do any less damage?

i would have done it in the same way as the spawn flag. as in "tracer weaponname, min frequency, max frequency" that way you could have multiple instances. but as i understand it flags are in short supply, so you could have.

$tracer:             weapon  ;;a weapon from the table to use as a tracer
+MinFrequency:   4   ;;minimum frequency of tracer
+MaxFrequency:  8   ;;maximum frequency of tracer

if you set both frequencys to the same number then it gives you a set rate of occurance. but as with this example it will fire a shot at random rate of between every 4 to 8 shots. id definately use it for my infinite supply of gatling guns, which are common to use mixed ammo.
« Last Edit: May 24, 2007, 03:31:12 am by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: New feature request - random tracer rounds
Hmm... assuming new 'parent' option is already included... then something like shown below or then just altering only the 'tracer' shot. (add necessary randomizers if needed).. Though the version shown below is probably full of bugs...

But if there is going to be hardcoded version for it then i would probably use that.

Code: [Select]
numberWeapons = #mn.Weapons
missiontime = mn.getMissionTime()

if missiontime < 0.5 then
   tracerweaponarray = {}
end

for i=1,numberWeapons do
   objectWeapon = mn.Weapons[i]
   if missiontime > 0.5 and objectWeapon.Class.Name == "tracer thinye" and objectWeapon.LifeLeft > 0 then
      if tracerweaponarray[objectShooter] == nil then
         tracerweaponarray[objectShooter] = 0
      end
      objectShooter = objectWeapon.Parent
      objectWeapon.LifeLeft = 0
      tracerweaponarray[objectShooter] = 1 + tracerweaponarray[objectShooter]
      if tracerweaponarray[objectShooter] == 5 then
         tracerweaponarray[objectShooter] = 0
         mn.createWeapon(tb.WeaponClasses["Tracer"],objectWeapon.Orientation,objectWeapon.Position,objectShooter,-1)
      --add other ammotypes here if needed
      else
         mn.createWeapon(tb.WeaponClasses["Non-Tracer"],objectWeapon.Orientation,objectWeapon.Position,objectShooter,-1)
      end
   end
end

Completely untested etc. etc. ad infinitum (may eat your computer and so on...)
Do not meddle in the affairs of coders for they are soggy and hard to light

  

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: New feature request - random tracer rounds
Well, it'd be more appropriate to do it with something like:
Code: [Select]
#Conditional Hooks
$Version: 3.7
$On Game Init: [
     --Setup variable g_Shooters[][], which is a multidimensional array of shooters and objects

     addWeaponObject = function(object)
          --Indexes array of shooters, then indexes array of objects for that shooter;
          --Adds weapon to array if not found
     end

     getWeaponObjectIndex = function(object)
          --Indexes the above array, and gets what the object's index is,
          --ie how many weapons the ship has fired
     end

     cleanupWeaponObjects = function()
          --Run once per frame to get rid of dead weapons in the array
     end
]
$On HUD Draw: [
     for i=1,#mn.Weapons do
          addWeaponObject(mn.Weapons[i])
     end

     --Ideally, you would use a flag or something to mark each weapon,
     --that still exists this frame, in the above pass.
     cleanupWeaponObjects()
]

$Version: 3.7
$Weapon Class: My Tracer Weapon
$On Object Render: [
     --Empty function
]
+Override: [
     if getWeaponObjectIndex(hv.Object.Parent, hv.Object) % 5 == 0 then
          return false     --Render weapon
     else
          return true     --Don't render weapon
     end
]

This would allow you to deal with tracer weapons more or less transparently, so each weapon wouldn't need any extra table entries. I'm not sure if it'd actually be faster or slower than Wanderer's method.

Ideally, you'd want a $On Weapon Create or $On Object Create or $On Weapon Fire hook of some kind for this sort of thing, to get rid of the tedious and wasteful iteration of mission objects.

Switching rendering on and off is how I was planning on doing it, but now I see that there's actually a request to switch weapon types, so hmm.
-C