How to? Need help "teleporting" an actor

Game Editor comments and discussion.

How to? Need help "teleporting" an actor

Postby bilvyy » Wed Feb 16, 2011 11:32 am

In my game, I have different areas. A city, a zoo, a town, as well as interior rooms. They're all separated from one another.

I need to be able to transport the main actor between these places but I don't know how and I can't find anything in the in-game tutorials.

For example: When the actor walks into a certain 'street' in the city area, he will appear in the entrance to the zoo.

Is this possible? I have tried moving him with collisions but the "Move to" function isn't really what I'm looking for. I'm hoping for the 'teleport' to be instant.

Thank you in advance for any suggestions.

P.S. I'm hoping that this method will help me transport the actor "indoors" as well. I need to be able to transport him to one of the interior scenes when he collides with the specific door.

EDIT: I apologise if this is in the wrong forum, I haven't posted before and I'm hoping I haven't made any mistakes.
bilvyy
 
Posts: 23
Joined: Wed Feb 16, 2011 2:04 am
Score: 0 Give a positive score

Re: How to? Need help "teleporting" an actor

Postby schnellboot » Wed Feb 16, 2011 11:58 am

http://game-editor.com/forum/viewtopic.php?f=4&t=9806
this is lcl's door script which can solve all your problems

bilvyy wrote:EDIT: I apologise if this is in the wrong forum, I haven't posted before and I'm hoping I haven't made any mistakes.

this should be in Support, but it doesnt matter I think ^^
schnellboot
 
Posts: 819
Joined: Sat Mar 31, 2007 1:35 pm
Location: Germany
Score: 102 Give a positive score

Re: How to? Need help "teleporting" an actor

Postby bilvyy » Thu Feb 17, 2011 11:02 pm

thank you very much! i'll try it now (:
bilvyy
 
Posts: 23
Joined: Wed Feb 16, 2011 2:04 am
Score: 0 Give a positive score

Re: How to? Need help "teleporting" an actor

Postby again » Fri Feb 18, 2011 12:09 am

I made GED to help you its much simpler and its located here

viewtopic.php?f=2&t=10043
Free windows mobile games like doodle jump and super mario bros
http://krenisis.freeforums.org/
again
 
Posts: 258
Joined: Wed Jan 19, 2011 7:06 pm
Score: 33 Give a positive score

Re: How to? Need help "teleporting" an actor

Postby lcl » Sun Feb 20, 2011 7:02 am

again wrote:I made GED to help you its much simpler and its located here

viewtopic.php?f=2&t=10043

Kren, yeah your code is easily understandable, but think of using it when there
is over hundreds of doors! I mean, you always have to create new actor and add those events to it
and even create one variable more. So, with 100 pairs of doors you would have 100 variables and it's awful
amount just for those doors!

My code instead works like this: you create one door with that code and then just clone it.
And they form pairs by their cloneindexes, like 0 and 1, 2 and 3, 4 and 5, etc.
That means you don't have to write any code, or create any variables after creating one door / teleport
with that code of mine.

It's way more easier to use and actually much simpler than yours. :)
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: How to? Need help "teleporting" an actor

Postby bilvyy » Mon Feb 21, 2011 3:13 am

again wrote:I made GED to help you its much simpler and its located here

viewtopic.php?f=2&t=10043


thank you for this, i'm just a little stuck getting the codes in order to make sure all the collisions work.

lcl wrote:
again wrote:I made GED to help you its much simpler and its located here

viewtopic.php?f=2&t=10043

Kren, yeah your code is easily understandable, but think of using it when there
is over hundreds of doors! I mean, you always have to create new actor and add those events to it
and even create one variable more. So, with 100 pairs of doors you would have 100 variables and it's awful
amount just for those doors!

My code instead works like this: you create one door with that code and then just clone it.
And they form pairs by their cloneindexes, like 0 and 1, 2 and 3, 4 and 5, etc.
That means you don't have to write any code, or create any variables after creating one door / teleport
with that code of mine.

It's way more easier to use and actually much simpler than yours. :)


your code would probably work if i understood it :/ i don't know how to work code really and i get mixed up with all the variables and i haven't a clue what cloneindexes are. i think i need a really dumbed down step-by-step tutorial to help me.

i've got 7 pairs of doors in my game, if that helps or matters at all.
bilvyy
 
Posts: 23
Joined: Wed Feb 16, 2011 2:04 am
Score: 0 Give a positive score

Re: How to? Need help "teleporting" an actor

Postby lcl » Wed Feb 23, 2011 7:09 am

First, you create one actor that is door.
You have to create integer variable named canMove.
And then you add that code I made into door - collision any side of player, repeat: yes.
Then just clone 14 doors add them into the positions you want.
They work in pairs. (Cloneindex is the number after the cloned actors name).
They form pairs by their cloneindexes. Like door number 0 takes you to door number 1 and oppositely. Other pairs are 2 and 3, 4 and 5, etc.
In the code there is that KEY_UP. It means arrow key up.
You can change it to any key on keyboard, like KEY_x.
There is comments in the code, they explain it. And I uploaded a demo to the topic about that code. :D
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest