Doors.

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

Moderator: Core Staff

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

Post by Drofder2004 » August 7th, 2005, 6:51 pm

Well, Peds would be right.

Ok, for a start you should try your best not to use the "built-in" func(tions) commands. Such as the rotating_door.
I will show you another way of doing this in the next post (as I will need to fully refresh my memory of it). but to solve your problems on at least one of the questions (I havent tested the sliding doors) you need to use an origin texture.

Ok, so this is how it goes.

Make a door. Then decide which side you want the hinges on. Now copy the door and go into the "top view". Then make the copy into a long rectangle with square ends, and place this exactly half way on your hinge points.

I'm probably cnofusing you by now ;)

Now change the texture to common/origin (press S to change the texture without looking for it). Now select both of the brushes and then make it a func_rotating_door.

If that has confused you a bit too much here is a prefab...
http://savefile.com/files/3423407
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

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

Post by Drofder2004 » August 7th, 2005, 7:23 pm

The Professional Way (Scripted).

Map
-Make the door 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 - <doorname_#> (This can be anything, but to easily know which oor you are scripting, this format is the best. For eaxmple: FactoryDoor_01)
-Make a trigger infront of the door (This can be motion detected or Use key activated)
-Select the trigger and right click. Choose Trigger<Multiple or Trigger<Use (Multiple is the motion and use is the use ;))
-Press n to open the entity window and enter these values
Key - Targetname
Value - Trig_<doorname_#> (Example: Trig_FactoryDoor_01)
-Save map and compile (No, thats not the end :P)

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

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

Factory_Doors () //This is the thread called from above
{
FactDoor_01 = getent ("<doorname_#>","targetname"); //This gives the door a script reference
Trig_FactDoor_01 = getent ("Trig_<doorname_#>","Targetname"); //This give the trigger a reference
while (1) //Not sure what it does, but add it anyways

{
Trig_FactDoor_01 waittill ("Trigger"); //Tells the trigger to wait until activated before performing next actions
FactDoor_01 rotateto ((0, 0, 90), 1); // This will make the door rotate 90 degrees on its Z-Axis from its origin (the 1 is seconds)
FactDoor_01 waittill ("rotatedone"); //Tells the script to wait until the rotation is completed
wait (5); //Tells the script to pause
FactDoor_01 rotateto ((0, 0, 0), 1); //Rotates door back to original position
FactDoor_01 waittill ("rotatedone"); //Tells the script to wait for the rotation
}
}

Now save that as "<mapname>_doors.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...
main()
{
ambientPlay("ambient_mp_carentan"); //Background Noise

maps\mp\_load::main();
maps\mp\<mapname>_doors::main(); //Loads the doors 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
Now, I believe that is complete. I will provide a test map file soon.

More help from this tutorial (where I learnt this) - Here
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

Guest

Post by Guest » August 7th, 2005, 7:24 pm

thanks alot for that :D
Most helpful, it was handy to actually see what u meant.

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

Post by Drofder2004 » August 7th, 2005, 7:48 pm

Ok, the code above is not actually working, but I have got it working. Once I finish my PCW starting in 10 minutes. :D
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

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

Post by Drofder2004 » August 7th, 2005, 9:56 pm

Take a look into this...
http://rapidshare.de/files/3753558/maps.rar.html

I think it may be to do with the caps.. use all lowercase.

Just Noticed your code here...
Main ()
{
thread hidden_door;
}


Main ()
{
thread hidden_door ();
}
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

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

Post by Drofder2004 » August 8th, 2005, 12:32 am

killersamuk wrote:Thanks again, ill make that alteration and see if it fixes the doors. I found an alternative hidden entry into my secret place ( an invisible bridge across water with a hurt trigger). I will however use the door inside my building. Thanks for all your help. :D. I like the way the hand icon pop ups when u enter the trigger area. Is that sometimes refered to as a hint? Peds was right, you know everything about mapping.

I hate to leave you with another question but, Custom Textures.
I read the tut's on modsonline. I have a .tga pic and a dds pic (both the same) one is simply called sigpic (the .tga) and the other wood@sigpic (the .dds). I select the .TGA texture in radient and it shows the picture applied to the brush as i would like it to be seen in the map. When i select the .DDS it shows little purple coloured squares tilled all over the brush. In the texture section (the bit that lets you preview the textures) the .tga shows fine and .dds shows as a little purple square. In game the .dds shows as a black grid and .tga shows as just grey.
Do you know where i am going wrong?
Post another thread, and also uplaod your textures, and Ill test them.

BTW, you can add a little message that appear beneaths the hand.

Key - hintstring
Value - <Hint>
replace Hint with whatever you like :)

(You can change the symbol of the hand only in SP I think)
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

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

Post by Drofder2004 » August 8th, 2005, 1:48 pm

killersamuk wrote:new thread created drofder.
Have you got the script working though?

Check the link I privded a few posts up (maps.rar). It has a working door... check all the entities in radiant and compare them to what I used in the script.

Also, if you get a "script compile error", open the console and scroll up. You will have an error saying what line the error is on and in what gsc.
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

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

Post by Drofder2004 » August 8th, 2005, 4:08 pm

Cool, 2 problems solved... ;)
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

Post Reply

Who is online

Users browsing this forum: No registered users and 31 guests