Data Realms Fan Forums
http://45.55.195.193/

teleportation = ?
http://45.55.195.193/viewtopic.php?f=73&t=20027
Page 1 of 1

Author:  blargiefarg [ Sun Oct 24, 2010 10:09 pm ]
Post subject:  teleportation = ?

Lately I've been seeing lots of "just teleport an actor underground and pin it" type stuff, I understand how I'd pin it, but how would I go about teleporting it?

Author:  CaveCricket48 [ Sun Oct 24, 2010 10:11 pm ]
Post subject:  Re: teleportation = ?

To "teleport" something, simply change its position variable (Pos) to the desired position.

Author:  blargiefarg [ Sun Oct 24, 2010 10:13 pm ]
Post subject:  Re: teleportation = ?

so would it be like

Code:
function Create(self)
   if parent.MovableObject:IsActor then
      Set pos.Y(123456)
   end
end

Author:  CaveCricket48 [ Sun Oct 24, 2010 10:17 pm ]
Post subject:  Re: teleportation = ?

What is Set? And remember, capitalization matters.

Author:  blargiefarg [ Sun Oct 24, 2010 10:19 pm ]
Post subject:  Re: teleportation = ?

oops I was thinking in ini. so it would be Pos.Y(123)... right?

Author:  findude [ Sun Oct 24, 2010 10:25 pm ]
Post subject:  Re: teleportation = ?

http://www.lua.org/manual/5.1/
http://forums.datarealms.com/viewtopic.php?f=1&t=16824



Read them.

Author:  CaveCricket48 [ Sun Oct 24, 2010 10:30 pm ]
Post subject:  Re: teleportation = ?

It would be "pointer.Pos = Vector(<x value>,<y value>)".

It's a vector. Not a single number.

Author:  findude [ Sun Oct 24, 2010 10:31 pm ]
Post subject:  Re: teleportation = ?

Furthermore, it's a value, and not a function like you are calling it with the brackets. Read the guides. Cricket made one too.

Author:  blargiefarg [ Sun Oct 24, 2010 10:34 pm ]
Post subject:  Re: teleportation = ?

I'm already basing it off of stuff I've learned from what you've posted. I guess there are just some things I'm not getting

Author:  CaveCricket48 [ Sun Oct 24, 2010 10:39 pm ]
Post subject:  Re: teleportation = ?

Position is a property. In most scripts, "self" is a pointer to the object that the script is attached to. To call properties on objects, you do the following:
Code:
pointer.property

To change properties:
Code:
pointer.property = newValue


So,
Code:
self.Pos = Vector(0,0)

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/