Rotating platforms.

Tutorials for Call of Duty mapping

Moderator: Core Staff

Post Reply
zipperdude
CJ Worshipper
CJ Worshipper
Posts: 386
Joined: July 12th, 2007, 6:07 pm

Rotating platforms.

Post by zipperdude » February 24th, 2008, 8:59 pm

Rotating platforms
This tutorial will teach you how to make platforms rotate.

To make a platform rotate first start out by making a brush (I made mine 64x64)
And make an origin.
The origin will be center point of your platforms rotation.
Image
Now select the platform that you want to rotate and the origin, right click your 2d grid and select script>brushmodel. They will turn blue.
For the origin to work you need to go to textures>common and select origin for your origin, otherwise it wont work.
Now to name it go to entities (“N”) and type for

Code: Select all

	key = targetname
	value = platform
Image
Now texture and compile and we will go to the scripting.

For the scripting just copy paste this:

Code: Select all

main() 
{ 
thread platform();
}

platform ()
{
	platform = getent("platform","targetname");
	while(1)
	{
		platform rotateyaw(360,10);
		platform waittill("rotatedone");
	}
}
rotatepitch, rotateyaw, rotateroll and rotateto((x,y,z),10) are the main rotate commands but i usually stick to rotateyaw, pitch, and roll.

Image
I have included the pk3 and a .map of it here is the link:
http://files.filefront.com/rotate+tutra ... einfo.html
Have fun, I hope this helped out others and happy mapping.
xfire = zipperdude
***********************************
NEW:
I've found a way to rotate things on there sides and figured itd be best to add it then create a new topic for the same thing.
The first thing you do is make a brush and a origin and label them as a script_brushmodel together. give them what ever targetname you want. so far your map should look like this :
Image
Now compile and onto the coding.

Code: Select all

rotate_2()
{
	rotate_2 = getent("rotate_2","targetname");
	while(1)
	{
		rotate_2 rotatepitch( -360 , 6 );
		rotate_2 waittill("rotatedone");
	}
}
Add that to your .GSC, compile and have fun.

NOTES: I've never tested this but, if you want to make it rotate the other way I would assume you move the origin to the other side and instead of using rotatepitch you use rotateroll.
If you want to download the map and the .GSC for what ever reason you can get this one here http://hosted.filefront.com/zipperdude/
If you have any questions just add my xfire.

X-Fire - Zipperdude.
Last edited by zipperdude on October 27th, 2008, 10:38 pm, edited 2 times in total.
Show me what lies just beyond my eyes
Would you take me to the world where my spirit flies?
Tell me is that really fact or a pack of lies?

Twiztid = By . Blink = Song.
[color=#00FF00]Drofder2004[/color] wrote:Its not out of nowhere, I carry it in my backpack, with my elephant, 32 pets, a spare pair of leggings, 20 fish feasts, a staff I use to magically disenchant things, a stone I can use to travel home, 20000 arrows, a portable stable with a gorilla, a cat and a wolf, 20 bandages and massive quantity of cloth.

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

Re: Rotating platforms.

Post by Pedsdude » February 25th, 2008, 5:14 am

Very professionally done, thank you :)
Image
Image

steveuk
CJ G0D!
CJ G0D!
Posts: 1330
Joined: November 21st, 2006, 12:51 pm

Re: Rotating platforms.

Post by steveuk » February 28th, 2008, 12:32 am

would this work on Cod4. isnt the code for the gsc differnt.?Would of love this in my last map, jumpzone..

Steve

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Re: Rotating platforms.

Post by Nightmare » February 28th, 2008, 12:55 am

Nope, same code. Everything that worked in CoD works in CoD4
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

zipperdude
CJ Worshipper
CJ Worshipper
Posts: 386
Joined: July 12th, 2007, 6:07 pm

Re: Rotating platforms.

Post by zipperdude » October 14th, 2008, 7:52 pm

Fuzzmunch showed me how to do this. I figured i should give credit to who taught me lol.
Show me what lies just beyond my eyes
Would you take me to the world where my spirit flies?
Tell me is that really fact or a pack of lies?

Twiztid = By . Blink = Song.
[color=#00FF00]Drofder2004[/color] wrote:Its not out of nowhere, I carry it in my backpack, with my elephant, 32 pets, a spare pair of leggings, 20 fish feasts, a staff I use to magically disenchant things, a stone I can use to travel home, 20000 arrows, a portable stable with a gorilla, a cat and a wolf, 20 bandages and massive quantity of cloth.

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

Re: Rotating platforms.

Post by Drofder2004 » October 15th, 2008, 10:01 pm

zipperdude wrote:Fuzzmunch
Oh my, give this guy a medal for funniest name ever!
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

zipperdude
CJ Worshipper
CJ Worshipper
Posts: 386
Joined: July 12th, 2007, 6:07 pm

Re: Rotating platforms.

Post by zipperdude » October 16th, 2008, 1:18 am

lol
Show me what lies just beyond my eyes
Would you take me to the world where my spirit flies?
Tell me is that really fact or a pack of lies?

Twiztid = By . Blink = Song.
[color=#00FF00]Drofder2004[/color] wrote:Its not out of nowhere, I carry it in my backpack, with my elephant, 32 pets, a spare pair of leggings, 20 fish feasts, a staff I use to magically disenchant things, a stone I can use to travel home, 20000 arrows, a portable stable with a gorilla, a cat and a wolf, 20 bandages and massive quantity of cloth.

rohit
CJ Wannabe
CJ Wannabe
Posts: 3
Joined: October 7th, 2012, 4:02 pm

Re: Rotating platforms.

Post by rohit » October 8th, 2012, 10:55 am

Please help me someone respond to me as quickly as possible why am i getting this damn error

Code: Select all

------- Game Initialization -------
gamename: Call of Duty 4
gamedate: Jun 18 2008
----------------------
Game: G_SetupWeaponDef
----------------------
-----------------------------------

******* script runtime error *******
undefined is not an object: (file 'maps/mp/mp_deathrun_testing.gsc', line 13)
    trig waittill ("trigger");
    *
Error: called from:
(file 'maps/mp/mp_deathrun_testing.gsc', line 5)
 thread trap1();
        *
Error: started from:
(file 'maps/mp/mp_deathrun_testing.gsc', line 1)
main()
*
Error: ************************************
********************
ERROR: script runtime error
(see console for details)
undefined is not an object
********************
----- Server Shutdown -----
==== ShutdownGame (1) ====
---------------------------
Hitch warning: 1525 msec frame time
Hitch warning: 646 msec frame time
Hitch warning: 14282 msec frame time
Image
Founder of MW3 CLAN

User avatar
Goro92
CJ Spammer!
CJ Spammer!
Posts: 605
Joined: March 7th, 2011, 5:54 pm
Location: Brescia, Italy

Re: Rotating platforms.

Post by Goro92 » October 8th, 2012, 1:02 pm

post this mp_deathrun_testing.gsc

btw check your targetnames
Image

darkpheonixz4x
CJ Newbie
CJ Newbie
Posts: 51
Joined: July 2nd, 2012, 11:15 am

Re: Rotating platforms.

Post by darkpheonixz4x » October 8th, 2012, 1:07 pm

Please help me someone respond to me as quickly as possible why am i getting this damn error
Star, please ping me on xfire. I'm nyan cat. Also, don't post such things here. Make a new thread in CoD4 Mapping help.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest