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

Command Sergeant Major
User avatar
Posts: 296
Joined: Mon Apr 27, 2015 7:09 pm
Location: Planet 4546b
Projects :: Athenova Campaign
Games I'm Playing :: SWBF2

Activate/Deactivate object does nothing

Postby Oceans14 » Sat Mar 16, 2019 12:30 pm

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.

Resistance Leader
User avatar
Posts: 5263
Joined: Tue Feb 09, 2010 8:43 pm
Location: Edinburgh, UK
Projects :: EVERYWHERE + Project Infiltrator
Games I'm Playing :: Max Payne 3
xbox live or psn: Marth8880

Re: Activate/Deactivate object does nothing

Postby Marth8880 » Sat Mar 16, 2019 2:16 pm

Have you considered using CreateEntity instead?

Command Sergeant Major
User avatar
Posts: 296
Joined: Mon Apr 27, 2015 7:09 pm
Location: Planet 4546b
Projects :: Athenova Campaign
Games I'm Playing :: SWBF2

Re: Activate/Deactivate object does nothing

Postby Oceans14 » Sat Mar 16, 2019 3:46 pm

Nope, but that looks very promising. I'll give it a shot!

Second Lance Corporal
User avatar
Posts: 100
Joined: Sun May 07, 2017 11:31 pm
Location: Kentucky, USA
Projects :: A New Frontier Era Mod
Games I'm Playing :: All teh BFs

Re: Activate/Deactivate object does nothing

Postby Calrissian97 » Sat Mar 16, 2019 4:26 pm

Pretty sure ActivateObject actually just activates the physics system for that object

Jedi
User avatar
Posts: 1189
Joined: Wed Aug 21, 2013 3:55 pm
Location: San Diego
Projects :: SWBF2 PSP+PS2 Conversion

Re: Activate/Deactivate object does nothing

Postby AnthonyBF2 » Sun Mar 17, 2019 1:45 am

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)

Command Sergeant Major
User avatar
Posts: 296
Joined: Mon Apr 27, 2015 7:09 pm
Location: Planet 4546b
Projects :: Athenova Campaign
Games I'm Playing :: SWBF2

Re: Activate/Deactivate object does nothing

Postby Oceans14 » Sun Mar 17, 2019 6:09 pm

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!

Return to SWBF2 Modding

Who is online

Users browsing this forum: No registered users and 1 guest