script:moving walls?

Have questions about CoD/UO mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
HavoC
CJ Fan
CJ Fan
Posts: 104
Joined: September 12th, 2006, 1:27 am

script:moving walls?

Post by HavoC » October 13th, 2006, 1:23 am

is there a way i can make a script where you can move walls... im working on a trickjump map and i want to be able to open up the wallas from the middle to the side.. im using Graydiant btw
ty in advanced

User avatar
Soviet
Core Staff
Core Staff
Posts: 7762
Joined: April 23rd, 2005, 9:12 pm

Post by Soviet » October 13th, 2006, 1:58 am

use the same scripting used here:

http://codjumper.com/forums/viewtopic.p ... 63&start=0

just with walls instead of platforms.

Of course post if you have any questions about the tut or its not working :P

HavoC
CJ Fan
CJ Fan
Posts: 104
Joined: September 12th, 2006, 1:27 am

scropting:moving walls

Post by HavoC » October 13th, 2006, 12:05 pm

ok so does this look correct?

targetname
wall1

name :wall

Code: Select all

main() 
{ 
maps\mp\_load::main(); 
maps\mp\wall1::main(); 
maps\mp\wall2::main(); 
}

name :wall1

main() 
{ 
thread wall1(); 
} 

wall1() 
{ 
wall = getent ("wall1","targetname"); 
while(1) 
{ 
wall moveY (208,2,0.5,0.5); 
wait(5); 
wall moveY (-208,2,0.5,0.5); 
wall waittill ("movedone"); 
} 
} 



name:wall2

main() 
{ 
thread wall2(); 
} 

wall2() 
{ 
wall = getent ("wall2","targetname"); 
trigger = getent ("trig_wall","targetname"); 
while(1) 
{ 
trigger waittill ("trigger"); 
wait(2); 
wall moveY (208,2,0.5,0.5); 
wait(5); 
wall moveY (-208,2,0.5,0.5); 
wall waittill ("movedone"); 
} 
} 





like this?

and i also,,do not have a texture named trig... or func... i need trig for thisand im just bringing up func too...func,wut i use to make door rotating

User avatar
Soviet
Core Staff
Core Staff
Posts: 7762
Joined: April 23rd, 2005, 9:12 pm

Post by Soviet » October 13th, 2006, 2:33 pm

not sure about how to make a rotating door but i know it involves connecting a origin brush to a brush_scriptmodel. You can make those walls any textures you want, just make sure you right click and make the entity script_brushmodel.

That looks right to me, but i know very little about scripting so that could very easily be wrong

Luke
Past/Inactive Team Member
Past/Inactive Team Member
Posts: 1774
Joined: May 31st, 2005, 12:42 am
Location: Cornwall, UK

Post by Luke » October 13th, 2006, 4:13 pm

I assume you've read that tutorial, and know each code below where you have name: should be separate gsc's. When you post a code, the proper way would be to put each code inside separate code tags, so its easier to understand.
But I don't see the point in having a separate gsc file for every wall you want to move, you may want to have all your walls in 1 gsc and all your doors in another, you could have it all in 1 gsc if you wanted, but it's up to you how you want to manage your scripts. You'll end up with loads of files if you make a gsc for every function, so this might be easier for you:

Rather than having 2 gsc's for your walls, put them in 1:

Code: Select all

main()
{
thread wall1();
thread wall2();
}

wall1()
{
wall = getent ("wall1","targetname");
while(1)
{
wall moveY (208,2,0.5,0.5);
wait(5);
wall moveY (-208,2,0.5,0.5);
wall waittill ("movedone");
}
}

wall2()
{
wall = getent ("wall2","targetname");
trigger = getent ("trig_wall","targetname");
while(1)
{
trigger waittill ("trigger");
wait(2);
wall moveY (208,2,0.5,0.5);
wait(5);
wall moveY (-208,2,0.5,0.5);
wall waittill ("movedone");
}
}
Name that gsc whatever you want, for example "walls". Then you can load the above script with your mapname.gsc like this:

Code: Select all

main()
{
maps\mp\_load::main();
maps\mp\walls::main();
} 
To make a door you need to give it an origin textured brush as soviet said. It doesn't matter what size the origin brush is, it's just going to be using the very center of the brush as its origin. So place that where you want the doors pivot point, or hinge. Now select both the door and the origin brush, right click and make them a script_brushmodel, and give it a targetname of say "door1". Now make a trigger brush, the trig texture is found in common, right click and select trigger>use. Give it a targetname, for example "door1_trig" and thats the mapping done.
Now if you want, you can create a new gsc file and use a simple code like this for the door:

Code: Select all

main()
{
thread door1();
} 

door1()
{
door1 = getent ("door1","targetname");
door1_trig = getent ("door1_trig","targetname");

while (1)
{
door1_trig waittill ("trigger");
door1 rotateto ((0, -90,0), 1);
wait (2);
door1 rotateto ((0, 0,0), 1);
}
}

HavoC
CJ Fan
CJ Fan
Posts: 104
Joined: September 12th, 2006, 1:27 am

scripting:wallmove

Post by HavoC » October 13th, 2006, 7:57 pm

ok.. i will try and c how it works.. but i know how to make doors rotate u just mak a door with a brush connecting with origin on oposite side of door.. the problem is i used to rightclick after the three brushes were high lighted and there would be something called func.. under there i would select door rotating.. but func isnt there :\

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

Post by Drofder2004 » October 13th, 2006, 8:07 pm

'funcs' are quake commands, that CoD left in the game, not recommended to use them.

To create a door you need to first create the door (duh?) then you need to create a hinge. The hinge is where you want the door to rotate from. Give the hinge an "origin" texture and then select both and do "script_brushmodel".
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

HavoC
CJ Fan
CJ Fan
Posts: 104
Joined: September 12th, 2006, 1:27 am

scripting:moving walls

Post by HavoC » October 13th, 2006, 8:30 pm

umm i tried both ways and they didnt work :\

HavoC
CJ Fan
CJ Fan
Posts: 104
Joined: September 12th, 2006, 1:27 am

cod radiant

Post by HavoC » October 16th, 2006, 8:35 pm

i am planning on starting to use radiant since i mostly see scriptis and tut's for it so i started using it ... its fine but wen i try to zoom in in the graphic box where it shows my maps it goes wicked fast and backs me up and crap so i lose sight of the object then i look in 2d window it on otheer side of graph.. plz help ill try and find soome setting up the editior thing TY :lol:

Luke
Past/Inactive Team Member
Past/Inactive Team Member
Posts: 1774
Joined: May 31st, 2005, 12:42 am
Location: Cornwall, UK

Re: cod radiant

Post by Luke » October 16th, 2006, 9:39 pm

HavoC wrote:i am planning on starting to use radiant since i mostly see scriptis and tut's for it so i started using it ... its fine but wen i try to zoom in in the graphic box where it shows my maps it goes wicked fast and backs me up and crap so i lose sight of the object then i look in 2d window it on otheer side of graph.. plz help ill try and find soome setting up the editior thing TY :lol:
Most scripting in uo applies the same to cod, the main difference is you can't use vehicles.

For the 3d window? edit preferences and lower the camera speed.

HavoC
CJ Fan
CJ Fan
Posts: 104
Joined: September 12th, 2006, 1:27 am

scripting?

Post by HavoC » October 16th, 2006, 10:33 pm

ok ty,, but is there a way a can make it like graydiant... for me i have to click top of box to move forward bottom backwards then it takes me a whiel to turn because i spin around wen i try to turn?

Luke
Past/Inactive Team Member
Past/Inactive Team Member
Posts: 1774
Joined: May 31st, 2005, 12:42 am
Location: Cornwall, UK

Post by Luke » October 16th, 2006, 11:10 pm

It should work just like graydiant. Have you setup cod radiant properly? If not go to modsonline.com and have a look at the cod mapping tutorials for setting it up.

HavoC
CJ Fan
CJ Fan
Posts: 104
Joined: September 12th, 2006, 1:27 am

.

Post by HavoC » October 16th, 2006, 11:34 pm

just tried it didnt work any other ideas.. ty btw :?

9mm
CJ Donator
CJ Donator
Posts: 183
Joined: February 14th, 2006, 10:57 pm
Location: USA

Post by 9mm » October 17th, 2006, 1:28 am

i think you are having the same prob I was had when i first started mapping

ur button might be off the screen like mine was

Image

here is a pic just so you know what the button looks like incase you have it in a box like this

Image

HavoC
CJ Fan
CJ Fan
Posts: 104
Joined: September 12th, 2006, 1:27 am

scripting needed

Post by HavoC » October 17th, 2006, 2:01 am

ok ty,,, but i only have half the buttons its showing on ur pic so i dont have that button,, + i just wentinto radiant,, everythings not wehere it supposed to be,, theres a console then a camera then graph but u can drag them around and there not full size x(

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest