Author |
Message |
blargiefarg
Joined: Mon Apr 05, 2010 8:04 am Posts: 149 Location: Under your bed
|
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?
|
Sun Oct 24, 2010 10:09 pm |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
Re: teleportation = ?
To "teleport" something, simply change its position variable (Pos) to the desired position.
|
Sun Oct 24, 2010 10:11 pm |
|
|
blargiefarg
Joined: Mon Apr 05, 2010 8:04 am Posts: 149 Location: Under your bed
|
Re: teleportation = ?
so would it be like Code: function Create(self) if parent.MovableObject:IsActor then Set pos.Y(123456) end end
|
Sun Oct 24, 2010 10:13 pm |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
Re: teleportation = ?
What is Set? And remember, capitalization matters.
|
Sun Oct 24, 2010 10:17 pm |
|
|
blargiefarg
Joined: Mon Apr 05, 2010 8:04 am Posts: 149 Location: Under your bed
|
Re: teleportation = ?
oops I was thinking in ini. so it would be Pos.Y(123)... right?
|
Sun Oct 24, 2010 10:19 pm |
|
|
findude
Joined: Tue Dec 12, 2006 3:10 pm Posts: 495 Location: Uncertain quantum state
|
Re: teleportation = ?
|
Sun Oct 24, 2010 10:25 pm |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
Re: teleportation = ?
It would be "pointer.Pos = Vector(<x value>,<y value>)".
It's a vector. Not a single number.
|
Sun Oct 24, 2010 10:30 pm |
|
|
findude
Joined: Tue Dec 12, 2006 3:10 pm Posts: 495 Location: Uncertain quantum state
|
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.
|
Sun Oct 24, 2010 10:31 pm |
|
|
blargiefarg
Joined: Mon Apr 05, 2010 8:04 am Posts: 149 Location: Under your bed
|
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
|
Sun Oct 24, 2010 10:34 pm |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
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: To change properties: Code: pointer.property = newValue So, Code: self.Pos = Vector(0,0)
|
Sun Oct 24, 2010 10:39 pm |
|
|
|