Desolated - The Crying Fate is a Total Conversion based on Doom 3. It comes with a complete new storyline about the shade between good and evil plus two other gamemodes. A quest-, rpg- and moneysystem are just a few of the many new game mechanics that will await you. If you want to see everything you'll need at least 7-8 hours... but let the game speak for itself, download and have fun playing!

Post tutorial Report RSS Scripting a Bridge in Doom 3 (built out of stones from a wall)

This is a tutorial for Doom 3 on how to script a bridge building itself using scripted events.

Posted by on - Intermediate Mapping/Technical

Before you try this tutorial you should know the basics about the Doom 3 Radiant like building brushes, creating entities and texturing. And then we can get started...

First of all create a room with 2 plattforms (remember this is just a test map) and a skybox around em. Now choose one plattform and place an info_player_start on it. If you're done, it could look like this:


Once we got this down place a wall using a texture you like, I used "cbrick2c2" from the hell-texture folder. The good thing about this is, the pieces of the wall fit to the grid so it's easy to split the wall which is the next step. So split it into 11 pieces:


Next use the smallest grid (okay, grid of 1 shall be enough) and make a func_mover out of every piece. The small grid is important to get the center in the middle of that stone piece (I'll explain later why).


Now create eleven similar brushes with the exact size of the stones you already built. Those will be the places the mover will move to... then give em a "nodraw" texture (you'll find that in the common folder) and make a func_static out of every piece (using the smallest grid). Now why do you have to use the smallest grid? That's easy, cause if you don't it might happen Doom 3 is creating the center not completely in the middle of the entity. This might cause that the mover doesn't move to the exact point where the func_static is placed. Mostly there's no problem with it, but if you like to script a floor where every mover should be exact next to the other it might cause issues which are hard to fix.
But now you created 11 func_movers (1 to 11) and 11 func_statics (1 to 11):


I have selected all func_statics and rotated them by 180 degrees, so that the stone on top (func_mover_1) will move to the func_static on the second plattform (will look much cooler).

Now you gonna create a trigger_once and a trigger_relay. After creating select the trigger_once, then the trigger_relay and press ctrl+k.


Give that trigger_relay now the key "call" with the value "bridge", this is the script which will be called when moving through the trigger_once.

Now we're done on the radiant, go to your map folder where your map is placed and create a txt-file named out of your mapname and the ending script -> "mapname".script , in this case called "script.script\".


Now open it up:


Now we need 11 stages to make every func_mover move to it's func_static destination. So lets get started with the script itself you see above:

First of all type in "void bridge()". You remember, in the map we let the trigger_relay call "bridge" which is definied within this small line. Be careful: every call key you set calls the void xxx IN the script file, not the script file itself!
Now press enter and use "{" to initial the actions, don't forget to close it with a "}" at the end! Now it's time for the real actions to place between those both brackets.

Now type in the first thing (explanation within):

$func_mocer_1.time(2); // set the time how long the mover will need for moving
$func_mocer_1.decelTime (0.5); // how long it will take to get full speed
$func_mocer_1.accelTime (0.5); // how long it will take to make it stop
$func_mocer_1.moveTo ($func_static_1); // sais where to move the mover to

sys.wait(0.5); // time to wait before the next action in seconds

Now copy this 10 times and replace the numbers, func_mover_1 to func_mover_2 and so on, also don't forget to change the numbers of the func_statics as well. Finally it should look like on the image above.


Now save it and as a little explanation: the script tells the func_movers to get to the func_statics kinda like in the screen above.

Now compile your map and save it. Go into Doom 3 and type "map 'mapname' , in this case map script, and here we go.


As soon as you go through the place where the trigger_once is the stones will build a bridge:


If there's any problem tell me. Also here's a downloadable version of the map, simply extract it to your maps folder:

Moddb.com

So that's it, you did your first scripted bridge in Doom 3.

Dave

Post comment Comments
Jam3s007
Jam3s007 - - 1,217 comments

Good tutorial, i've always loved the bridge effect in D3 where the parts of the walls make the bridge itself.

Reply Good karma Bad karma+4 votes
TheHappyFriar
TheHappyFriar - - 518 comments

Another way to do this instead of using the target entities is to use one target entity & then keep moving it to new locations (maybe on a spline) & then using the new origin for each successive block location. Why? there's an entity limit. If you remove your target entities you can have (in theory) 2x as many more blocks! :D

Reply Good karma Bad karma+3 votes
SWORDLION
SWORDLION - - 26 comments

Entity limit? The limit is 4096 I think no one can pass the limit

Reply Good karma Bad karma+1 vote
ShadowsRage
ShadowsRage - - 33 comments

Awesome tutorial keep it up!

Reply Good karma Bad karma+2 votes
jesusmora
jesusmora - - 131 comments

very useful tutorial

Reply Good karma Bad karma+2 votes
razvanab
razvanab - - 12 comments

How can i make the func_mover_1 to go first to func_static_x then func_static_1 ?

Thank You ?

Reply Good karma Bad karma+2 votes
gamehacker
gamehacker - - 552 comments

Just came across this after getting the Doom3Edit Ultimate tutorial
I will be going through this one today myself as well

I see TheHappyFriar has already been here, must of missed his post about this a few years back on EarthQuake.fuzzylogicinc.com :P

Keep the tutorials coming Dave :)

Reply Good karma Bad karma+2 votes
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: