Activate/Deactivate object does nothing

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
Oceans14
Command Sergeant Major
Command Sergeant Major
Posts: 296
Joined: Mon Apr 27, 2015 7:09 pm
Projects :: Athenova Campaign
Games I'm Playing :: SWBF2
Location: Planet 4546b

Activate/Deactivate object does nothing

Post by Oceans14 »

Does anyone have experience getting ActivateObject to work in their scripts? I need to turn on/off objects for different objectives and for some reason it just doesn't work. I've tried to use Kill/RespawnObject and SetProperty to effectively do the same thing, but the way those work is just different enough to make them unsuitable for my needs. I can add a more situational example if it helps, but basically I just need certain objects to "not exist" until triggered by an event... which is like, the textbook use of ActivateObject I'm pretty sure.

Anyway, I'd appreciate any help. Btw, nothing relevant in the error log.
Marth8880
Resistance Leader
Posts: 5006
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: EVERYWHERE + Project Infiltrator
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Activate/Deactivate object does nothing

Post by Marth8880 »

Have you considered using CreateEntity instead?
User avatar
Oceans14
Command Sergeant Major
Command Sergeant Major
Posts: 296
Joined: Mon Apr 27, 2015 7:09 pm
Projects :: Athenova Campaign
Games I'm Playing :: SWBF2
Location: Planet 4546b

Re: Activate/Deactivate object does nothing

Post by Oceans14 »

Nope, but that looks very promising. I'll give it a shot!
Calrissian97
Second Lance Corporal
Second Lance Corporal
Posts: 100
Joined: Sun May 07, 2017 11:31 pm
Projects :: A New Frontier Era Mod
Games I'm Playing :: All teh BFs
Location: Kentucky, USA

Re: Activate/Deactivate object does nothing

Post by Calrissian97 »

Pretty sure ActivateObject actually just activates the physics system for that object
AnthonyBF2
Jedi
Jedi
Posts: 1210
Joined: Wed Aug 21, 2013 3:55 pm
Projects :: SWBF2 PSP+PS2 Conversion
Location: San Diego

Re: Activate/Deactivate object does nothing

Post by AnthonyBF2 »

You can also have the item alive and then use these two functions to essentially kill it:

Code: Select all

SetProperty("object", "IsVisible", 0)
SetProperty("object", "IsCollidable", 0)
User avatar
Oceans14
Command Sergeant Major
Command Sergeant Major
Posts: 296
Joined: Mon Apr 27, 2015 7:09 pm
Projects :: Athenova Campaign
Games I'm Playing :: SWBF2
Location: Planet 4546b

Re: Activate/Deactivate object does nothing

Post by Oceans14 »

Calrissian97 wrote:Pretty sure ActivateObject actually just activates the physics system for that object
Interesting! I'll have to mess around with this.
AnthonyBF2 wrote:You can also have the item alive and then use these two functions to essentially kill it:

Code: Select all

SetProperty("object", "IsVisible", 0)
SetProperty("object", "IsCollidable", 0)
I considered using IsVisible but I didn't know IsCollidable existed too - that's a game changer. Will definitely try this one as well.

Thank you all for the advice!
Post Reply