Page 1 of 1

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

Posted: Fri Aug 26, 2011 4:54 pm
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.

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

Posted: Fri Aug 26, 2011 5:57 pm
by DarthD.U.C.K.
you can respawn an object after youve killed it with the command "RespawnObject(objectname)".

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

Posted: Sat Aug 27, 2011 7:12 am
by linksith
Does "KillObject" and "RespawnObject" work on objects like props?

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

Posted: Sat Aug 27, 2011 12:00 pm
by DarthD.U.C.K.
no, you must make them a destructablebuilding i think.

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

Posted: Sat Aug 27, 2011 4:56 pm
by CressAlbane
Off-topic: Is there a line that can remove a prop in the LUA?

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

Posted: Sat Aug 27, 2011 5:04 pm
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)

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

Posted: Sat Aug 27, 2011 5:18 pm
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.

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

Posted: Sat Aug 27, 2011 5:58 pm
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"

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

Posted: Sat Aug 27, 2011 7:05 pm
by CressAlbane
Thanks!
Sorry for the de-rail.

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

Posted: Sun Aug 28, 2011 7:23 am
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

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

Posted: Sun Aug 28, 2011 7:52 am
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.