Wondering how Dan did this..
Moderator: Core Staff
Wondering how Dan did this..
Saw this vid long ago, and thought pff. who cares
http://www.xfire.com/video/356c3d/
Now Im dying to know how the script works.
Would be awesome if anyone could help me on this.
http://www.xfire.com/video/356c3d/
Now Im dying to know how the script works.
Would be awesome if anyone could help me on this.
Last edited by Nekoneko on June 5th, 2011, 10:19 am, edited 1 time in total.
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Wondering how Dan did this..
Rotate the entire room?

Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
-
- PC Team
- Posts: 294
- Joined: September 6th, 2008, 2:14 am
Re: Wondering how Dan did this..
This script uses two separate rooms, where the second room is an upside down version of the first. When you touch the trigger, you are teleported to the upside down room's ceiling (which is like the floor of the room you were in before) and turned upside down, then rotated and moved to the floor.
The rotating script, where 'time' is the distance between the floor and the ceiling divided by a set speed:
The rotating script, where 'time' is the distance between the floor and the ceiling divided by a set speed:
Code: Select all
self setPlayerAngles((self getPlayerAngles()[0]*-1, (self getPlayerAngles()[1]*-1) - 180, 180));
for(i = 0;i/20 < time;i++)
{
self setPlayerAngles(self getPlayerAngles() - (0, 0, (180/time)/20));
wait 0.05;
}
Re: Wondering how Dan did this..
Dan himself replied 
Uh. I thought it was something else as setplayerangles
But thanks

Uh. I thought it was something else as setplayerangles

But thanks
Re: Wondering how Dan did this..
haha, no, but I thought he somehow linked the player to a script_model and turned it, since the movement looked so smooth.
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Wondering how Dan did this..
A lot more elaborate than I thought, but in essence the same thing._DanTheMan_ wrote:This script uses two separate rooms, where the second room is an upside down version of the first. When you touch the trigger, you are teleported to the upside down room's ceiling (which is like the floor of the room you were in before) and turned upside down, then rotated and moved to the floor.
The rotating script, where 'time' is the distance between the floor and the ceiling divided by a set speed:
Code: Select all
self setPlayerAngles((self getPlayerAngles()[0]*-1, (self getPlayerAngles()[1]*-1) - 180, 180)); for(i = 0;i/20 < time;i++) { self setPlayerAngles(self getPlayerAngles() - (0, 0, (180/time)/20)); wait 0.05; }
May I ask the point of the "180/time", or simply why the distance of the room matters. I might just be missing something, but creating a smooth view rotation can be accomplished with a set value...

Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
-
- PC Team
- Posts: 294
- Joined: September 6th, 2008, 2:14 am
Re: Wondering how Dan did this..
The 180/time and the distance of the room mattered in this script because it was made to be used for multiple rooms, which may have different ceiling heights (so it would move you at the same speed regardless of the height of the room).Drofder2004 wrote:May I ask the point of the "180/time", or simply why the distance of the room matters. I might just be missing something, but creating a smooth view rotation can be accomplished with a set value...
Re: Wondering how Dan did this..
But my problem is, it gets less smooth, the faster it is.
Guess you cant help it tho x.x
Guess you cant help it tho x.x
-
- PC Team
- Posts: 2369
- Joined: March 30th, 2008, 4:21 pm
- Location: South England
- Contact:
Re: Wondering how Dan did this..
DANIEL!!!!!!!!!!!!!!!!!!!!!!!!!!!!! I havent seen you for AGES!!!!!!!!!!!!!!!!!!!!
PeħÄuÄe@CoDJumper.com: put your cock away, you sick man
Matty@CoDJumper.com: hahaha
PeħÄuÄe@CoDJumper.com: (while i whip mine out)
Matty@CoDJumper.com: lol
PeħÄuÄe@CoDJumper.com: just kidding
PeħÄuÄe@CoDJumper.com: ... i don't have one
Matty@CoDJumper.com: hahaha
PeħÄuÄe@CoDJumper.com: (while i whip mine out)
Matty@CoDJumper.com: lol
PeħÄuÄe@CoDJumper.com: just kidding
PeħÄuÄe@CoDJumper.com: ... i don't have one

Who is online
Users browsing this forum: No registered users and 2 guests