Difference between revisions of "Script - Scripted Flak"

From FreeSpace Wiki
Jump to: navigation, search
(new page)
(No difference)

Revision as of 20:02, 7 July 2006

Function

Creates particles that are closely attached to certain weapon effects - in this case to flak weapons. This ought to fix the potential problem of missing or double glowpoints appearing with normal particle spew (pspew) option.

Table Entry

#Global Hooks

$GameInit:

[

flaktexture = gr.loadTexture("yellow_glow")
nullvec = ma.newVector(0,0,0)

]

$Simulation:

[

frametime = ba.getFrametime()

for i=1, mn.getNumWeapons() do
   local flakweapon = mn.getWeaponByIndex(i)
   local flakname = flakweapon.Class.Name
   if flakname == "Flak Rapid" or flakname == "Standard Flak" or flakname == "Heavy Flak" or flakname == "Long Range Flak" then
      ts.createParticle(nullvec,nullvec,frametime,1.5,"Bitmap",-1,false,flaktexture,flakweapon)
   end
end

]

#End

Notes

Requires that the flak weapons are stripped of their respective particle spew settings. That is weapon flag "particle spew" and also all the lines from $Pspew: to +Bitmap: should be removed.