@speed2 Awesome, thank you !
Effects / Emiters cleanup question
Kykhu Oss https://youtu.be/JUgyGTgeZb8
Unit Thrower https://youtu.be/iV8YBXVxxeI
Beam Tentacle https://youtu.be/le5SNwHvC4c
Blackhole https://www.youtube.com/watch?v=D9NGQC5rr0c
Resurection https://www.youtube.com/watch?v=WdbIQ4vHkMs
If ThrasherFXBag
is of type TrashBag then the reference is, eventually, also removed from the table by the garbage collector.
A work of art is never finished, merely abandoned
@resin_smoker said in Effects / Emiters cleanup question:
Side note: I've also notice that not all emitters are capable of be scaled. No idea why this is or what criteria determine this. By chance anyone know?
All emitters can be scaled, do you have a concrete snippet that can not scale according to you?
A work of art is never finished, merely abandoned
Was attempting to scale simple beam emitter. I believe it was with CreateAttachedBeamEmitter(). Meanwhile, I could alter the beamFX lifetime and a few other things, just couldn't not use SetScale().
Edit: Will post a code snippet next time I'm using the computer.
Kykhu Oss https://youtu.be/JUgyGTgeZb8
Unit Thrower https://youtu.be/iV8YBXVxxeI
Beam Tentacle https://youtu.be/le5SNwHvC4c
Blackhole https://www.youtube.com/watch?v=D9NGQC5rr0c
Resurection https://www.youtube.com/watch?v=WdbIQ4vHkMs
table.insert(self.ThrasherFXBag, CreateBeamEmitterOnEntity( self, 'afterburner', self:GetArmy(), '/mods/4DFAF/effects/emitters/uea0202_afterburner_fire_beam_01/uea0202_afterburner_fire_beam_01_emit.bp'):SetEmitterParam('Lifetime', burnTime))
Above is what I'm currently using, which works, minus being able to re-scale it. However, please note that I'm currently using a custom file so i can manually change the scale.
Using :SetScale(Value) doesn't appear to change anything. Neither does :SetEmitterParam('Thickness', value) or :SetEmitterParam('length', value), which "Thickness" and "Length" are BeamBluePrint values that can be seen via a repr() of the emitter file.
(Effect file shown below, length and thicknesses are half the original files values)
-----------------------------------------------------------------------------
-- File : /4DFAF/effects/emitters/uea0202_afterburner_fire_beam_01/uea0202_afterburner_fire_beam_01_emit.bp
--
-- Author(s) : EbolaSoup, Resin Smoker, Optimus Prime, Vissroid
--
-- Summary : Special FX for use with Thrasher multirole fighter
--
-- Note : This file is needed as the default GPG beam effect can not be rescaled via :ScaleEmitter()
--
-- Copyright © 2024 4DFAF, All rights reserved.
-----------------------------------------------------------------------------
BeamBlueprint {
Lifetime = 3.0,
TextureName = '/textures/particles/missile_exhaust_fire_01.dds',
Thickness = 0.05,
StartColor = {x=1,y=1,z=1,w=0.2}, -- R,G,B,A
EndColor = {x=0.0,y=0.0,z=0,w=0}, -- R,G,B,A
Length = -1.4,
UShift = 0.0,
VShift = -0.65,
}
If your iterested or need to see the units complete .lua for context, Ive included it below. The script does run as intended, which is pretty good for a guy who hasn't scripted in 10 years.
Kykhu Oss https://youtu.be/JUgyGTgeZb8
Unit Thrower https://youtu.be/iV8YBXVxxeI
Beam Tentacle https://youtu.be/le5SNwHvC4c
Blackhole https://www.youtube.com/watch?v=D9NGQC5rr0c
Resurection https://www.youtube.com/watch?v=WdbIQ4vHkMs
Ah, I understand now. Not all emitters are alike, in Supreme Commander we have:
- (1) Actual emitters
- (2) Trails
- (3) Beams
You can scale (1) just fine. But (2) and (3) have a similar class, but not everything works on that class. It never did, that's not something we changed. For more information, see also:
And specifically SetBeamParam
for beams. I'm not sure how to adjust trails in Lua.
A work of art is never finished, merely abandoned
@jip ahh that Github helps clarity things... What I noticed right off is that I used "Length" where the Github has "LENGTH" with all capitals. Will attempt this later and post back the results.
Which, looking (again) at the emitter blueprint, it doesn't say specifically which type of emitter it is. (It's name does but not within the BP) Thus, its likely being defaulted by the effects Lua some where down the pipe. Figuring out which type is it, will help provide a solution or a possible path to one.
Side note: Would be helpful to be able to update the Lua Wiki to reflect this. As is the reference has a few holes.
Kykhu Oss https://youtu.be/JUgyGTgeZb8
Unit Thrower https://youtu.be/iV8YBXVxxeI
Beam Tentacle https://youtu.be/le5SNwHvC4c
Blackhole https://www.youtube.com/watch?v=D9NGQC5rr0c
Resurection https://www.youtube.com/watch?v=WdbIQ4vHkMs
I'm wondering is changing from "CreateBeamEmitterOnEntity()" to "CreateEmitterOnEntity()" would work using the same file. (Or is it CreateAttachedEmitter ? )
Kykhu Oss https://youtu.be/JUgyGTgeZb8
Unit Thrower https://youtu.be/iV8YBXVxxeI
Beam Tentacle https://youtu.be/le5SNwHvC4c
Blackhole https://www.youtube.com/watch?v=D9NGQC5rr0c
Resurection https://www.youtube.com/watch?v=WdbIQ4vHkMs
@resin_smoker said in Effects / Emiters cleanup question:
Side note: Would be helpful to be able to update the Lua Wiki to reflect this. As is the reference has a few holes.
What Lua Wiki?
It's best to use the references and documentation in the repository directly, the annotations have been in the works for the past two to three years and is still being improved occasionally
A work of art is never finished, merely abandoned
https://wiki.faforever.com/en/Development/Modding/LUADOC
https://wiki.faforever.com/en/Development/Modding/LUAGLOBALS
Kykhu Oss https://youtu.be/JUgyGTgeZb8
Unit Thrower https://youtu.be/iV8YBXVxxeI
Beam Tentacle https://youtu.be/le5SNwHvC4c
Blackhole https://www.youtube.com/watch?v=D9NGQC5rr0c
Resurection https://www.youtube.com/watch?v=WdbIQ4vHkMs
"LENGTH" results in... "WARNING: Error running lua script: Invalid Effect Parameter LENGTH"
"Length" results in... "WARNING: Error running lua script: Invalid Effect Parameter Length"
Using "CreateAttachedEmitter" with the Beam blueprint results in... "WARNING: Failed to create emitter as you passed in an invalid blueprint name /effects/emitters/missile_exhaust_fire_beam_01_emit.bp."
Kinda figured that would happen, but was worth trying it just to know for sure.
-Resin
Kykhu Oss https://youtu.be/JUgyGTgeZb8
Unit Thrower https://youtu.be/iV8YBXVxxeI
Beam Tentacle https://youtu.be/le5SNwHvC4c
Blackhole https://www.youtube.com/watch?v=D9NGQC5rr0c
Resurection https://www.youtube.com/watch?v=WdbIQ4vHkMs
@Resin_Smoker better to review this folder:
It has all the information on the wiki and more . We should probably link the Wiki to that
A work of art is never finished, merely abandoned