How do i disable and re-enable my transporter objects?

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
linksith
Command Sergeant Major
Command Sergeant Major
Posts: 284
Joined: Mon Jul 12, 2010 12:19 pm
Projects :: Waaay too many projects
Games I'm Playing :: too many
xbox live or psn: me has no xbox
Location: looking for a wifi connection

How do i disable and re-enable my transporter objects?

Post by linksith »

Hi, I modified the transporter codes to work when I repair an object instead of entering a region and now I want to know how to disable and re-enable the transporting ability on the killing and repairing of an object. Here is the code that I have created....

Code: Select all

OnObjectRepair(
function(object,repairer)
if GetEntityName(object) == "trans_panel_7" then
MoveEntityToNode(repairer,"trans_node_7")
KillObject("trans_panel_7")
end
end
)
I'm curious as to whether I can remove the transporter objects when the object "computer" is destroyed and then re-place the transporter objects when the computer is repaired or disable transporting when the computer is destroyed by using some other method.
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: how do I disable and re-enable my transporter objets?

Post by DarthD.U.C.K. »

you can respawn an object after youve killed it with the command "RespawnObject(objectname)".
User avatar
linksith
Command Sergeant Major
Command Sergeant Major
Posts: 284
Joined: Mon Jul 12, 2010 12:19 pm
Projects :: Waaay too many projects
Games I'm Playing :: too many
xbox live or psn: me has no xbox
Location: looking for a wifi connection

Re: how do I disable and re-enable my transporter objets?

Post by linksith »

Does "KillObject" and "RespawnObject" work on objects like props?
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: how do I disable and re-enable my transporter objets?

Post by DarthD.U.C.K. »

no, you must make them a destructablebuilding i think.
CressAlbane
Master Bounty Hunter
Master Bounty Hunter
Posts: 1519
Joined: Fri Dec 18, 2009 8:02 am
Projects :: CTF Arenas
Games I'm Playing :: Steam- cressalbane2
Location: ¿uoıʇɐɔoן ʎɯ sıɥʇ sı

Re: how do I disable and re-enable my transporter objets?

Post by CressAlbane »

Off-topic: Is there a line that can remove a prop in the LUA?
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: how do I disable and re-enable my transporter objets?

Post by DarthD.U.C.K. »

dont worry, its completely ontopic because thats exactly what this topic is about :wink:
(except that it must have another classlabel as i said in m last post)
CressAlbane
Master Bounty Hunter
Master Bounty Hunter
Posts: 1519
Joined: Fri Dec 18, 2009 8:02 am
Projects :: CTF Arenas
Games I'm Playing :: Steam- cressalbane2
Location: ¿uoıʇɐɔoן ʎɯ sıɥʇ sı

Re: how do I disable and re-enable my transporter objets?

Post by CressAlbane »

OK, I was asking about a line that can remove classlabel = prop objects, but I'll just use destructable building and hide the health bar.
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: how do I disable and re-enable my transporter objets?

Post by DarthD.U.C.K. »

yeah, thats how you gotta do it.
here is an odf for such a building, courtesy of pinguin

Code: Select all

[GameObjectClass]
ClassLabel = "destructablebuilding"
GeometryName = "gt1_build_fencebig_01.msh"

[Properties]
GeometryName = "gt1_build_fencebig_01"
FoleyFXGroup = "metal_foley"
IsNotTargetableByPlayer = "1"
HideHealthBar = "1"
MaxHealth = "99999999999"
AddHealth = "99999999999"
CressAlbane
Master Bounty Hunter
Master Bounty Hunter
Posts: 1519
Joined: Fri Dec 18, 2009 8:02 am
Projects :: CTF Arenas
Games I'm Playing :: Steam- cressalbane2
Location: ¿uoıʇɐɔoן ʎɯ sıɥʇ sı

Re: how do I disable and re-enable my transporter objets?

Post by CressAlbane »

Thanks!
Sorry for the de-rail.
User avatar
linksith
Command Sergeant Major
Command Sergeant Major
Posts: 284
Joined: Mon Jul 12, 2010 12:19 pm
Projects :: Waaay too many projects
Games I'm Playing :: too many
xbox live or psn: me has no xbox
Location: looking for a wifi connection

Re: how do I disable and re-enable my transporter objets?

Post by linksith »

DarthD.U.C.K. wrote:yeah, thats how you gotta do it.
here is an odf for such a building, courtesy of pinguin

Code: Select all

[GameObjectClass]
ClassLabel = "destructablebuilding"
GeometryName = "gt1_build_fencebig_01.msh"

[Properties]
GeometryName = "gt1_build_fencebig_01"
FoleyFXGroup = "metal_foley"
IsNotTargetableByPlayer = "1"
HideHealthBar = "1"
MaxHealth = "99999999999"
AddHealth = "99999999999"

I think we're getting closer to the answer. Now I just need code to make sure the object

1. doesn't show up at the start of the game
2. appears on an objects destruction
and
3.dissapears on object destrucion

thanks for the info so far :wink:

EDIT:
CressAlbane wrote:Thanks!
Sorry for the de-rail.
not a problem actually
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: how do I disable and re-enable my transporter objets?

Post by DarthD.U.C.K. »

excuse me, but that sounds like you want us to write the code for you?!
you already got all the function you need. if you write the write the kill-line in scriptpostload without any event it will be executed on the startup of the map.
Post Reply