Page 1 of 1

Posted: September 3rd, 2005, 11:55 pm
by Drofder2004
You need to use an "origin" brush to set the origin.

Make a door, then on the hinge side of the door, make an origin brush. The centre of that brush is where the rotation will happen.

I recommend scripting btw.
/me would also use the search feature ;)

Posted: September 4th, 2005, 12:11 am
by Drofder2004
Ok, for this i recommend scripting. The "func_" commands should have been removed from CoD engine, as they suck :P (along with the deadly CSG's).

So, check out this for now. (looks like Im going to have to make a small scripting tut ;))

this is what I posted in another thread, but I have adapted it for your needs...

Map
-Make the brush(s) and the hinge (origin brush).
-Select both and right click. then choose script<Brushmodel
-Press n to open entity window
Add these values
Key - Targetname
Value - <targetname> (This can be anything, but make it easy to remember)

-Save map and compile (No, thats not the end)

Scripting
This will be how your scripting will look, with some help...

//------------------------------------------//
//-------------Main Scripting-------------//
//------------------------------------------//

Code: Select all

Main () //Always start scripting with this
{
thread Spinning_Object; //This will tell the script to run these threads (you can have more than 1)
}

Spinning_Object() //This is the thread called from above
{
Spinner = getent ("<targetname>","targetname"); //This gives the door a script reference

while (1) //This makes the thread repeat when ti gets to the end.
{
Spinner rotateto ((0, 0, 360), 2); // This will make the door rotate 360 degrees on its Z-Axis from its origin (the 2 is seconds)
}
}
Now save that as "<mapname>_script.gsc" and put in the maps/mp folder
And if you havent already done so, you must make the main gsc.

This is pretty simple...
Just copy this format...

Code: Select all

main()
{
ambientPlay("ambient_mp_carentan"); //Background Noise

maps\mp\_load::main();
maps\mp\<mapname>_script::main(); //Loads the script

game["allies"] = "british";
game["axis"] = "german";

game["british_soldiertype"] = "airborne";
game["british_soldiervariation"] = "normal";
game["german_soldiertype"] = "fallschirmjagergrey";
game["german_soldiervariation"] = "normal";

game["attackers"] = "allies";
game["defenders"] = "axis";
}
Now save that as "<mapname>.gsc" and also put in the maps/mp folder

BTW, this is not tested, but its all I can do off the top of my head.

Posted: September 4th, 2005, 12:29 am
by Rince
bored thot id do a random post
drofder seems 2 not wanna do our map:
|

Posted: September 4th, 2005, 12:33 am
by Drofder2004
Rince wrote:bored thot id do a random post
drofder seems 2 not wanna do our map:
|
Stop hijacking threads and email me!

I have just got on my computer 30 minutes ago. Checking the posts on the forums, checking emails, etc. and soon I'm going to bed.

I doubt I will be using msn/xfire anymore, I am slowly losing my computer time to work/education/brother. So please.... EMAIL ME (if you send me an IM on these forums, it automatically emails me also) AND I WILL GET TO WORK ON THE MAP :? :|

Posted: September 4th, 2005, 12:50 am
by Rince
( * Y * )

boobs

Posted: September 4th, 2005, 1:02 am
by Rince

Posted: September 4th, 2005, 1:15 am
by Drofder2004
Sam, take away the <>

I use them in tutorials

e.g <targetname> means "change this to the targetname" ;)

Also, when you get a script compile error, go to console and and scroll up until it tells you the exact problem.

Posted: September 4th, 2005, 12:48 pm
by Drofder2004
Main ()
{
thread Spinning_Object;
}

change to

Main ()
{
thread Spinning_Object();
}

Posted: November 8th, 2005, 5:02 pm
by Luke
After a lot of trial and error and searching i finally got it to work how i (and sam) wanted it, so its a non stop rotating thing.

Code: Select all

Main () 
{ 
thread spinner(); 
}

spinner() 
{ 
spinner = getent("spinner","targetname");  
while (1) 
{ 

spinner rotateyaw(-360, 5); //5 = seconds to rotate. change rotateyaw to either rotateroll or rotatepitch to change the rotation axis

spinner waittill("rotatedone");
} 
} 

Posted: November 8th, 2005, 6:57 pm
by Pwn-Rikku
well done :)

Posted: November 9th, 2005, 12:52 pm
by Drofder2004
Luke wrote:After a lot of trial and error and searching i finally got it to work how i (and sam) wanted it, so its a non stop rotating thing.

Code: Select all

Main () 
{ 
thread spinner(); 
}

spinner() 
{ 
spinner = getent("spinner","targetname");  
while (1) 
{ 

spinner rotateyaw(-360, 5); //5 = seconds to rotate. change rotateyaw to either rotateroll or rotatepitch to change the rotation axis

spinner waittill("rotatedone");
} 
} 
Yep, thats perfect coding :)

You could also use "wait 5;" instead of "spinner waittill("rotatedone");" but the way you have done it is a lot better.

Posted: November 9th, 2005, 5:58 pm
by Pwn-Rikku
well done luke :) ur getting better than me :P and i had to teach u fire.. :P

Posted: November 9th, 2005, 10:57 pm
by Luke
Pwn-Rikku wrote:well done luke :) ur getting better than me :P and i had to teach u fire.. :P
lol thx, i guess the fire was a stepping stone :wink:

Posted: November 10th, 2005, 6:09 pm
by Pwn-Rikku
i take it i tripped over the next stepping stone^^ and never tryed to walk it again. lol