rendered paste body#Global Hooks
$Simulation:
[
if missioninit == nil then
-- // MISSION INIT //
-- remember to //LOAD ALL// the required graphic files!
anitexture01 = gr.loadTexture("sf_cl2_aniparticle_0000")
anitexture02 = gr.loadTexture("sf_cl2_aniparticle_0001")
anitexture03 = gr.loadTexture("sf_cl2_aniparticle_0002")
anitexture04 = gr.loadTexture("sf_cl2_aniparticle_0003")
anitexture05 = gr.loadTexture("sf_cl2_aniparticle_0004")
anitexture06 = gr.loadTexture("sf_cl2_aniparticle_0005")
anitexture07 = gr.loadTexture("sf_cl2_aniparticle_0006")
anitexture08 = gr.loadTexture("sf_cl2_aniparticle_0007")
anitexture09 = gr.loadTexture("sf_cl2_aniparticle_0008")
anitexture10 = gr.loadTexture("sf_cl2_aniparticle_0009")
anitexture11 = gr.loadTexture("sf_cl2_aniparticle_0010")
anitexture12 = gr.loadTexture("sf_cl2_aniparticle_0011")
anitexture13 = gr.loadTexture("sf_cl2_aniparticle_0012")
anitexture14 = gr.loadTexture("sf_cl2_aniparticle_0013")
anitexture15 = gr.loadTexture("sf_cl2_aniparticle_0014")
anitexture16 = gr.loadTexture("sf_cl2_aniparticle_0015")
anitexture17 = gr.loadTexture("sf_cl2_aniparticle_0016")
anitexture18 = gr.loadTexture("sf_cl2_aniparticle_0017")
anitexture19 = gr.loadTexture("sf_cl2_aniparticle_0018")
anitexture20 = gr.loadTexture("sf_cl2_aniparticle_0019")
anitexture21 = gr.loadTexture("sf_cl2_aniparticle_0020")
anitexture22 = gr.loadTexture("sf_cl2_aniparticle_0021")
anitexture23 = gr.loadTexture("sf_cl2_aniparticle_0022")
anitexture24 = gr.loadTexture("sf_cl2_aniparticle_0023")
anitexture25 = gr.loadTexture("sf_cl2_aniparticle_0024")
anitexture26 = gr.loadTexture("sf_cl2_aniparticle_0025")
anitexture27 = gr.loadTexture("sf_cl2_aniparticle_0026")
anitexture28 = gr.loadTexture("sf_cl2_aniparticle_0027")
anitexture29 = gr.loadTexture("sf_cl2_aniparticle_0028")
anitexture30 = gr.loadTexture("sf_cl2_aniparticle_0029")
anitexture31 = gr.loadTexture("sf_cl2_aniparticle_0030")
anitexture32 = gr.loadTexture("sf_cl2_aniparticle_0031")
anitexture33 = gr.loadTexture("sf_cl2_aniparticle_0032")
anitexture34 = gr.loadTexture("sf_cl2_aniparticle_0033")
anitexture35 = gr.loadTexture("sf_cl2_aniparticle_0034")
anitexture36 = gr.loadTexture("sf_cl2_aniparticle_0035")
anitexture37 = gr.loadTexture("sf_cl2_aniparticle_0036")
anitexture38 = gr.loadTexture("sf_cl2_aniparticle_0037")
anitexture39 = gr.loadTexture("sf_cl2_aniparticle_0038")
anitexture40 = gr.loadTexture("sf_cl2_aniparticle_0039")
anitexture41 = gr.loadTexture("sf_cl2_aniparticle_0040")
anitexture42 = gr.loadTexture("sf_cl2_aniparticle_0041")
anitexture43 = gr.loadTexture("sf_cl2_aniparticle_0042")
anitexture44 = gr.loadTexture("sf_cl2_aniparticle_0043")
anitexture45 = gr.loadTexture("sf_cl2_aniparticle_0044")
-- define nullvec
nullvec = ma.newVector(0,0,0)
missioninit = 1
end
-- // PER FRAME // Simulation
-- get the proper weapons
for i = 1,mn.getNumWeapons() do
frametime = ba.getFrametime()
weapon = mn.getWeaponByIndex(i)
weaponname = weapon.Class.Name
if weaponname == "Charged Laser II" then
lifetime = weapon.LifeLeft
-- set //LENGHT OF THE ANIMATION //
anilenght = 1.8
-- calculates the required frame number
modulolife = math.mod(lifetime,anilenght)
remntlife = modulolife / anilenght
-- //ADD MORE// if additional frames are required
remntlife = 45 * remntlife
if remntlife > 44 then
anitexture = anitexture01
elseif remntlife > 43 then
anitexture = anitexture02
elseif remntlife > 42 then
anitexture = anitexture03
elseif remntlife > 41 then
anitexture = anitexture04
elseif remntlife > 40 then
anitexture = anitexture05
elseif remntlife > 39 then
anitexture = anitexture06
elseif remntlife > 38 then
anitexture = anitexture07
elseif remntlife > 37 then
anitexture = anitexture08
elseif remntlife > 36 then
anitexture = anitexture09
elseif remntlife > 35 then
anitexture = anitexture10
elseif remntlife > 34 then
anitexture = anitexture11
elseif remntlife > 33 then
anitexture = anitexture12
elseif remntlife > 32 then
anitexture = anitexture13
elseif remntlife > 31 then
anitexture = anitexture14
elseif remntlife > 30 then
anitexture = anitexture15
elseif remntlife > 29 then
anitexture = anitexture16
elseif remntlife > 28 then
anitexture = anitexture17
elseif remntlife > 27 then
anitexture = anitexture18
elseif remntlife > 26 then
anitexture = anitexture19
elseif remntlife > 25 then
anitexture = anitexture20
elseif remntlife > 24 then
anitexture = anitexture21
elseif remntlife > 23 then
anitexture = anitexture22
elseif remntlife > 22 then
anitexture = anitexture23
elseif remntlife > 21 then
anitexture = anitexture24
elseif remntlife > 20 then
anitexture = anitexture25
elseif remntlife > 19 then
anitexture = anitexture26
elseif remntlife > 18 then
anitexture = anitexture27
elseif remntlife > 17 then
anitexture = anitexture28
elseif remntlife > 16 then
anitexture = anitexture29
elseif remntlife > 15 then
anitexture = anitexture30
elseif remntlife > 14 then
anitexture = anitexture31
elseif remntlife > 13 then
anitexture = anitexture32
elseif remntlife > 12 then
anitexture = anitexture33
elseif remntlife > 11 then
anitexture = anitexture34
elseif remntlife > 10 then
anitexture = anitexture35
elseif remntlife > 9 then
anitexture = anitexture36
elseif remntlife > 8 then
anitexture = anitexture37
elseif remntlife > 7 then
anitexture = anitexture38
elseif remntlife > 6 then
anitexture = anitexture39
elseif remntlife > 5 then
anitexture = anitexture40
elseif remntlife > 4 then
anitexture = anitexture41
elseif remntlife > 3 then
anitexture = anitexture42
elseif remntlife > 2 then
anitexture = anitexture43
elseif remntlife > 1 then
anitexture = anitexture44
elseif remntlife >= 0 then
anitexture = anitexture45
end
-- finally, be nice and draw the particle
ts.createParticle(weapon.Position,nullvec,frametime,15,"bitmap",-1,false,anitexture)
end
end
-- Odd method is used for rendering to prevent all the effects from being in the same 'phase'
-- Also this is to avoid possible issues of having too long affects that would 'keep' on the
-- effects course but which would not actually be attached to it
]
#End