Author Topic: Particle trail script  (Read 31073 times)

0 Members and 1 Guest are viewing this topic.

Offline m!m

  • 211
I was aware of this bug for some time but never got around to add way of "fixing it". I'll add an option to modify the radius in which the particles are created so you could set it to 0.5 and the particles will be created in only half the thruster radius. Would that be enough?

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
That'll do, it'd be nice to have yet another value to customize.

 

Offline m!m

  • 211
New version is in first post, please make sure that you have a correct nightly build but that shouldn't be a problem anymore just use the latest.

 

Offline m!m

  • 211
Double post! :D
The new version should have all requested features that don't require large code changes. If you want to use "+Use Ray normal" you have to use a build with the patch in the changelog.

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
You forgot about the offset for a ship engine trail (wouldn't hurt for weapon and particle trails, too).
BTW, would it be possible to define if the weapon needs to hit for particles to spawn (I.E. if the self-destruction emits particles)?
If you could add that and an ability to define an absolute normal for particle emission (as in, regardless of how and where the weapon explodes, particles will use the same, absolute normal), I'd be able to make a real mushroom cloud effect. Of course, they'd be useful not only for that, the former being great for making sure that if a missile self-destructs, fiery shards (supposed to come from the hull) won't appear, while the latter could be used for a lot of atmospheric explosion effects, where particles are supposed to go up even when they hit on the side of a hill, instead of sideways.

 

Offline m!m

  • 211
+Offset has been added. I'm sorry but AFAIK there is no way to tell whether the weapon self-destructed or impacted. Scripting only gets notified that a weapon got removed from the game or that it impacted so I'm not sure if that is possible.
I'll look into your absolute orientation request but I'm currently working on another script so that will have to wait until I come back to the ParticleScript.

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
OK, I'm looking forward to it.
Good to know about +Offset, as it's neither in changelog nor documentation.

 

Offline m!m

  • 211
Well, ok I came back to the script :rolleyes:
Added "+Absolute Normal" and a few global options. There is now an easy way to add additional configuration files to the config. You just specify "$Include: <filename>" and that file gets parsed too.
Warning: There is no check for recursion!

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
Awesome, expect either screens of a nuke explosion working in FS, or another feature request soon.  :)
EDIT: I've installed the new version of the script and tried to add a nuke, but an error popped up (on release build) and I don't know what I did wrong.
Code: [Select]
Invalid input type "number" should be "string"
stack traceback:
[string "zmisc-sct.tbm - On Game Init"]:14: in function 'stackError'
[string "zmisc-sct.tbm - On Game Init"]:30: in function 'stackErrorf'
[string "converter.lua"]:54: in function '__doConvert'
[string "converter.lua"]:78: in function 'convert'
[string "parser.lua"]:49: in function 'convert'
[string "particleParser.lua"]:1003: in function 'func'
[string "parser.lua"]:216: in function 'handle'
[string "parser.lua"]:248: in function 'handleKeyValue'
[string "particleParser.lua"]:46: in function 'handleKeyValue'
[string "parser.lua"]:239: in function 'processLine'
[string "parser.lua"]:124: in function 'parseFile'
[string "deathPart-sct.tbm - On Game Init"]:61: in function '__doParse'
[string "deathPart-sct.tbm - On Game Init"]:41: in function 'parseConfigFiles'
[string "deathPart-sct.tbm - On Mission Start"]:1: in main chunk

ntdll.dll! KiFastSystemCallRet
kernel32.dll! WaitForSingleObject + 18 bytes
fs2_open_3_6_13r_SSE2_BP.exe! <no symbol>
fs2_open_3_6_13r_SSE2_BP.exe! <no symbol>
fs2_open_3_6_13r_SSE2_BP.exe! <no symbol>
<no module>! <no symbol>
fs2_open_3_6_13r_SSE2_BP.exe! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
Only these entries had really been changed/added.
Code: [Select]
$Type: Weapon
$Class: MDU-42
+Effect: ExpFlash
+Time: 1
+Number: 3, 5
+Speed: 600, 800
+Size: 5, 10
+Spewcone: 90, 90, 90
+Add Velocity: NO
+Trail: ExplosionTrail
+Use Normal: YES
+Emit Vector: 0, 0, 1
+Emit Variance: 0.3


$Type: Weapon
$Class: AG-132
+Weapon: NukeCloud
+Time: 1
+Number: 1
+Speed: 10000
+Size: 100
+Add Velocity: NO
+Trail: NukeTrail
+Use Normal: YES
+Absolute Normal: 0, 1, 0
+Emit Vector: 0, 0, 1
$Type: Weapon
$Class: NukeCloud
+Effect: ParticleSmoke01
+Time: 10
+Number: 200
+Speed: 1000
+Size: 100
+Spewcone: 90, 90, 90
+Add Velocity: NO
+Trail: NukeTrail
+FPS: 94

$Type: Ship
$Class: DD Ranger
+Name: Ranger
+Effect: ExpFlash
+Time: 1
+Emitstate: 2
+Number: 80, 120
+Speed: 200, 400
+Size: 0.5, 2
+Box Min: -100, -100, -300
+Box Max: 100, 100, 300
+Spewcone: 30, 30, 30
+FPS: 20, 30
+Emit from hull
+Use Ray normal
+Move Outwards
+Trail:
 
The log looks like that:
Code: [Select]
LibraryManager: Reloading all loaded libraries
LibraryManager: Loaded file "class.lua"
LibraryManager: Loaded file "objectWrapper.lua"
LibraryManager: Loaded file "particles.lua"
LibraryManager: Loaded file "strings.lua"
LibraryManager: Loaded file "parser.lua"
LibraryManager: Loaded file "converter.lua"
LibraryManager: Loaded file "util.lua"
LibraryManager: Loaded file "trailInfo.lua"
LibraryManager: Loaded file "particleParser.lua"
LibraryManager: Loaded file "effectManager.lua"
PARTICLE SCRIPT: Parsing file "particles.cfg"
BMPMAN: Found EFF (ExpFlash.eff) with 86 frames at 24 fps.
BMPMAN: Found EFF (WhiteSmoke.eff) with 24 frames at 30 fps.
ERROR: Invalid input type "number" should be "string"
stack traceback:
[string "zmisc-sct.tbm - On Game Init"]:14: in function 'stackError'
[string "zmisc-sct.tbm - On Game Init"]:30: in function 'stackErrorf'
[string "converter.lua"]:54: in function '__doConvert'
[string "converter.lua"]:78: in function 'convert'
[string "parser.lua"]:49: in function 'convert'
[string "particleParser.lua"]:1003: in function 'func'
[string "parser.lua"]:216: in function 'handle'
[string "parser.lua"]:248: in functiFreeing all existing models...
Size of bitmap info = 760 KB
Size of bitmap extra info = 52 bytes
ASSERTION: "be->type != BM_TYPE_NONE" at bmpman.cpp:1640

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
This is getting frustrating. I've changed a few things I suspected to be the cause, but nothing worked.
Code: [Select]
LibraryManager: Reloading all loaded libraries
LibraryManager: Loaded file "class.lua"
LibraryManager: Loaded file "objectWrapper.lua"
LibraryManager: Loaded file "particles.lua"
LibraryManager: Loaded file "strings.lua"
LibraryManager: Loaded file "parser.lua"
LibraryManager: Loaded file "converter.lua"
LibraryManager: Loaded file "util.lua"
LibraryManager: Loaded file "trailInfo.lua"
LibraryManager: Loaded file "particleParser.lua"
LibraryManager: Loaded file "effectManager.lua"
PARTICLE SCRIPT: Parsing file "particles.cfg"
PARTICLE SCRIPT: Parsing file "ranger.cfg"
BMPMAN: Found EFF (ExpFlash.eff) with 86 frames at 24 fps.
ERROR: Invalid input type "number" should be "string"
stack traceback:
[string "zmisc-sct.tbm - On Game Init"]:14: in function 'stackError'
[string "zmisc-sct.tbm - On Game Init"]:30: in function 'stackErrorf'
[string "converter.lua"]:54: in function '__doConvert'
[string "converter.lua"]:78: in function 'convert'
[string "parser.lua"]:49: in function 'convert'
[string "particleParser.lua"]:1003: in function 'func'
[string "parser.lua"]:216: in function 'handle'
[string "parser.lua"]:248: in functiFreeing all existing models...
Size of bitmap info = 760 KB
Size of bitmap extra info = 52 bytes
ASSERTION: "be->type != BM_TYPE_NONE" at bmpman.cpp:1640
The config "ranger.cfg" looks like that:
Code: [Select]
$Type: Ship
$Class: DD Ranger
+Name: Ranger
+Effect: ExpFlash
+Time: 1
+Emitstate: 2
+Number: 80, 120
+Speed: 200, 400
+Size: 1, 2
+Box Min: -100, -100, -300
+Box Max: 100, 100, 300
+Spewcone: 30, 30, 30
+FPS: 20, 30
+Emit from hull
+Use Ray normal
+Move outwards
+Trail: ExplosionTrail
$Type: ShipTrail
$Class: DD Ranger
+Effect: ThrusterFed
+Speed: -30, 0
+Size: 95, 105
+Number: 9, 11
+Use thrusters: YES
+Emitstate: Normal
+Use Thruster Strength: YES
+Density: 2
$Type: ShipTrail
$Class: DD Ranger
+Effect: ParticleSmoke01
+Speed: -30, 0
+Size: 130, 150
+Number: 5, 15
+Use thrusters: YES
+Variance: 9
+Emitstate: Always
+Use Thruster Strength: NO
+Damage Trails: YES
+Damage Start Level: 80
+Damage Maximum Level: 40
+FPS: 118

 

Offline m!m

  • 211
Can you try to redownload the script? I hope that my changes fix the error.
Spoiler:
Also that version contains an experimental If-Then-Else feature to enable effects on a per-mission basis but that requires a code change...
« Last Edit: August 25, 2011, 05:12:12 am by m!m »

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
I'm using the latest build. After redownloading, I'm getting this:
Code: [Select]
LUA ERROR: [string "particleParser.lua"]:1058: attempt to compare number with nil

------------------------------------------------------------------
ADE Debug:
------------------------------------------------------------------
Name: (null)
Name of: (null)
Function type: (null)
Defined on: 0
Upvalues: 0

Source: (null)
Short source:
Current line: 0
- Function line: 0
------------------------------------------------------------------


------------------------------------------------------------------
LUA Stack:
------------------------------------------------------------------

------------------------------------------------------------------
And the script doesn't do anything.

 

Offline m!m

  • 211
 :banghead: :banghead: :ick:
Please redownload...

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
It did help (trails seem to work OK), though there's another warning and weapon particles don't seem to work.
Code: [Select]
LUA ERROR: [string "particleParser.lua"]:1058: attempt to compare number with string

------------------------------------------------------------------
ADE Debug:
------------------------------------------------------------------
Name: (null)
Name of: (null)
Function type: (null)
Defined on: 0
Upvalues: 0

Source: (null)
Short source:
Current line: 0
- Function line: 0
------------------------------------------------------------------


------------------------------------------------------------------
LUA Stack:
------------------------------------------------------------------

------------------------------------------------------------------
Using this weapon, I didn't get any visible impact particles OK, not really. Particle trails seem to have stopped working. While the particles themselves are there, trails are not created (and thus I didn't notice these particles):
Code: [Select]
$Type: Weapon
$Class: MDU-42
+Effect: ExpFlash
+Time: 1
+Number: 3, 5
+Speed: 600, 800
+Size: 5, 10
+Spewcone: 90, 90, 90
+Add Velocity: NO
+Trail: ExplosionTrail
+Use Normal: YES
+Emit Vector: 0, 0, 1
+Emit Variance: 1


 

Offline m!m

  • 211
I'm epic fail...
Please try if it is working now.

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
From epic fail to epic win. The effect not only works, it's completely awesome.  :)

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Oh dear, is it time for me to update the particle script again?
How am I going to keep up with all this awesome? :p
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
Have any of the recent changes and updates included support for the issues I reported associated with ship explosions and the spawn box controls?  Did you have a chance to evaluate if the proposed automatically-spawn-the-particles-from-all-over-the-model's-surfce-in-deathroll-mode change?
The Trivial Psychic Strikes Again!

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
Yes, there's +Emit from hull flag in the latest version.

 

Offline m!m

  • 211
Also, I'm not 100% percent sure but I think that I fixed a problem that was preventing the creation ray cast from happening which means that that feature was never really working :nervous: :snipe: