Wondering how Dan did this..

Have a question about modding, modelling or skinning? Have a tutorial to post? Post here!

Moderator: Core Staff

Post Reply
Nekoneko
CJ Fan
CJ Fan
Posts: 170
Joined: April 18th, 2011, 3:48 pm

Wondering how Dan did this..

Post by Nekoneko » June 5th, 2011, 1:37 am

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.
Last edited by Nekoneko on June 5th, 2011, 10:19 am, edited 1 time in total.

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Wondering how Dan did this..

Post by Drofder2004 » June 5th, 2011, 1:41 am

Rotate the entire room?
Image
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

_DanTheMan_
PC Team
PC Team
Posts: 294
Joined: September 6th, 2008, 2:14 am

Re: Wondering how Dan did this..

Post by _DanTheMan_ » June 5th, 2011, 3:39 am

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;
}
Image

Nekoneko
CJ Fan
CJ Fan
Posts: 170
Joined: April 18th, 2011, 3:48 pm

Re: Wondering how Dan did this..

Post by Nekoneko » June 5th, 2011, 10:17 am

Dan himself replied :D

Uh. I thought it was something else as setplayerangles :/
But thanks

Pedsdude
Site Admin
Site Admin
Posts: 15909
Joined: October 15th, 2004, 7:18 pm
Location: UK

Re: Wondering how Dan did this..

Post by Pedsdude » June 5th, 2011, 2:43 pm

You thought he actually changed the direction of gravity :P
Image
Image

Nekoneko
CJ Fan
CJ Fan
Posts: 170
Joined: April 18th, 2011, 3:48 pm

Re: Wondering how Dan did this..

Post by Nekoneko » June 5th, 2011, 2:50 pm

haha, no, but I thought he somehow linked the player to a script_model and turned it, since the movement looked so smooth.

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Wondering how Dan did this..

Post by Drofder2004 » June 5th, 2011, 4:23 pm

_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;
}
A lot more elaborate than I thought, but in essence the same thing.

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...
Image
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

_DanTheMan_
PC Team
PC Team
Posts: 294
Joined: September 6th, 2008, 2:14 am

Re: Wondering how Dan did this..

Post by _DanTheMan_ » June 5th, 2011, 6:34 pm

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...
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).
Image

Nekoneko
CJ Fan
CJ Fan
Posts: 170
Joined: April 18th, 2011, 3:48 pm

Re: Wondering how Dan did this..

Post by Nekoneko » June 5th, 2011, 6:48 pm

But my problem is, it gets less smooth, the faster it is.
Guess you cant help it tho x.x

matt101harris
PC Team
PC Team
Posts: 2369
Joined: March 30th, 2008, 4:21 pm
Location: South England
Contact:

Re: Wondering how Dan did this..

Post by matt101harris » June 6th, 2011, 8:02 am

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 :(

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests