Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 74 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Tutorials

»
CoD4 Mapping
ratings:
Awful Rating
Poor Rating
Average Rating
Good Rating
Excellent Rating
How to Make the player open door and not close again [Singleplayer]
Versions: You must be logged in to view history.

This tutorial shows mappers how to make a door be opened by player once and never close again.

Well assuming you know the  basics of Radiant and a little bit script and how to set up a single singleplayer map then you're good.

 

First Step:

Open Radiant and make a wall then a hole in it like a door gap and then a brush that will be your door.

then go to textures>usage>tools

and make a brush with the origin texture as tall as the door and place it where the door is touching one of the two side walls 

now select both and then press (on the 2D window) right click > script > brushmodel

then your door is now a brushmodel. That means that you can manipulate it in script.

Now select the Door and the origin and press "N" then a window will pop up.

In that window you will give the door a "Targetname" with wich you will be able to call the door in script.

Now where it says Key, type: targetname (then press ENTER)

and where it says value, type: door (then press ENTER)

 

Second Step:

right next to the door, on the side where the player will open it, right click on 2D window i trigger >use_touch

now place the trigger next to the door  like this

now select the trigger press "N"

and set a key: targetname (then press ENTER)

and a value: door_trigg (then press ENTER)

 

Third Step:(Optional)

If you want an AI to be able to come with you trough the door do this.

Place the Actor in the side the player is.

Select the Door, press "N" and click where you see a box (DYNAMICPATH)

good now place some node in both sides of the door (make sure that the nodes will not be far from each other but not too close)-(about 1 meter)(in radiant grid 128max distance)

place a node_balcony on the other side of the door by pressing right click on 2D grid and click node>balcony

now give a key and a value

key: targetname (then press ENTER)

value: node_one (then press ENTER)

Now select your actor and give him key and value

key: targetname (then press ENTER)

value: guy (then press ENTER)

 

 

Fourth Step: 

(assuming you did the rest so the map is ready For compile (lights, reflection_probes, lightgrid) we continue)

We need some script to make the whole thing work.

Go in your games COD 4 directory go on foilder: COD4GAMEFOILDER>raw>maps

and there create a txt file named as: yourmapname.gsc

(yourmapname can be any name you want but it has to be the same as the .map in radiant)

open the gsc files with notepad (or an other program that you need to download called:Programmers Notepad)-really useful tool

open your file and add these lines in the gsc file (contains the AI movement)

--------------from now on --------------------------(do not copy this line)copy below

#include maps_utility;
main()

{

maps_load::main();

thread door();

}
door()

{

 door = getent("door", "targetname"); //finds the door

 door_trigg = getent("door_trigg", "targetname"); //finds the tirgger

guy = getent("guy", "targetname"); //finds the actor

node_one = getnode("node", "targetname"); //finds the node

door_trigg sethintstring( &"PRESS_THE_USE_KEY_TO_OPEN_DOOR" ); //make a text to pop up when player touches trigger

 door_trigg waittill("trigger");  //script will wait untill trigger is activated

door_trigg delete(); //deletes the trigger

door ConnectPaths();//makes door be not and obstacle between the nodes that the AI will follow

door rotateYaw( 120, 3, 0.5, 2 );//makes the door move

guy setgoalnode(node_one);// makes Actor go to node

}

--------------End--------------------------(do not copy this line)copy above

Save, compile and now you have your door


 

 

 

 

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»