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!

Report article RSS Feed 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 DaveTheFreak on Aug 9th, 2009
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
pvt.Johnson
pvt.Johnson Aug 10 2009, 9:26am says:

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

+3 votes     reply to comment
TheHappyFriar
TheHappyFriar Aug 10 2009, 4:07pm says:

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

+2 votes     reply to comment
Danboe
Danboe Aug 11 2009, 10:19am says:

Sweet.

+2 votes     reply to comment
ShadowsRage
ShadowsRage Feb 11 2010, 8:17pm says:

Awesome tutorial keep it up!

+1 vote     reply to comment
jesusmora
jesusmora Nov 13 2010, 3:20pm says:

very useful tutorial

+1 vote     reply to comment
razvanab
razvanab Feb 4 2012, 8:57am says:

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

Thank You ?

+1 vote     reply to comment
Post a Comment
click to sign in

You are not logged in, your comment will be anonymous unless you join the community today (totally free - or sign in with your social account on the right) which we encourage all contributors to do.

2000 characters limit; HTML formatting and smileys are not supported - text only

Icon
Doom III Icon
Platform
Windows
Game
Doom III
Developed By
DaveTheFreak
Contact
Send Message
Official Page
Davethefreak.com
Release Date
Released Nov 21, 2013
Mod Watch
Track this mod
Tutorial
Browse
Tutorials
Report Abuse
Report article
Related Mods
Desolated - The Crying Fate (Doom III)
Desolated - The Crying Fate Doom III - Single Player First Person Shooter
Related Games
Doom III
Doom III Single & Multiplayer First Person Shooter