teleport and transport game character?

i need help in creating an object in a game that would make my character move along it’s path.

Example:
when it steps on tiles like [>>][>>][>>] it would move to the right, yet the character should still be able to exit this path at any time. how would i make this


also i would like help in makeing an abject that when stepped on, would transport the character

Example:
If the following letters represented a transporting area.

A B

C D

If character approches “A”, coming from the top… it would teleport it to “C”. Yet if the character steps on “A” coming from the left, it would teleport it to B.

how would i achieve this?

For the path, it sounds like your trying to do something along the lines of a conveyor track. If so simply add additional force to your character in the direction that the track is supposed to move him. The addition of other forces for movement should give you the default ability to leave the track at any time.

The teleport function can be very easily implemented with a python script using “own.setPosition()”. I recommend you make the teleport tile out of four planes (one at the edge of each side of the teleport tile) this way you can use setPosition() in relation with the side of the tile that you first contacted.

Is there a way to teleport an actor from one loc to another with logic bricks?

make a 2 frame animation, leave the first however you want, but then in the second frame have the character where you want it to teleport to.l Now, all you have to do is make the IPO play frame 2. The character will now be wherever you want it to be.

It worked as an ACTOR with no dynamics or rigidbody effects,

when dynamics and rigidbody are applied my lil’ animation does not play???

Thanks

Why would you want to do this with logic bricks?

All of this can be handled with just one simple python script using the method I described in my previous post.

I am still trying to figure out the logic bricks and learn python… I am mostly a modeler hobbyist and was intrigued by GE and the logic bricks,(thought maybe I could point and click the problem away) I have spent a few nights trying to understand the principles of python but my time is very limited and I get impatient sometimes… And i’m not much of a programmer.

I will take your advice and look a bit further into python and figure this out.

Thanks

You’ll need to go with python sooner or later. You probably don’t know yet, but trust me, logic bricks become very limiting very fast.

If you are interested in learning the API, maybe my recent tutorial can help you out on the matter:

http://blenderartists.org/forum/showthread.php?t=80826

Good luck.

I followed some tutorials but I get the same basic error…

heres my script…

"
import GameLogic
co = GameLogic.getCurrentController()

obj = co.getOwner()

obj.setPosition = (4.631,5.603,2.067)
"

the error I get is

" File “test.py”, line 4, in ?
AttributeError: ‘NoneType’ object has no attribute ‘getOwner’
"

am I doing something wrong???

Thanks Again

I think from reading through other threads that this is the wrong version, I will uninstall 2.5 and install 2.4.3 and try again.

Ok, that was unsuccessful, I recieved no errors when starting blender but I still get the same error when I try to run any script…

my getOwner has no attribute

Thanks

subculturez>

You are using the setPosition function the wrong way. Do it like this:


own.setPosition([4.631,5.603,2.067])
#We use the [] braces, because .setPosition takes only one argument (list)

The rest of your script seems fine.

PS: Don’t use “co” for a controller assigment, use “cont”, because that’s what the community is used to.

I have revamped the script to look like this:

import GameLogic
cont = GameLogic.getCurrentController()

obj = cont.getOwner()

obj.setPosition = ([4.631,5.603,2.067])

and I still get the error on line 4 about getOwner not having an attribute

thanks Social, you’ve been very helpful, I think once I figure out why I am getting this error things will start to make sense…

You didn’t follow my instructions, read the code in my previous post again.

Use the setPosition function exactly like this: obj.setPosition([4.631,5.603,2.067])

There should be NO EQUAL SIGN between setPosition and ().

Get it?

PS: You can get rid of the “import GameLogic” line at the top. As long as cont is set to “GameLogic.getCurrentController()”, you don’t need to aditionally import GameLogic, it’s already there.

without line 1 I get error:

NameError: name ‘GameLogic’ is not defined

cont = GameLogic.getCurrentController()

obj = cont.getOwner()

obj.setPosition([4.631,5.603,2.067])

and I still get an error with line 4

“AtributeError: ‘NoneType’ object has no attribute ‘getOwner’”

Ok, don’t worry, I’ll help you figure this out the best I can.

First download this .blend file:

http://socialstorage.googlepages.com/setpostest.blend

It’s a little test file I made. Press P in the 3d window and press space.

If the cube in my file “teleports” to the right, then follow the way I did things in my file and you should be fine.

If you still end up with same errors, I suggest you reinstall blender, along with python 2.4 (i think you said that you are using 2.5, well try 2.4)

Ok, I might have done several things wrong, First was python 2.5, Second I Also had VPython 2.5, I uninstalled it, not sure if that was neccessary but poof it’s gone! and last I was executing the script with the right mouse button, I still get those errors when I do that but What you gave me WORKS…

I tried doing it with my project and SUCCESS…

Thanks, A Bunch
I hope you win the lottery Social!