Removing an attached effect from a KillObject [Solved]

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
Jendo7
Sith
Sith
Posts: 1304
Joined: Wed Apr 01, 2009 6:37 pm
Location: Cambridge, England.
Contact:

Removing an attached effect from a KillObject [Solved]

Post 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:
Hidden/Spoiler:
KillObject("tat_prop_tuskcampfire")
KillObject("tat_prop_tuskcampfire1")
KillObject("tat_prop_tuskcampfire2")
KillObject("tat_prop_tuskcampfire3")
And these are the two codes I have tried to get rid of the flame effect, of which neither work:
Hidden/Spoiler:
SetProperty("tat_prop_tuskcampfire", "RemoveEffect", "torchflame")

RemoveEffect("torchflame")
...and this is the tat_prop_tuskcampfire.odf:
Hidden/Spoiler:
[GameObjectClass]

ClassLabel = "destructablebuilding"
GeometryName = "tat1_prop_tuskcampfire.msh"


[Properties]

GeometryName = "tat1_prop_tuskcampfire"
IsNotTargetableByPlayer = "1"
MaxHealth = "99999999999"
AddHealth = "99999999999"

AttachEffect = "torchflame"

AttachToHardPoint = "hp_smoke"

AttachOdf = "yellowlight_nocone"

AttachToHardPoint = "hp_light_a"

SoundProperty = "com_amb_fire"
Maybe it's not possible, but any help would be appreciated.
Last edited by Jendo7 on Sat Mar 12, 2011 10:12 pm, edited 1 time in total.
User avatar
Firefang
Major
Major
Posts: 518
Joined: Mon Nov 15, 2010 8:55 pm
Location: California

Re: Removing an attached effect from a KillObject

Post by Firefang »

You can try

Code: Select all

SetProperty("tat_prop_tuskcampfire", "AttachEffect", "fakeeffect")
User avatar
Snork
Lieutenant General
Lieutenant General
Posts: 669
Joined: Thu Jun 07, 2007 3:34 pm
Games I'm Playing :: SWBF2 and Minecraft
xbox live or psn: No gamertag set
Contact:

Re: Removing an attached effect from a KillObject

Post by Snork »

Could you just place a layer with the desired objects in it and only load the layer in one mode?
User avatar
Jendo7
Sith
Sith
Posts: 1304
Joined: Wed Apr 01, 2009 6:37 pm
Location: Cambridge, England.
Contact:

Re: Removing an attached effect from a KillObject

Post 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.
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Removing an attached effect from a KillObject

Post 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?
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Removing an attached effect from a KillObject

Post 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.
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Removing an attached effect from a KillObject

Post 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.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Removing an attached effect from a KillObject

Post 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.
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: Removing an attached effect from a KillObject

Post by AQT »

Ah, yes! Just like the turbine on the stock Tantive IV map. I'll be sure to remember that.
User avatar
Jendo7
Sith
Sith
Posts: 1304
Joined: Wed Apr 01, 2009 6:37 pm
Location: Cambridge, England.
Contact:

Re: Removing an attached effect from a KillObject

Post 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:
Hidden/Spoiler:
[GameObjectClass]

ClassLabel = "destructablebuilding"
GeometryName = "tat1_prop_tuskcampfire.msh"


[Properties]

GeometryName = "tat1_prop_tuskcampfire"
IsNotTargetableByPlayer = "1"
MaxHealth = "99999999999"
AddHealth = "99999999999"

DamageStartPercent = 30.0
DamageStopPercent = 0.010
DamageEffect = "torchflame"
DamageEffectScale = 0.6
DamageInheritVelocity = 0.0
DamageAttachPoint = "hp_smoke"
DamageEffectSound = "com_amb_fire"

AttachOdf = "yellowlight_nocone"

AttachToHardPoint = "hp_light_a"
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:
Hidden/Spoiler:
[GameObjectClass]

ClassLabel = "destructablebuilding"
GeometryName = "tat1_prop_tuskcampfire.msh"


[Properties]

GeometryName = "tat1_prop_tuskcampfire"
IsNotTargetableByPlayer = "1"
MaxHealth = "99999999999"
AddHealth = "99999999999"

AttachEffect = "torchflame"

AttachToHardPoint = "hp_smoke"

AttachOdf = "yellowlight_nocone"

AttachToHardPoint = "hp_light_a"

SoundProperty = "com_amb_fire"
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:
Hidden/Spoiler:
[GameObjectClass]

ClassLabel = "destructablebuilding"
GeometryName = "tat1_prop_tuskcampfire.msh"


[Properties]

GeometryName = "tat1_prop_tuskcampfire"
IsNotTargetableByPlayer = "1"
MaxHealth = "99999999999"
AddHealth = "99999999999"

DamageStartPercent = 1.0
DamageEffect = "torchflame"
DamageAttachPoint = "hp_smoke"
DamageEffectSound = "com_amb_fire"

DamageStartPercent = 1.0
DamageEffect = "yellowlight_nocone"
DamageAttachPoint = "hp_light_a"

Then I tried this but the effect came back for both hunt modes:
Hidden/Spoiler:
[GameObjectClass]

ClassLabel = "destructablebuilding"
GeometryName = "tat1_prop_tuskcampfire.msh"


[Properties]

GeometryName = "tat1_prop_tuskcampfire"
IsNotTargetableByPlayer = "1"
MaxHealth = "99999999999"
AddHealth = "99999999999"

AttachEffect = "torchflame"

AttachToHardPoint = "hp_smoke"

AttachOdf = "yellowlight_nocone"

AttachToHardPoint = "hp_light_a"

SoundProperty = "com_amb_fire"

DamageStartPercent = 1.0
DamageEffect = "torchflame"
DamageAttachPoint = "hp_smoke"
DamageEffectSound = "com_amb_fire"

DamageStartPercent = 1.0
DamageEffect = "yellowlight_nocone"
DamageAttachPoint = "hp_light_a"

I think I'm out of ideas. Anyway, I'm sure it's easier than I think.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Removing an attached effect from a KillObject

Post 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.
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: Removing an attached effect from a KillObject

Post 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:

Code: Select all

AINoRepair      = "1"
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?
User avatar
Jendo7
Sith
Sith
Posts: 1304
Joined: Wed Apr 01, 2009 6:37 pm
Location: Cambridge, England.
Contact:

Re: Removing an attached effect from a KillObject

Post 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:
Hidden/Spoiler:
[GameObjectClass]

ClassLabel = "destructablebuilding"
GeometryName = "tat1_prop_tuskcampfire.msh"


[Properties]

GeometryName = "tat1_prop_tuskcampfire"
IsNotTargetableByPlayer = "1"
MaxHealth = "99999999999"
AddHealth = "99999999999"

DamageStartPercent = 100.0
DamageStopPercent = 0.0
DamageEffect = "torchflame"
DamageEffectScale = 1.0
DamageInheritVelocity = 0.0
DamageAttachPoint = "hp_smoke"
DamageEffectSound = "com_amb_fire"

DamageStartPercent = 100.0
DamageStopPercent = 0.0
DamageEffect = "yellowlight_nocone"
DamageEffectScale = 1.0
DamageInheritVelocity = 0.0
DamageAttachPoint = "hp_light_a"
@DarthD.U.C.K. thanks, I haven't tried that yet.
Last edited by Jendo7 on Sat Mar 12, 2011 12:11 pm, edited 1 time in total.
User avatar
DarthD.U.C.K.
Master of the Force
Master of the Force
Posts: 6027
Joined: Wed Sep 27, 2006 11:05 am
Location: Duckburg, Germany

Re: Removing an attached effect from a KillObject

Post 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.
User avatar
Jendo7
Sith
Sith
Posts: 1304
Joined: Wed Apr 01, 2009 6:37 pm
Location: Cambridge, England.
Contact:

Re: Removing an attached effect from a KillObject

Post 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.
Post Reply