Home   Help Search Login Register  

Author Topic: Teleport  (Read 713 times)

0 Members and 1 Guest are viewing this topic.

Jim666

  • Guest
Teleport
« on: 29 Jan 2005, 19:29:40 »
I need to know how to teleport the player, or players, to a one building, to another building?

ive seen a teleport of some kinda been used but not this way.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Teleport
« Reply #1 on: 29 Jan 2005, 19:32:47 »
loon1 setPos getPos gameLogic1
Plenty of reviewed ArmA missions for you to play

Jim666

  • Guest
Re:Teleport
« Reply #2 on: 29 Jan 2005, 20:11:55 »
I presume loon1 is the player name?
« Last Edit: 29 Jan 2005, 20:24:21 by Jim666 »

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Teleport
« Reply #3 on: 29 Jan 2005, 20:36:14 »
It is the name of the unit you want to teleport, which could be the player but doesn't have to be.    You can use virtually any name you like as long as it doesn't already occur in the game.
Plenty of reviewed ArmA missions for you to play

Jim666

  • Guest
Re:Teleport
« Reply #4 on: 29 Jan 2005, 20:38:28 »
Ok thanks, another thing is well two things, Ive got the trigger with the stuff inside it but when you walk into the trigger, your on the ground, and i want it so when your ontop of the building your teleported.

And also how do i get the trigger to teleport more then one person? but no so when 1 person walks into the trigger it dosent teleport everyone else?

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Teleport
« Reply #5 on: 29 Jan 2005, 20:45:17 »
loon1 setPos [(getPos object nnnn select 0) + x, (getPos object nnnn select 1) + y, h]

where:-

nnnn is the ID of the building in question

x and y are the east-west and north-south offsets found by experiment (probably about 2 or 3)

h is the height at which you want the loon to appear, also found by experiment (probably between 2 and about 10)

Exact details not guaranteed.

The general command for issuing the same command to a bunch of units is forEach.   For example:-

"doStop _x" forEach units grp1

However, setpossing lots of units can be tricky because they appear in exactly the same place, which can be messy.    In any case I'm afraid I don't understand about the units in the trigger - could you explain again?
Plenty of reviewed ArmA missions for you to play

Jim666

  • Guest
Re:Teleport
« Reply #6 on: 29 Jan 2005, 20:49:15 »
I have a group of people on the desert island, and the when i issue an AI to walk though the buildings door, the whole group teleports.

I want it so when a unit walks though the door of the building, that only he will teleport through

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Teleport
« Reply #7 on: 30 Jan 2005, 00:42:41 »
Trigger over the door area:-

Activation box:   Anybody present     Repeatedly
On activation:    thislist select 0 setPos [(getPos object nnnn select 0) + x, (getPos object nnnn select 1) + y, h]


Alternatively, if you want the whole group to be teleported:-

On activation:     "_x setPos [(getPos object nnnn select 0) + x, (getPos object nnnn select 1) + y, h]" forEach units group thislist select 0

Syntax not guaranteed.

That will teleport the first loon to enter the trigger.    If two enter simultaneously then only the first will be teleported.    Set the trigger area to make sure this doesn't happen.   Maybe place some furniture near the door as well, to make sure loons can approach only one at a time.  

The trigger will teleport as many people as you like, one at a time, as long as they don't enter the trigger are too fast.

Is that what you want?
Plenty of reviewed ArmA missions for you to play

CopyrightPhilly

  • Guest
Re:Teleport
« Reply #8 on: 30 Jan 2005, 09:56:21 »
how about...

Code: [Select]
_unit=_this select 0
_object=_this select 1
_height=_this select 2

_x=getpos _object select 0
_y=getpos _object select 1
_z=getpos _object select 2

titleCut ["","BLACK OUT", 1.1]
~1
_unit setpos [_x,_y,_z+_height]
titleCut ["","BLACK In", 2.5]
exit

usage,
[unitname,object,height] exec "whatever.sqs"

unitname being the name of the unit
object being the name of an object to move the player to. (invisible helipad)
height, the hight you want to place the unit at.

example:
[wplayer1,helipad1,20] exec "whatever.sqs"

btw heres a link for u to bookmark:
http://www.ofpec.com/editors/comref.php
you would have been able to find the get/set pos commands easy... not an advanced script...
« Last Edit: 30 Jan 2005, 10:03:40 by CopyrightPhilly »