Last 5 Pages Viewed:
Editing
Mission Builder
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Waypoints, Checkpoints and Spawn Areas === There are three types of object we need to add for the race track to work. There will not be visible in the game, but control the logic of the race. Waypoints tell the AI where to drive, checkpints make sure players drive around the track correctly, and spawn points tell the game where the cars should be placed at the start of the race. We'll start with spawn points, but first we need to quickly cover SimGroups. ==== SimGroups ==== '''SimGroups''' are just containers that you can put other objects in. Sometimes they're necessary (as we'll see for spawn points) and sometimes they're just a way of keeping your object list tidy. You can find them at the very bottom of the list of objects, under '''System'''. When you create one you'll be asked to give it a name, but it won't appear in the mission, it just exists in the tree view. They're also a pain to delete, so try not to create more than you need. Create one now to store some objects you created. When it appears in the tree view, alt-click on it and the background will change colour. This is now your active '''SimGroup''', and any new objects (including other simgroups) will be created inside it. To stop that, just alt-click on ''MissionGroup'', which is your main '''SimGroup''' which stores the whole scene. A highlighted '''SimGroup''' looks like this: [[File:MB_Screen12.jpg]] I've created a '''SimGroup''' called ''PitBarriers'' to hold the barriers around the pit (imaginative, huh?) and highlighted it. If I create a new object it will be added to that group, or I can add all the barriers by selecting them (ctrl-click for multiple selection) and choosing '''Add Selection to Instant Group''' from the '''World''' menu. Now if I select the simgroup I can move, rotate or scale all the barriers at once. OK, that's enough about simgroups for now, on to the interesting part. ==== Spawn Areas ==== First, create a '''SimGroup''' called ''PlayerDropPoints'' to hold all the spawn points (don't forget to make ''MissionGroup'' active first). We're going to need 25, one for each car in a maxxed out race. With PlayerDropPoints set as your active group, create a '''SpawnSphereMarker''' (found in '''Shapes->Misc'''). What you get looks something like this: [[File:MB_Screen13.jpg]] It's too big, but we can fix that. Select '''World Editor Inspector''' from the '''Window''' menu. The bottom of the right hand bar looks like this: [[File:MB_Screen14.jpg]] I pressed '''Expand All''' so you can see everything. This mode lets you manually set positions, rotations, scales and other attributes of objects. You need to press '''Apply''' after every change or it'll lose your edits. In this case, we want to change the radius down to something sensible. Set it to two then hit apply, you should see something like this: [[File:MB_Screen15.jpg]] Much more sensible. The box next to apply is for naming your spawn points. Call this one spawn1. This is where the car in pole position will spawn. The y axis shows the direction it will be facing. Couple of useful tips here - copy and paste will make it much less painful to do the other 24, and ctrl-D will drop the object, making it sit on the ground. Useful if you end up with a spawn point in mid air. Now go ahead and create the other 24. The finished product should look something like this: [[File:MB_Screen16.jpg]] I'm pretty sure it's the order of points in the container which determines which car goes where rather than the name, so it's less confusing if you keep the two the same. ==== Checkpoints ==== The number of checkpoints you need depends on the details of your track. You need enough to make sure the drivers don't take any shortcuts, or at least not ones you haven't planned. More is usually better if you're not sure. Checkpoints are '''Trigger''' objects of the type '''CheckPointTrigger'''. You can find them in '''Mission Objects->Mission''', and creating one gets you a popup like this: [[File:MB_Screen17.jpg]] Pressing the button allows you to select the type of trigger. You can call it whatever you want, but I'm just going to call mine checkpoint1. This will be the first checkpoint ''after'' the start/finish line. Hitting OK will get you a tiny yellow box. You need to resize this to go across your track - the controls are the same as for other objects. Make sure you cover the whole track out as far as someone could legitimately drift. It also needs to be set into the ground, and go high enough to catch jumps. Mine looks like this: [[File:MB_Screen18.jpg]] I decided to extend it a long way out to the right, in case someone drifts up there by mistake. It's set inside the barrier on the left. The actual checkpoint is the angled red cuboid here - the yellow box is just a bounding box, it's the inner one cars will use. Now we just need to add a couple of parameters to the object. In '''World Editor Inspector''' mode you can use the '''Add''' button next to '''Dynamic Fields''' to create new parameters. These are name/value pairs. Create one called ''isLast'' with a value of zero, and one called ''checkpoint'' with a value of one. The result should look like this: [[File:MB_Screen19.jpg]] The ''checkpoint'' value sets the order cars have to pass through the checkpoints, and ''isLast'' sets whether going through the checkpoint ends a lap. You should now be able to go round and create all the checkpoints for your track. Make sure the last one is properly lined up with the finish line, and set isLast to 1. Important point - copying and pasting a trigger will sometimes leave you with the previous object selected instead of the new one. Make sure you know what you're editing the name of! ==== Waypoints ==== OK, this is the tricky bit. Waypoints tell the AI how to drive around the track - where they should turn and what speed they should be going. They're hard to get right, particularly because it's nearly impossible to test them in the editor - the physics is just too different. Still, you can at least test that the car tries to go around the track, even if it can't quite manage it. Waypoints are grouped together into Car Paths. As this is a race track, we only need one. Wilderness maps need more, to cover every major route. To create one, go to '''Mission Objects->Mission''', and create a '''Path'''. Name it ''CarPath''. Now make this the active group (alt-click), and you're ready to add waypoints. Waypoints are '''PathMarker'''s, found just below the path object. Create one and scale it up a bit, and it should look like this: [[File:MB Screen20.jpg]] One important point with waypoints - never ever rotate them. It doesn't do anything, but the collision shape will rotate, so your track doesn't behave the way you expect. You will need to add one dynamic field to the marker. Call it ''speed''. This is the speed in metres per second the AI will try to be going when it hits this waypoint. Sam's rule of thumb: "I use 200 for a waypoint you can take flat-out, maybe 40 for ones that can almost be done flat-out, and anything down to about 20 or 25 for tighter corners". The sequence number sets the order of the waypoints. It should sort itself out automatically, but you may need to edit it if you play around with the order or something. Now try creating another waypoint. You should see a line between them, something like this: [[File:MB Screen21.jpg]] This isn't exactly the path the cars will take, but it's a useful confirmation that you've got the points in the right order. Now you should be able to add all the waypoints you need for your track. As with checkpoints, more is better. Inserting extras in the middle of the order is difficult, so it's better to have too many than too few. The finished version of my carpath looks like this: [[File:MB Screen22.jpg]] Now you'll want to test your track. To do this, you'll need the following file: [[http://www.filedropper.com/bugfix bug fix]] This makes the AI cars work in race mode, without it they only work in wilderness maps. Unzip the file and put it in the darkwind/server/scripts folder in the mission builder. You'll need to restart the mission builder too. Now load up your track, drive your car a little out of the way, enter editing mode, and press 1. An AI car should spawn and drive around the track. They're not too bright and the physics isn't too good but if it makes it to the finish line with only a couple of helping nudges I generally consider the waypoints good.
Summary:
Please note that all contributions to Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Request account
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
New Player Info
Community portal
Current events
Recent changes
Random page
Help
Guides
New Player Startup
Initial Scout Guide
Tools
What links here
Related changes
Special pages
Page information
external links
DW Main Site
DW Facebook Group
DW Players Map