I will try and go in as much detail as I can, but if there is still something you dont understand, X-Fire me at nightmare377.
56K Beware, There are a few of pics.
Ok, so for the Intro:
Well you want to make a moving platform? Its simple. Here are the simple and easy steps on how to make one.
First we are going to call this map: platform (Keep it simple for less confusion)
Simple Platform Movment
For our first platform, we will make a very simple 64 X 64 unit platform move back and forth between two ledges.
So First, Make two ledges and put a 64 X 64 platform on one side of the platforms over the gap.
The selected brush is the platform and it will move up and down along the Y Axis. Remeber this because it will be a big help in the scripting after wards.
Now onto the naming part:
How to name your Platform
To name your platform, it is really simple. Select the Platform Brush and right click it on the 2d grid. Now go all the way down to the Section: Script and Click on BrushModel.
The outline of your platform on the 2d Grid should turn in blue.
Now press N to bring up the entities and type in the following
Key:targetname
Value:platform1
and press enter.
Thats all for your mapping, Compile and lets head onto the scripting.
Scripting
So first what we will do is have our two folders ready: The maps/mp and the mp folder.
Add the .bsp filein the maps/mp folder and the .arena to the mp.
Now go back to the maps/mp folder, because we will be spending alot of time in there.
First, make a notepad and name it platform, then inside the txt put in this script
Code: Select all
main()
{
maps\mp\_load::main();
maps\mp\platform1::main();
maps\mp\platform2::main();
}
But first save the txt and rename the end as a .gsc instead of a .txt, so you should have platform.gsc
Scripting the First Platform
Now that we have our bsp and main runner, its time to add our first movment script.
As you recall, we named the platform "platform1". So now we will add a new notpad in the maps/mp folder that will be called platform1.
In this notepad put in the following:
Code: Select all
main()
{
thread platform1();
}
platform1()
{
platform = getent ("platform1","targetname");
while(1)
{
platform moveY (208,2,0.5,0.5);
wait(5);
platform moveY (-208,2,0.5,0.5);
platform waittill ("movedone");
}
}
So now that you have that copy and pasted save that as a gsc as I showed you earlier and thats it!
Adding Triggers
Ok so now we will go on to the fun stuff; adding triggers.
The script will be alittle more complicated but it will give a better and more controlled effect.
So lets go back to our platform.map and add two more platforms and a moving script/brushmodel platform just like I showed you earlier.
BUT! Watch out when naming the platform again, make sure you dont name it platform1.
Instead we will name it
Key:targetname
Value:platform2
Now this time we will make a Trigger just in front of the platform. Make it 64 by 64 units big and 72 units high.
Right click on the selected trigger and select: trigger/multiple
Now Press N again to bring up the entities and type in these names;
Key:targetname
Value:trig_platform
Here is what you map should look like:
Ok, so now lets compile and go back to the scripting:
Scripting a Triggered Platform
Ok so now you have the mapping done for both a platform and a platform with a trigger, before you run off to test everything, you have to now script in the Triggered platform.
This is where that maps\mp\platform2::main(); line comes into play;
Make a new notepad beside your bsp and two gscs in your maps/mp folder, and name it platform2
Now inside put in this script I will only explain the new commands in the picture:
Code: Select all
main()
{
thread platform2();
}
platform2()
{
platform = getent ("platform2","targetname");
trigger = getent ("trig_platform","targetname");
while(1)
{
trigger waittill ("trigger");
wait(2);
platform moveY (208,2,0.5,0.5);
wait(5);
platform moveY (-208,2,0.5,0.5);
platform waittill ("movedone");
}
}
Now save and turn this txt into a gsc
So what you should have in your maps/mp is this:
So just turn all that into a pk3 and Congrats! You have just made a moving platform with and without a trigger!!!
I am also putting a zip at the bottom for those who dont understand or is missing something, in the zip is the pk3 and the map file.
http://s42.yousendit.com/d.aspx?id=3VC5 ... O35DUCM085
Well, I hope this Tut helped anyone out, I will try to come with some more tuts later!
Made By Nightmare