Hard Light Productions Forums
Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Wanderer on August 13, 2006, 01:04:42 pm
-
So again something little made with scripts...
Script - Death Flash (http://www.hard-light.net/wiki/index.php/Script_-_Death_Flash) in FSwiki... And this time also a simple screenie showing what it does...
GVC Mekhet dying with GVC Mentu on the background
(http://koti.mbnet.fi/vekkup/FS2/Pics/Common/flashscript.jpg)
-
Looks ace.
How does it affect the frame rate? Non-significantly, tolerably or severely (or un-playably)?
-
With my cpu... none or minimal effect on frame rate.
-
Have the WCSaga guys seen this?
-
Mh looks realy nice and with a little different effect could be very usefull for the WC mod.
[Edit]
Yes just this very second I am posting this ^_^
-
is that the $Flags "Flash"? It's been around for a few weeks now. I actually started added that to my ships, although I don't think i've seen any difference, although i'm probably not looking or missing something.
-
Course, when I try to download the Btest effect, Filefront's user server seems to be down... anywhere else to get it?
But yeah, the screenshot looks great. Looks like some great potential there.
-
Hmm.. works for me... but sure, here is a Link to the file (http://koti.mbnet.fi/vekkup/FS2/Btest.rar).
-
Thank you. ...and VERY nice! :yes: :yes:
heh, that's a hard effect to screenshot. I'm impressed you got such a good one.
Scooby, don't think this has to do with that flag... since this flash uses a particle, not just a HUD flash. Then again maybe I should look at that code...
I feel the flash should come a bit later for big ships, but I don't know how to do that with scripting... yet. Curses, yet more cool stuff to learn :p BRAIN APPROACHING FULL
-
Thank you. ...and VERY nice! :yes: :yes:
heh, that's a hard effect to screenshot. I'm impressed you got such a good one.
Thanks... Lets just say it needs lots of skill... that or then i just tampered (cheated ;) ) with the effect for a bit to get that screenshot after dozens of attempts to get a good screenie from it.
Scooby, don't think this has to do with that flag... since this flash uses a particle, not just a HUD flash. Then again maybe I should look at that code...
Indeed.. This one uses small particle effect (an .eff ani) but it could also flash the whole screen as well (via scripts)
I feel the flash should come a bit later for big ships, but I don't know how to do that with scripting... yet. Curses, yet more cool stuff to learn :p BRAIN APPROACHING FULL
:P Well i sort of cheated with the effect... if you look at the eff frames you ought to see how it was delayed but in short i used minimum (16x16) sized (thanks to DaBrain again) pure black 24-bit dds files to delay the effect. Alternate would have been to create arrays of ship deathtime, velocity and position and use those to generate the flash - problem being that all ship stats are lost on the instant it gets destroyed so those would have to be stored somewhere for the effect to be drawn to the proper location.
-
cool :D
-
that look great!
However i ve copy paste the code in a file called flashdeath-sct.tbm in my mod/data directory and extracted the btest.rar in the /mod/effect directory and got some error messages.
i use a fs2_open-20081109.exe build
Where am i wrong?
-
In order to answer that question, we would need to know what error messages you are getting...
-
ohh you are right, here it is :
Could not find index 'getNumShips' in type 'Mission'
------------------------------------------------------------------
ADE Debug:
------------------------------------------------------------------
Name: (null)
Name of: (null)
Function type: (null)
Defined on: 0
Upvalues: 0
Source: (null)
Short source:
Current line: 0
------------------------------------------------------------------
------------------------------------------------------------------
LUA Stack:
------------------------------------------------------------------
1: Userdata [Mission]
2: String [getNumShips]
------------------------------------------------------------------
-
Same problem here. I copy/past the script into a file call "flash_explo-sct.tbm" and put it into the tables folder. And put the dds files into effects folder. When I launch a mission, I got this message. Should we use a proper build to use this new effect ?
I'm using this build "fs2_open_3_6_10r-20081217_r5008-Wanderer.exe".
-
Hmmm... the script was written for the older scripting version... well.. what follows is improved script but the effect it uses is slightly different..
In textureDetonation = gr.loadTexture("EXP_flash", true) the "EXP_flash" defines the filename of the effect (and can be changed)... example effect (http://koti.mbnet.fi/vekkup/FS2/EXP_flash.rar). As i said i am not good with effects so that is just something i came up with...
#Conditional Hooks
$State: GS_STATE_GAME_PLAY
$On Frame:
[
floatMissionTime = mn.getMissionTime()
if floatMissionTime ~= nil then
floatFrameTime = ba.getFrametime(true)
-- INIT --
if arrayShipW == nil then
math.randomseed( os.time() )
floatCounter = {}
arrayFlashShipList = {}
arrayFlashShips = {}
arrayFlashShipClass = {}
arrayFlashShipPosition = {}
arrayFlashedShips = {}
vectorNull = ba.createVector(0,0,0)
textureDetonation = gr.loadTexture("EXP_flash", true)
--create arrays
arrayShipW = {}
arrayShipH = {}
arrayShipL = {}
arrayShipDetRadius = {}
arrayShipFlashRadius = {}
--stuff arrays
arrayShipW["GTD Orion"] = 500
arrayShipW["GTD Hades"] = 700
arrayShipW["GTD Hecate"] = 700
arrayShipW["GVD Typhon"] = 700
arrayShipW["GVD Hatshepsut"] = 700
arrayShipW["NTF Iceni"] = 400
arrayShipW["GTCv Deimos"] = 350
arrayShipW["GVCv Sobek"] = 275
arrayShipW["GTC Fenris"] = 150
arrayShipW["GTC Leviathan"] = 150
arrayShipW["GVC Aten"] = 150
arrayShipW["GTC Aeolus"] = 80
arrayShipW["GVC Mentu"] = 180
arrayShipW["GTFR Poseidon"] = 35 --45
arrayShipW["GVFr Satis"] = 45
arrayShipW["PVFR Ma'at"] = 20
arrayShipW["GTFR Triton"] = 110
arrayShipW["GVFr Bes"] = 25
arrayShipW["GTT Elysium-class"] = 35
arrayShipW["GTT Argo"] = 95
arrayShipW["GTI Arcadia"] = 1000
arrayShipW["GTA Charybdis"] = 60
arrayShipW["GTA Setekh"] = 100
arrayShipW["GTM Hippocrates"] = 80
arrayShipW["GTG Zephyrus"] = 80
arrayShipW["GVG Anuket"] = 85
arrayShipW["GTSC Faustus"] = 95 --150
arrayShipW["GTSG Mjolnir"] = 100
arrayShipH["GTD Orion"] = 500
arrayShipH["GTD Hades"] = 500
arrayShipH["GTD Hecate"] =500
arrayShipH["GVD Typhon"] =300
arrayShipH["GVD Hatshepsut"] =600
arrayShipH["NTF Iceni"] =450
arrayShipH["GTCv Deimos"] =400
arrayShipH["GVCv Sobek"] =275
arrayShipH["GTC Fenris"] =200
arrayShipH["GTC Leviathan"] =200
arrayShipH["GVC Aten"] =50
arrayShipH["GTC Aeolus"] =90
arrayShipH["GVC Mentu"] =140
arrayShipH["GTFR Poseidon"] = 30 --55
arrayShipH["GVFr Satis"] =50
arrayShipH["PVFR Ma'at"] =20
arrayShipH["GTFR Triton"] =130
arrayShipH["GVFr Bes"] = 15
arrayShipH["GTT Elysium-class"] =45
arrayShipH["GTT Argo"] = 70 --80
arrayShipH["GTI Arcadia"] =1200
arrayShipH["GTA Charybdis"] =90
arrayShipH["GTA Setekh"] =100
arrayShipH["GTM Hippocrates"] = 275 --450
arrayShipH["GTG Zephyrus"] =70
arrayShipH["GVG Anuket"] =80
arrayShipH["GTSC Faustus"] = 85 --140
arrayShipH["GTSG Mjolnir"] =110
arrayShipL["GTD Orion"] = 1900
arrayShipL["GTD Hades"] = 3200
arrayShipL["GTD Hecate"] = 1900
arrayShipL["GVD Typhon"] = 2200
arrayShipL["GVD Hatshepsut"] = 2200
arrayShipL["NTF Iceni"] = 1000
arrayShipL["GTCv Deimos"] = 750
arrayShipL["GVCv Sobek"] = 620
arrayShipL["GTC Fenris"] = 250
arrayShipL["GTC Leviathan"] = 250
arrayShipL["GVC Aten"] = 240
arrayShipL["GTC Aeolus"] = 275
arrayShipL["GVC Mentu"] = 325
arrayShipL["GTFR Poseidon"] = 60 --70
arrayShipL["GVFr Satis"] = 110
arrayShipL["PVFR Ma'at"] = 55
arrayShipL["GTFR Triton"] = 250
arrayShipL["GVFr Bes"] = 60
arrayShipL["GTT Elysium-class"] = 35
arrayShipL["GTT Argo"] = 160 --175
arrayShipL["GTI Arcadia"] = 800
arrayShipL["GTA Charybdis"] = 110
arrayShipL["GTA Setekh"] = 200
arrayShipL["GTM Hippocrates"] = 375
arrayShipL["GTG Zephyrus"] = 255
arrayShipL["GVG Anuket"] = 350
arrayShipL["GTSC Faustus"] = 160
arrayShipL["GTSG Mjolnir"] = 90
arrayShipDetRadius["GTD Orion"] = 500
arrayShipDetRadius["GTD Hades"] = 800
arrayShipDetRadius["GTD Hecate"] = 500
arrayShipDetRadius["GVD Typhon"] = 500
arrayShipDetRadius["GVD Hatshepsut"] = 500
arrayShipDetRadius["NTF Iceni"] = 300
arrayShipDetRadius["GTCv Deimos"] = 200
arrayShipDetRadius["GVCv Sobek"] = 200
arrayShipDetRadius["GTC Fenris"] = 100
arrayShipDetRadius["GTC Leviathan"] = 100
arrayShipDetRadius["GVC Aten"] = 100
arrayShipDetRadius["GTC Aeolus"] = 100
arrayShipDetRadius["GVC Mentu"] = 100
arrayShipDetRadius["GTFR Poseidon"] = 25
arrayShipDetRadius["GVFr Satis"] = 50
arrayShipDetRadius["PVFR Ma'at"] = 25
arrayShipDetRadius["GTFR Triton"] = 100
arrayShipDetRadius["GVFr Bes"] = 25
arrayShipDetRadius["GTT Elysium-class"] = 25
arrayShipDetRadius["GTT Argo"] = 75
arrayShipDetRadius["GTI Arcadia"] = 1000
arrayShipDetRadius["GTA Charybdis"] = 75
arrayShipDetRadius["GTA Setekh"] = 75
arrayShipDetRadius["GTM Hippocrates"] = 200
arrayShipDetRadius["GTG Zephyrus"] = 80
arrayShipDetRadius["GVG Anuket"] = 100
arrayShipDetRadius["GTSC Faustus"] = 50
arrayShipDetRadius["GTSG Mjolnir"] = 40
arrayShipFlashRadius["GTD Orion"] = 2500
arrayShipFlashRadius["GTD Hades"] = 4000
arrayShipFlashRadius["GTD Hecate"] = 2500
arrayShipFlashRadius["GVD Typhon"] = 2500
arrayShipFlashRadius["GVD Hatshepsut"] = 2500
arrayShipFlashRadius["NTF Iceni"] = 1500
arrayShipFlashRadius["GTCv Deimos"] = 1500
arrayShipFlashRadius["GVCv Sobek"] = 1500
arrayShipFlashRadius["GTC Fenris"] = 1000 --350
arrayShipFlashRadius["GTC Leviathan"] = 1000 --350
arrayShipFlashRadius["GVC Aten"] = 1000 --350
arrayShipFlashRadius["GTC Aeolus"] = 1000 --350
arrayShipFlashRadius["GVC Mentu"] = 800 --400
arrayShipFlashRadius["GTFR Poseidon"] = 700 --100
arrayShipFlashRadius["GVFr Satis"] = 800 --200
arrayShipFlashRadius["PVFR Ma'at"] = 600 --100
arrayShipFlashRadius["GTFR Triton"] = 750 --500
arrayShipFlashRadius["GVFr Bes"] = 600 --100
arrayShipFlashRadius["GTT Elysium-class"] = 500 --100
arrayShipFlashRadius["GTT Argo"] = 600 --300
arrayShipFlashRadius["GTI Arcadia"] = 5000
arrayShipFlashRadius["GTA Charybdis"] = 600 --300
arrayShipFlashRadius["GTA Setekh"] = 600 --300
arrayShipFlashRadius["GTM Hippocrates"] = 1700 --800
arrayShipFlashRadius["GTG Zephyrus"] = 800 --350
arrayShipFlashRadius["GVG Anuket"] = 900 --500
arrayShipFlashRadius["GTSC Faustus"] = 800 --250
arrayShipFlashRadius["GTSG Mjolnir"] = 500 --150
end
-- INIT END --
floatRandom = math.random()
integerShips = #mn.Ships
for h = 1, integerShips do
objectShip = mn.Ships[h]
stringShipClass = objectShip.Class.Name
--ONLY SHIPS WITH EFFECTS--
if arrayShipFlashRadius[stringShipClass] ~= nil then
stringShipName = objectShip.Name
floatHP = objectShip.HitpointsLeft
if floatHP <= 0 then
vectorShipPosition = objectShip.Position
if arrayFlashShipList[stringShipName] == nil then
arrayFlashShipList[stringShipName] = 1
arrayFlashShipClass[stringShipName] = stringShipClass
table.insert(arrayFlashShips,stringShipName)
end
arrayFlashShipPosition[stringShipName] = vectorShipPosition
if floatCounter[stringShipName] == nil then
floatCounter[stringShipName] = 0
end
floatRandom = math.random()
while floatCounter[stringShipName] > floatRandom do
floatCounter[stringShipName] = floatCounter[stringShipName] - floatRandom
orientationShip = objectShip.Orientation
local floatRand_1 = (math.random() - 0.5) * arrayShipW[stringShipClass]
local floatRand_2 = (math.random() - 0.5) * arrayShipH[stringShipClass]
local floatRand_3 = (math.random() - 0.5) * arrayShipL[stringShipClass]
local vectorRand = ba.createVector(floatRand_1,floatRand_2,floatRand_3)
local floatDetoSize = (math.random() + 0.5) * arrayShipDetRadius[stringShipClass]
local vectorOrientedRand = orientationShip:unrotateVector(vectorRand)
local vectorDetoPosition = vectorShipPosition + vectorOrientedRand
ts.createParticle(vectorDetoPosition,vectorNull,floatFrameTime,floatDetoSize,PARTICLE_BITMAP,-1,false,textureDetonation)
if floatCounter[stringShipName] <= 0 then
floatCounter[stringShipName] = 0
else
floatRandom = math.random()
end
end
floatCounter[stringShipName] = floatCounter[stringShipName] + floatFrameTime
end
end
floatFlashShips = #arrayFlashShips
for x=1,floatFlashShips do
stringFlashShipName = arrayFlashShips[x]
if arrayFlashShipList[stringFlashShipName] == 1 then
if mn.Ships[stringFlashShipName]:isValid() then
else
arrayFlashShipList[stringFlashShipName] = nil
local vectorFlashPosition = arrayFlashShipPosition[stringFlashShipName]
arrayFlashShipPosition[stringFlashShipName] = nil
local stringFlashClass = arrayFlashShipClass[stringFlashShipName]
arrayFlashShipClass[stringFlashShipName] = nil
local floatFlashRadius = (math.random() + 0.5) * arrayShipFlashRadius[stringFlashClass]
ts.createParticle(vectorFlashPosition,vectorNull,floatFrameTime,floatFlashRadius,PARTICLE_BITMAP,-1,false,textureDetonation)
table.insert(arrayFlashedShips,x)
end
end
end
integerFlashedShips = #arrayFlashedShips
if integerFlashedShips > 0 then
for o=integerFlashedShips,1,-1 do
table.remove(arrayFlashShips,arrayFlashedShips[o])
end
arrayFlashedShips = nil
arrayFlashedShips = {}
end
end
end
]
#End
Haven't actually tried for a short while though
-
ok that work perfectly now!
thanks you!
-
Great ! It work. Well, I must really learn LUA ! Damn, iI want some vacations !! :(