Page 1 of 1

Teleport weapons (and other things)

Posted: Tue Jul 13, 2010 6:53 pm
by Darth_Squoobus
Are items that function as teleporters possible? I know there are teleportregions, but what about teleport guns or something like that?

Re: Teleporters

Posted: Tue Jul 13, 2010 7:00 pm
by Fiodis
Sure, through simple LUA code. For a teleport gun, you would write up a code that checks the weapon a unit was hit by on the unit sustaining damage, and if it matches the teleporter gun's odf name, then you can use the Teleporter code's handy MoveEntityToNode to move the unit to a specific node, or create your own matrix somewhere off another one if the location you want to teleport it to is constantly changing.

And for the record, "Teleport Regions" aren't some archaic, specialized type of region - they're just a normal region that triggers a bit of LUA code, which does the actual teleporting.

Re: Teleporters

Posted: Tue Jul 13, 2010 7:08 pm
by Darth_Squoobus
Fiodis wrote:Sure, through simple LUA code. For a teleport gun, you would write up a code that checks the weapon a unit was hit by on the unit sustaining damage, and if it matches the teleporter gun's odf name, then you can use the Teleporter code's handy MoveEntityToNode to move the unit to a specific node, or create your own matrix somewhere off another one if the location you want to teleport it to is constantly changing.

And for the record, "Teleport Regions" aren't some archaic, specialized type of region - they're just a normal region that triggers a bit of LUA code, which does the actual teleporting.
So does this mean I could make an object that units could teleport to if I don't use a node?

Re: Teleport weapons

Posted: Tue Jul 13, 2010 8:27 pm
by Fiodis
Yes. Keep in mind some path would have to be clear.

Re: Teleport weapons

Posted: Tue Jul 13, 2010 8:32 pm
by Darth_Squoobus
Fiodis wrote:Yes. Keep in mind some path would have to be clear.
Then it'd be better suited for outdoor maps.
.
Now I have some other questions. Is it possible for a unit to be able to see units using stealth, like it was using a heat-seeking camera? Or just for a unit to see things differently from another?

Re: Teleport weapons (and other things)

Posted: Fri Jul 16, 2010 8:56 am
by Fiodis
It depends on what you want it to see. You can't see any enemies using stealth, that's a hardcoded aspect (indeed, the very definition) of stealth. You can't highlight enemies by using a special camera weapon or playing as a special unit. You can put an effect around your unit in-game, and then in first person mode you'll see it in front of you (check out the Droideka first person when shield is active) but that's about it.