Hard Light Productions Forums

Modding, Mission Design, and Coding => The Scripting Workshop => Topic started by: Wanderer on March 16, 2009, 07:44:09 am

Title: New(er) flash deaths script
Post by: Wanderer on March 16, 2009, 07:44:09 am
Ok... so a slightly improved version of the ye olde script...

Old one... http://www.hard-light.net/forums/index.php/topic,45089.0.html

-----

EDIT...

New one... See Script - Flashy Deaths (new) (http://www.hard-light.net/wiki/index.php/Script_-_Flashy_Deaths_(new)) - thanks to Mobius and Zacam

Parsing order of the entries was changed so please make sure you use compatible data (new entries in wiki have data which is compatible with the lua script on the wikipage).

-----


Recommendations, requests, feedback... anything...

EDIT: fixed couple of issues with the effects loading.. now if it hits an invalid effect it should just toss out a warning and only omit drawing the bugged effect instead of having fits and crashing
Title: Re: New(er) flash deaths script
Post by: Dilmah G on March 16, 2009, 08:00:25 am
So I copy those files, place in appropriate location and paste the relevant data into them?
Title: Re: New(er) flash deaths script
Post by: Wanderer on March 16, 2009, 08:06:22 am
Pretty much so
Title: Re: New(er) flash deaths script
Post by: Dilmah G on March 16, 2009, 08:23:06 am
Hmmm, I played ST:R with those files in their correct locations, what was meant to happen? I didn't notice a lot
Title: Re: New(er) flash deaths script
Post by: Wanderer on March 16, 2009, 08:30:12 am
Well... hmm...

Can you post what build you were using?

Can you post the contents of the two cfg files you were using?
Title: Re: New(er) flash deaths script
Post by: Dilmah G on March 16, 2009, 08:37:41 am
Well... hmm...

Can you post what build you were using?

Can you post the contents of the two cfg files you were using?

Currently using 5090

Code: (exp_ani_flashes.cfg) [Select]
Filename:      EXP_flash.eff
Filename:      exp04.ani
Filename:      exp05.ani

Code: (expl_flashes.cfg) [Select]
Name:                   GTF Ulysses
Width:                  20
Height:                 10
Length:                 20
Detonation Radius:      10.0
Flash Radius:           500.0
Detonation Effects:     1, 1, 1, 2
Flash Effect:           2
Detonation Multiplier:  0.2

Name:                   GTF Hercules
Width:                  20
Height:                 10
Length:                 200
Detonation Radius:      20.0
Flash Radius:           500.0
Detonation Effects:     2, 1, 3, 2, 1
Flash Effect:           3

Name:                   GTFR TRITON
Width:                  500
Height:                 100
Length:                 2000
Detonation Radius:      200.0
Flash Radius:           5000.0
Detonation Effects:     1, 1, 1, 2, 1
Flash Effect:           1
Title: Re: New(er) flash deaths script
Post by: Wanderer on March 16, 2009, 08:47:58 am
Well... you probably lack the EXP_flash effect. Try defining only effects (as animations) you actually have

Also the script affects only the listed ships
Title: Re: New(er) flash deaths script
Post by: Dilmah G on March 16, 2009, 08:51:05 am
Well... you probably lack the EXP_flash effect. Try defining only effects (as animations) you actually have

Also the script affects only the listed ships

Ahh I see, I knew it only affected the Ulysses, Herc and the freighter. I just copied your sample text and pasted basically so I must've missed that. Is there a retail/mvp flash .eff file I can replace that with or is there somewhere I can dl it. Apologies for being a n00b at code, if it's not FRED I'm really out of my depth.

EDIT: Oh wait, found the link to it in your old post, I had a feeling it would be there somewhere, I'll dl it and report back tomorrow. It's getting late here.
Title: Re: New(er) flash deaths script
Post by: Nuke on March 16, 2009, 01:29:20 pm
as far as i can tell it works
Title: Re: New(er) flash deaths script
Post by: Mobius on March 16, 2009, 01:47:31 pm
Can someone please an expl_flashes.cgf including all ships? :)

EDIT: Where do I get a standard .cfg file?  :confused:
Title: Re: New(er) flash deaths script
Post by: Wanderer on March 16, 2009, 02:26:49 pm
By writing it with text editor
Title: Re: New(er) flash deaths script
Post by: Zacam on March 17, 2009, 03:07:25 am

**Edit: No longer any missing values, but still needs testing for moar variations. Also: Remove the Filename extensions from exp_ani_flashes.cfg and it will use MediaVP/FSO hierarchy properly.

Please see the Wiki link for information.
Title: Re: New(er) flash deaths script
Post by: Mobius on March 19, 2009, 12:03:20 pm
Please note that "GTSc Faustus" ---> "GTSC Faustus" and "GTI Ganyamede" ---> "GTI Ganymede". :)

EDIT: Script Wikified! (http://www.hard-light.net/wiki/index.php/Script_-_Flashy_Deaths_(new))   :cool:
Title: Re: New(er) flash deaths script
Post by: Zacam on March 20, 2009, 07:50:52 pm
The "c" in "GTSC" (or GTSc) is not case sensitive.

I've just always done GTSc and GTCv,  GT(V)Fr/PVFr/SFr and GTDr.

Good catch on the Ganymede though.

(Note: I don't do the same on things like the GTVA, GTNB, GT(V)SG or GT(V)EP because each letter is a separate word.)

Just edited post above. Further edits still pending to Wiki. Corrections to script pending Wanderer.
Title: Re: New(er) flash deaths script
Post by: Wanderer on March 22, 2009, 02:32:35 am
Removed the script from the initial post as it is now available in fs wiki in slightly improved version. Just make sure you use the files provided with the script in wiki when using the table currently in wiki. That is there has been some small changes to the parsing order so old data might not be compatible.
Title: Re: New(er) flash deaths script
Post by: Tinman on March 22, 2009, 03:39:46 am
Removed the script from the initial post as it is now available in fs wiki in slightly improved version. Just make sure you use the files provided with the script in wiki when using the table currently in wiki. That is there has been some small changes to the parsing order so old data might not be compatible.

the link in the first post is missing a ")"  :p
http://www.hard-light.net/wiki/index.php/Script_-_Flashy_Deaths_(new) (http://www.hard-light.net/wiki/index.php/Script_-_Flashy_Deaths_(new))

Title: Re: New(er) flash deaths script
Post by: Mobius on March 22, 2009, 03:46:10 am
Fix it yourself? :p
Title: Re: New(er) flash deaths script
Post by: Wanderer on March 22, 2009, 03:52:27 am
done
Title: Re: New(er) flash deaths script
Post by: Zacam on May 09, 2009, 08:27:33 pm
So, I don't know if it's RC 2, or what, but I heard from VA (and experienced it myself) that the explosion effects are not taking place. The flash is though.

In some cases, the flash is being done _well_ after the ship explosion. I've been using it to place the flash in the last sequence of detonation effects list so that you get "Flash, Shockwave" but I cannot think of anything to really do for the timing of the actual flash parameter itself.
Title: Re: New(er) flash deaths script
Post by: Wanderer on May 09, 2009, 11:53:55 pm
Ok... Fixed issue with happened when detonation multiplier had not been defined. Now effects should work again. See FSwiki page

As for the timing of the flash... There is not much that can be done. That is the effect occurs at the moment when the ship is 'truly lost' from the game. As the 'deathroll time' varies greatly depending on order set, damage caused etc etc it is very difficult to get a good estimation of the proper timing for the flash
Title: Re: New(er) flash deaths script
Post by: Dragon on June 23, 2009, 06:55:24 am
I have a problem with using this script for a mod.
I copy-pasted script from wiki to deto-sct.tbm and placed .cfg files in data/scripts
Code: [Select]
Warning: Failed to initialize flashy deaths script
File: lua.cpp
Line: 7146


Call stack:
------------------------------------------------------------------
    fs2_open_3_6_11d-20090616_r5342.exe 00c57e71()
    fs2_open_3_6_11d-20090616_r5342.exe 00c5f063()
    fs2_open_3_6_11d-20090616_r5342.exe 00c587c1()
    fs2_open_3_6_11d-20090616_r5342.exe 00c510ba()
    fs2_open_3_6_11d-20090616_r5342.exe 00c57536()
    fs2_open_3_6_11d-20090616_r5342.exe 00c58cb4()
    fs2_open_3_6_11d-20090616_r5342.exe 00c50fd6()
    fs2_open_3_6_11d-20090616_r5342.exe 007bdd7d()
    fs2_open_3_6_11d-20090616_r5342.exe 007be012()
    fs2_open_3_6_11d-20090616_r5342.exe 007bcd18()
    fs2_open_3_6_11d-20090616_r5342.exe 007be0e5()
    fs2_open_3_6_11d-20090616_r5342.exe 00744718()
    fs2_open_3_6_11d-20090616_r5342.exe 007448d6()
    fs2_open_3_6_11d-20090616_r5342.exe 00751783()
    fs2_open_3_6_11d-20090616_r5342.exe 00982046()
------------------------------------------------------------------
Debug log ends with this:
Code: [Select]
Tried to release debris01a.dds that has a load count of 2.. not releasing
Releasing bitmap debris01a-glow.dds in slot 2532 with handle 2387032
Releasing bitmap debris01a-shine.dds in slot 2533 with handle 2391783
ERROR: Verify failure: Vbuf0 != NULL

File: 3ddraw.cpp
Line: 451
    fs2_open_3_6_11d-20090616_r5342.exe 00b5fbf0()
    fs2_open_3_6_11d-20090616_r5342.exe 00b6445f()
    fs2_open_3_6_11d-20090616_r5342.exe 00781103()
    fs2_open_3_6_11d-20090616_r5342.exe 00b579e4()
    fs2_open_3_6_11d-20090616_r5342.exe 007833a5()
    fs2_open_3_6_11d-20090616_r5342.exe 00b5869a()
    fs2_open_3_6_11d-20090616_r5342.exe 0077f3a4()
    fs2_open_3_6_11d-20090616_r5342.exe 00cc749a()
    fs2_open_3_6_11d-20090616_r5342.exe 00cc7132()
    fs2_open_3_6_11d-20090616_r5342.exe 007c9b79()
    fs2_open_3_6_11d-20090616_r5342.exe 00baf938()
    fs2_open_3_6_11d-20090616_r5342.exe 00c57e71()
    fs2_open_3_6_11d-20090616_r5342.exe 00c5f063()
    fs2_open_3_6_11d-20090616_r5342.exe 00c587c1()
    fs2_open_3_6_11d-20090616_r5342.exe 00c510ba()

expl_flashes.cfg (that's only the first entry ,but I didn't made any typos in others)
Code: [Select]
==Terran==
Name: Breaker
Width: 80
Height: 100
Length: 200
Detonation Radius: 100
Detonation Effects: 2, 3
Flash Radius: 750
Flash Effect: 4
I'm sure that "Breaker" is a valid name ,the ship itself is around 100m long (it's a gunship).
exp_ani_flashes.cfg
Code: [Select]
Filename: EXP_flash
Filename: ExpH
Filename: energyH
Filename: FlashH
All of them are animations in data/effects.
EnergyH is in .ani format ,the rest are in .eff .
Can you tell me what i'm doing wrong?
Title: Re: New(er) flash deaths script
Post by: Wanderer on June 23, 2009, 09:52:32 am
Well... that is because i had placed the the 'search directory' for the script as the table directory. Either place the cfg files related to the script to the tables directory or better yet change all the "data/tables/" references in the script into "data/scripts/"
Title: Re: New(er) flash deaths script
Post by: Dragon on June 23, 2009, 10:49:02 am
Now it works and looks awesome ,thank you Wanderer.
Title: Re: New(er) flash deaths script
Post by: Dragon on July 01, 2009, 01:45:01 pm
I really don't like to say it, but it again stopped working. (the same warning that I encouncered previously)
I'm using latest nightly build and I have moved the script to separate mod folder. (so I can easly toggle it on and off via launcher)
.cfg files are in data/tables ,as well as deto-sct.tbm ,effects are in data/effects.
I'm sure that "Slayer" is a valid name ,as well as effect names.
Code: [Select]
Filename: EXP_flash
Filename: FlashH
Filename: FlashH
Filename: FlashH
Code: [Select]
Name: Slayer
Width: 150
Height: 200
Length: 250
Detonation Radius: 100
Detonation Effects: 4, 4
Detonation Multiplier:  0
Flash Radius: 1000
Flash Effect: 4
I set "Detonation Multipiler" to zero, because I want only the final flash.
All effects are in .eff format.
Title: Re: New(er) flash deaths script
Post by: Wanderer on July 03, 2009, 01:18:22 pm
Does the script (that you are using) point to data/tables or to data/scripts ?
Title: Re: New(er) flash deaths script
Post by: Dragon on July 03, 2009, 04:50:39 pm
I didn't changed anything in it, it's the one copypasted from wiki.
It points to data/tables .
Title: Re: New(er) flash deaths script
Post by: Wanderer on July 04, 2009, 03:20:04 am
Hmm.. i'll try to find time so that i can take a look at what is wrong
Title: Re: New(er) flash deaths script
Post by: Dragon on July 10, 2009, 09:03:41 am
I swiched to most recent nightly and still get this message, this time a bit more extended:
Code: [Select]
Failed to initialize flashy deaths script
ĚĚĚôô"˙`}! KiFastSystemCallRet
ĚĚĚôô"˙`}! WaitForSingleObject + 18 bytes
ĚĚĚôô"˙`}! <no symbol>
ĚĚĚôô"˙`}! <no symbol>
ĚĚĚôô"˙`}! <no symbol>
ĚĚĚôô"˙`}! <no symbol>
ĚĚĚôô"˙`}! <no symbol>
ĚĚĚôô"˙`}! <no symbol>
ĚĚĚôô"˙`}! <no symbol>
ĚĚĚôô"˙`}! <no symbol>
ĚĚĚôô"˙`}! <no symbol>
ĚĚĚôô"˙`}! <no symbol>
ĚĚĚôô"˙`}! <no symbol>
ĚĚĚôô"˙`}! <no symbol>
ĚĚĚôô"˙`}! <no symbol>
ĚĚĚôô"˙`}! <no symbol>
ĚĚĚôô"˙`}! <no symbol>
ĚĚĚôô"˙`}! <no symbol>
ĚĚĚôô"˙`}! <no symbol>
ĚĚĚôô"˙`}! <no symbol>
ĚĚĚôô"˙`}! <no symbol>
ĚĚĚôô"˙`}! <no symbol>
ĚĚĚôô"˙`}! <no symbol>
ĚĚĚôô"˙`}! <no symbol>
ĚĚĚôô"˙`}! <no symbol>
ĚĚĚôô"˙`}! <no symbol>
ĚĚĚôô"˙`}! RegisterWaitForInputIdle + 73 bytes
Maybe this can provide some more info.
Title: Re: New(er) flash deaths script
Post by: Wanderer on July 11, 2009, 02:44:24 pm
Not really... i need to run it myself via debugger
Title: Re: New(er) flash deaths script
Post by: Dragon on July 11, 2009, 03:01:06 pm
Maybe I will pack entire mod folder and send it to you?
Unlike other mods which sending I always postponed (mostly because I haven't mediafire account back then), it's nothing special, just recolored flash, .cfg files and deto-sct.tbm.
There were also some recolored explosion effects, but when $Explosion Animations: entry was introduced and turned out to give better effects, scripted detonation explosions became useless to me, so I have set all detonation multipilers to zero. Now I want only final flash effect.
Title: Re: New(er) flash deaths script
Post by: Wanderer on July 13, 2009, 01:02:42 am
I downloaded the script from the wiki, with both required cfgs files and it worked without any apparent issues.

Then tried setting multipliers to 0 and tried again. Again it run without issues
Title: Re: New(er) flash deaths script
Post by: Zacam on July 13, 2009, 01:18:42 am
I am at a loss as well, as it works just fine over here too.
Title: Re: New(er) flash deaths script
Post by: Dragon on July 13, 2009, 06:14:12 am
I don't really know why, but after I redownloaded the script and rewrote .cfg files it started to work.
Great work with this script, Wanderer.
Title: Re: New(er) flash deaths script
Post by: Wanderer on July 13, 2009, 12:27:23 pm
I'll modify the script to search for the .cfg files from the /data/scripts/ directory and also note that into the wiki... just to keep things a tad more organized
Title: Re: New(er) flash deaths script
Post by: Starman01 on August 05, 2009, 01:07:04 pm
@Wanderer :

Hey,

I've tried the script after Tolwyn has provided it to me, and I was pretty good imo :)  However, there is one problem that I think make the script not "useful" so far. The problem is, that the flash effect is appearing pretty late after the initial explosion. In my test on a kilrathi corvette the explosion was nearly done before the flash appeared, and that's to late (with lightspeed and all that :) )

Tolwyn said, that this is related to the fact that you need to do the timing along with the "marked ship death flag" in the engine.

I have two questions, in the hope that you will find a solution for this :) (I don't want to sound like a smart mouth here, but unfortunately I can't script for myself . But I have the hope to give you a new idea for making it even better :) )

a) Instead of the "death flag", can't you time it different ? Example : 3 Seconds after ship has "0% hits left". Or better, to the moment the ship breaks up and the "explosion blast" is executed. The latter, would even avoid problem with the time at b)

b) If you could use either of a) how would the script be related to the duration of "explosion propagates" ? AFAIK that time is different for some ships (depending on size, hitpoints or ship flags, isn't it ? )  The question is, how is the propagation calculated and would it be possible to take that into account for the script ?
Title: Re: New(er) flash deaths script
Post by: Wanderer on August 05, 2009, 03:50:44 pm
a) This is possible to do.. That is fixed or random time counter starting from the hitpoints reaching 0. Finding the 'breakup' time is much harder as the death roll time is heavily modified from the excessive damage etc etc. Possible... but not very easy.

b) Taking all the factor into account is not possible nor would it be practical. It might be possible to add a ship/object to the code and then enable the script to be able to read that flag. But this would still require some amount of C coding in addition to minor changes to the script. But certainly doable.