Page 1 of 1
Removing an attached effect from a KillObject [Solved]
Posted: Fri Mar 11, 2011 9:42 pm
by Jendo7
I have two hunt modes in my map, one for the GCW era that takes place during the day, and one for the CW era at night.
I have removed the Tusken Camp fires from the day version by using KillObject, the only problem is that the attached effect "torchflame" is still visible.
These are the camp fire props that I have removed:
And these are the two codes I have tried to get rid of the flame effect, of which neither work:
...and this is the tat_prop_tuskcampfire.odf:
Maybe it's not possible, but any help would be appreciated.
Re: Removing an attached effect from a KillObject
Posted: Fri Mar 11, 2011 9:47 pm
by Firefang
You can try
Code: Select all
SetProperty("tat_prop_tuskcampfire", "AttachEffect", "fakeeffect")
Re: Removing an attached effect from a KillObject
Posted: Fri Mar 11, 2011 9:58 pm
by Snork
Could you just place a layer with the desired objects in it and only load the layer in one mode?
Re: Removing an attached effect from a KillObject
Posted: Fri Mar 11, 2011 10:05 pm
by Jendo7
That's a good idea, I'll try that. Thanks.
@Firefang, thanks, I appreciate your help but unfortunately it didn't work.
Edit: Just tried the seperate layer but it still didn't work but maybe I did something wrong. I think I'll keep trying the lua functions.
Re: Removing an attached effect from a KillObject
Posted: Sat Mar 12, 2011 12:24 am
by AQT
Here's an idea: Since the effect is attached to a hardpoint called hp_smoke, what if you change the geometry of the campfire to a different MSH without hardpoints that is already being used in your map before killing it? Maybe then the effect will no longer be attached?
Re: Removing an attached effect from a KillObject
Posted: Sat Mar 12, 2011 12:56 am
by Maveritchell
AQT wrote:Here's an idea: Since the effect is attached to a hardpoint called hp_smoke, what if you change the geometry of the campfire to a different MSH without hardpoints that is already being used in your map before killing it? Maybe then the effect will no longer be attached?
If an .odf can't find a hardpoint on a model, it defaults to the dummyroot - it doesn't simply ignore it.
Re: Removing an attached effect from a KillObject
Posted: Sat Mar 12, 2011 1:10 am
by AQT
Huh, alright. Well, I guess another potential remedy is to create a small custom side to load in a dummy effect also called torchflame should be able to overwrite the original.
Re: Removing an attached effect from a KillObject
Posted: Sat Mar 12, 2011 1:14 am
by Maveritchell
AQT wrote:Huh, alright. Well, I guess another potential remedy is to create a small custom side to load in a dummy effect also called torchflame should be able to overwrite the original.
The easy answer to toggling effects on and off is to use damage effects. Since they are dynamic relative to damage, all you do is have an effect set for any damage percentage greater than zero, and kill the object when you want to turn off the effect.
Re: Removing an attached effect from a KillObject
Posted: Sat Mar 12, 2011 1:18 am
by AQT
Ah, yes! Just like the turbine on the stock Tantive IV map. I'll be sure to remember that.
Re: Removing an attached effect from a KillObject
Posted: Sat Mar 12, 2011 7:38 am
by Jendo7
Maveritchell wrote:AQT wrote:Huh, alright. Well, I guess another potential remedy is to create a small custom side to load in a dummy effect also called torchflame should be able to overwrite the original.
The easy answer to toggling effects on and off is to use damage effects. Since they are dynamic relative to damage, all you do is have an effect set for any damage percentage greater than zero, and kill the object when you want to turn off the effect.
Thanks Mav, that's an easier solution than I expected.
@AQT Thank you, I'll check out the Tantive IV example.
Edit:
Using the Tantive IV turbine as an example I put this in my .odf:
It killed the object and attached torchflame effect from GCW hunt but not the light effect emanating from it.
Unfortunately it also killed the effect but not the object from the CW hunt mode set at night.
Here's the previous odf:
I'll keep trying though, so I'll update this post later.
Edit2:
Tried this, it killed both the torchflame effect, and light effect but it also killed it from the CW hunt/night version:
Then I tried this but the effect came back for both hunt modes:
I think I'm out of ideas. Anyway, I'm sure it's easier than I think.
Re: Removing an attached effect from a KillObject
Posted: Sat Mar 12, 2011 10:05 am
by Maveritchell
The Damage start percent is the percent of the maximum health that the effect starts at. You want something like this:
Code: Select all
[GameObjectClass]
ClassLabel = "armedbuilding"
GeometryName = "bgl_prop_sdshield.msh"
[Properties]
GeometryName = "bgl_prop_sdshield"
DestroyedGeometryName = "ffx_weap_inf_grenadethermal"
MaxHealth = "999999.0"
AddHealth = "1000.0"
RespawnTime = "999999"
FoleyFXGroup = "metal_foley"
MapTexture = "shield_icon"
MapScale = "1.5"
DamageStartPercent = 100.0
DamageStopPercent = 0.0
DamageEffect = "shieldeffect"
DamageEffectScale = 1.0
DamageInheritVelocity = 0.0
DamageAttachPoint = "dummyroot"
Note that this is also an easy way to attach dynamic sounds to an object (the
only way, in fact), through the particle effect toggled on and off.
Re: Removing an attached effect from a KillObject
Posted: Sat Mar 12, 2011 10:12 am
by DarthD.U.C.K.
im not sure whether its necessary, but to prevent the ai from trying to repair the object, put this in the odf:
uh, i forgot, maybe the effect is being hidden when the o9bject is made invisible but not killed:
Code: Select all
SetProperty("Console", "IsVisible", "0")
and one last thing: did you try whether the "AttachDynamic = 1" line makes the effect go away when the object is destroyed?
Re: Removing an attached effect from a KillObject
Posted: Sat Mar 12, 2011 12:04 pm
by Jendo7
Thanks Mav, it's nearly working but not completely. The torchflame effect does now disappear from the GCW era hunt including the light emanating from it, and in CW night version the flame does appear now but it also has no attached light.
Sorry my brain isn't working today.
Heres my odf:
@DarthD.U.C.K. thanks, I haven't tried that yet.
Re: Removing an attached effect from a KillObject
Posted: Sat Mar 12, 2011 12:09 pm
by DarthD.U.C.K.
i think the reason for the light not appearing is that its a light(odf) and not an effect and only effects can be attached through the damageeffectlines.
Re: Removing an attached effect from a KillObject
Posted: Sat Mar 12, 2011 12:17 pm
by Jendo7
Ok, thanks. I'll just have to compromise, and put the light back. It'll just look a bit strange during the day.
Edit: Ok, this problem is solved but I've decided to keep the Tusken camp fires for the day cycle hunt mode in the end, as the light effect doesn't look good without them. Anyway I've learnt something useful that will be used in future.