Welcome New User Home | Forums | Register | Login | Larger Font
Main-Menu
Home
Login
Register
Add Download
Add News
Forums

Advertise
Affiliate Store US *
Affiliate Store UK *
Affiliate Store CA *
Angry Letter Generator
Avatar Upload
Calendar of Games
Contact
Downloads
FAQs
Forums
Member List
Member Projects
News
News Grabber *
Policy
Polls
Private Messages
Reviews
Screenshot Gallery
Search
Servers - Game
Store - Shirts *
Subscribe
Topics
Tutorials
Weblinks
Tutorials
CoD Mapping
CoDUO Mapping
CoD2 Mapping
CoD4 Mapping
CoD FAQs
HL2 Mapping
HL2 FAQs
SOF1 Mapping
Crysis Mapping
Q4 Mapping
Doom 3 Mapping
Doom 3 FAQs
UT2K3 Mapping
SOF2 Mapping
SOF2 FAQs

Lightray Modeling
General Modeling
General Modding
Adobe Photoshop
Common Mapping Errors

Readme.txt Generator
Members-Online
4mori_rabbit [Forum]
SlickToxic [Forum]
saluden [Membe]

3 Members and 9 Guests
Chat MODSonline
0 People Now Chatting
MODSOnline TeamSpeak

download TeamSpeak

In-The-News
Friday, May. 16th
Video games 'do not' encourage violence
Friday, May. 16th
Site update
Friday, May. 16th
MODSonair Episode 127
Tuesday, May. 13th
Web hosting, you need?
Sunday, May. 11th
MODSonair 127 Live
Latest Poll
Would you subscribe for a maps/projects backup utility and service?
I'd pay just about anything for that. 2.06%
If it was cheap enough I would. 4.12%
Only if it came with my MODSonline subscription. 6.19%
I can backup my own files. 82.47%
Why would I backup my files? 5.15%
Read More...
8 comments

Newsletter
Name:
Email:
Newsletter Archives
Your Membership
User Name:
Password:
Register.
In The Forums
[TUTORIAL] How to get rid of the wait time
CoD 4 Level Desi.. Posts: (5) Views: (110) by CoDLiNK
SP_Help!
CoD Level Design.. Posts: (2) Views: (10) by Sparks.
Kill3r's K3 MOD is DANGEROUS TO YOU AND YOUR S...
CoD4 General Gam.. Posts: (17) Views: (201) by 4mori_rabbit
train
CoD 4 Level Desi.. Posts: (1) Views: (8) by navysealsniper
Treyarch SPLITREASON.COM - Gear for Geeks and GamersBuy geek and gamer themed T-Shirts and Hats @ SplitReason.com!
Tutorials: CoD4 Mapping
Mapping and modding for Call of Duty 4.

Rating:
Aweful Rating Poor Rating Average Rating Good Rating Excellent Rating
Rotating models and brushes
2008-04-06 08:14:21
FiremanPaul will show you how to rotate models or brushes around any axis and at any speed

This tutorial will show you how to rotate models or brushes around any axis and at any speed. One single script will allow multiple objects to be rotated and each can be on its own axis and rotating at its own speed. The following pictures show some of what is possible with rotating objects. Movement in a map can provide animation and “life” to a map.

The lights on this lighthouse are models and rotate very slowly, looks awesome in game.


The blades on this windmill are brushes and slowly rotate.


This fan rotates at a nice brisk pace.


Radiant Work

Rotating brushes:
1. Make the brushes into the object you want to rotate.

2. On the axis that you want to rotate around, make a small brush of 8x8 or 16x16 and texture it with the origin texture from the tools textures.

3. Select all the brushes that are to be rotated and select the origin brush.

4. With the brushes and origin selected, right click on the 2D screen and select script>brushmodel.

5. With the brushes and origin still selected, press N to bring up the Entity window and enter the following key/value entries.

Targetname/rotate
Script_noteworthy/x,y or z for the desired axis
Speed/ the number of seconds for object to make one revolution




In the above example, the brush model will rotate around the x axis, making a complete revolution once every 10 seconds. Press Esc and that finishes the work in radiant for a brushmodel.

Rotating models:
1. Place the model you wish to rotate. Models do not need an origin brush, and will rotate around their own origin.

2. With the model selected, right click the 2D screen and select script>model.

3. With the model still selected, press N and set the speed desired and script_noteworthy for the rotation axis. Press Esc and that finishes the radiant work for a model.

NOTE: prefabs can’t be rotated and this includes prefab models. If you want to rotate a vehicle for example, you would need to place the model and set it to rotate as shown above. Open the vehicle prefab and copy the clips to your map. Add an origin to the clips to match your model axis, and set it to rotate as a script_brushmodel as shown above. With the model and clips rotating in the same position on the same axis, at the same speed, they are still two separate entities, but in game will function as one.

The Script

main()
{
rotate_obj = getentarray("rotate","targetname");
if(isdefined(rotate_obj))
{
 for(i=0;i<rotate_obj.size;i++)
 {
  rotate_obj[i] thread ra_rotate();
 }
}
}

ra_rotate()
{
if (!isdefined(self.speed))
 self.speed = 10;
if (!isdefined(self.script_noteworthy))
 self.script_noteworthy = "z";

while(true)
{
 // rotateYaw(float rot, float time, <float acceleration_time>, <float deceleration_time>);
 if (self.script_noteworthy == "z")
  self rotateYaw(360,self.speed);
 else if (self.script_noteworthy == "x")
  self rotateRoll(360,self.speed);
 else if (self.script_noteworthy == "y")
  self rotatePitch(360,self.speed);
 wait ((self.speed)-0.1); // removes the slight hesitation that waittill("rotatedone"); gives.
 // self waittill("rotatedone");
}
}
 


 
The first part of the script collects all the entities with the target name of rotate. The second part checks the entity for speed, if none specified, it will be 10 as indicated in the script. This number can be changed. The last section checks the axis the entity is to rotate around. If no script noteworthy is specified, the Z axis will be assigned.

Files

The above script goes in its own gsc called mp_mymapname_rotate.gsc and goes in the raw\maps\mp folder like the main gsc.

Add the line: maps\mp\mp_mymapname_rotate::main(); to the main gsc

Add the line: rawfile,maps/mp/mp_mymapname_rotate.gsc to the missing asset csv (step 4 of compile tools)

This completes the script and files. Recompile the map from step 1 of the compile tools and enjoy!!!!



Making a test map to test rotating objects is easy if you use the existing test map that came with radiant.
Open the mp_test.map that came with radiant. Add brushes and/or models as described above. Create the gsc mp_test_rotate.gsc and add the lines to the main mp_test.gsc and to the missing asset csv. This test map is a great way to test this tutorial or any other prefab that will fit the map. Wanna see how something looks, test it in a ready to go map!![thumbs_up]


All logos and trademarks and information in this site are property of MODSonline LLC © 2008.
The comments are property of their posters.
RSS news feeds for MODSonline.com can be found News.php.
Art of War Central
Partners
Quake 4 Mods for Dummies
The Firing Box
Frag Universe
Call of Duty Headquarters
mp_carpark
Battle for Europe COD2
modbase.be
Half-Life 2 Mods for Dummies
Ask About
Advertising
Friends
Volcano
Canada Kicks Ass Clan
SOF2 Files and Downloads
Ask About
Advertising
Link to Us
MODSonair
View in iTunes
Please help us to raise in the ranks of podcasting and subscribe to our itunes feed using the link above.
MODSonair Releases
MODSonair Episode 127
MODSonair Episode 126
MODSonair Episode 125
MODSonair Episode 124
MODSonair Episode 123
Copyright © 2008 MODSonline
Tresware Content Management System Copyright © 2008 Tresware
Website Designed and Hosted   Tresware