Sign in to follow this  
Followers 0
atrX

[Tutorial] Mapping for Surf Mod

3 posts in this topic

Hi there!

Figured I should probably rewrite this guide so people can make maps if they want.

 

Prerequisites

  • Latest Local Play/Developer Build: Please login or register to see this link.  (once extracted, ignore the last line of the README.txt, as CoDScript is no longer up, simply run "Local Server.bat" and connect to the server using "Play Surf.bat")
  • Alternatively, set up a local server using the source code: Please login or register to see this link.  (Advised if you want to use newer developer features as the Developer Build is rarely updated, certainly not a requirement however)

 

Mapping

Making a surf map is relatively easy and requires no scripting if you keep it basic. Setting your map up to work with the mod relies heavily on the use of KVPs (key-value pairs) in Radiant. I'll go over all the necessary components first and then list any other things you can make use of.

Spawns

Surf makes use of regular mp_dm_spawn entities. You can place as many as you'd like, but you'll need at least 1.

ok89Q12.png

 

You can also provide a spectator point using an mp_global_intermission entity.

zRrDxf6.png

 

Start Zone

The start zone is required to know when to start the timer (it starts as soon as you leave this area). The start zone should be a trigger_multiple with the following KVP:

Please login or register to see this code.

ZtVNn1v.png

You should only ever have ONE start zone!

 

End Zone

The end zone is required to know when to stop the timer (it stops as soon as you enter this area), and thus finish the map. The end zone should be a trigger_multiple with the following KVP:

Please login or register to see this code.

c2GQOa2.png

You should only ever have ONE end zone!

 

Teleporters

Teleporters are used to teleport players around the map (e.g. when they finish a stage or when they fail a section of the map and need to be respawned somewhere). Teleporters consist of two components: triggers (the area you enter) and script_origins (where you'll be teleported to).

Generally your triggers will be of the type trigger_multiple, but any other type will also work. It depends on what you need. Every teleporter trigger should have the following KVP:

Please login or register to see this code.

Yx5rFJd.png

As you can see, the teleporter in this screenshot has another KVP:

Please login or register to see this code.

The target is the targetname of whatever script_origins are linked to this teleporter (thus, the places you'll be teleported to). You don't have to enter these manually, these will be automatically generated when we start adding script_origins and link them to the triggers.

Next we'll add a place for this trigger to teleport us to. To do this, we spawn a script_origin.

GsrO2yF.png

Now, to link this script origin to the trigger we made earlier, all you have to do is first select the trigger, then select the script_origin and then press W on the keyboard. This will automatically give the script_origin a generated targetname and give the trigger a target pointing to the script_origin.

You can link as many script_origins to as many triggers as you'd like, there is no limit on either. Beware that an entity can only have one targetname and one target, meaning that you can only link multiple script_origins and triggers together if they actually belong to the same group that will teleport to the same places.

 

Boosters (Incremental)

Incremental boosters will add predefined amounts to the player's velocity in a certain direction, speeding him up (or slowing him down in the case of negative values). To make a booster, make a trigger_multiple and give it the following KVPs:

Please login or register to see this code.

The target values, x, y and z, should be replaced with the desired speeds in the desired directions (you'll have to play around with these to find a value you like).

 

Boosters (Scaling)

Scaling boosters are made in the exact same way as incremental boosters (except for the targetname used). However, unlike incremental boosters, they multiply the player's velocity with the amounts defined.

Please login or register to see this code.

Using this, you can make a trigger that, for example, simply doubles a player's horizontal speed using:

Please login or register to see this code.

 

No-Hop Zones

A no-hop zone is an area in which bunny hopping is limited to speeds <= 320 (going above 320 will put your speed back to 280). These can be useful in case you want people to start your map (or stages) from a standstill. To create a no-hop zone you simply make a trigger_multiple covering the area you want and give it the following KVP:

Please login or register to see this code.

 

Scripting

Making a basic surf map requires practically no scripting. All you really need is this basic template:

Please login or register to see this code.

You can add much more if you'd like, but make sure your maps runs without a hitch and always test using developer 1! Maps with bad quality scripts will not be added to the official server as they can cause server hitches resulting in lag (which would be detrimental to the user experience as movement is entirely server-sided and thus suffers badly from lag spikes).

Functions exposed by the mod for use in your maps can be found here: Please login or register to see this link.

 

I will update this topic if any new features are ever added that you can take advantage of as a mapper.

Regards, atrX.

2 people like this

Share this post


Link to post
Share on other sites

Nice that the tutorial is back! B|

Dunno if you still have all the data of codscript, but I really liked your scripting tutorial you made back then. Did help me quite alot tbh :$

 

Also, is setGravity a thing with your serverversion?

Share this post


Link to post
Share on other sites
1 hour ago, xoxor4d0xzz said:

Nice that the tutorial is back! B|

Dunno if you still have all the data of codscript, but I really liked your scripting tutorial you made back then. Did help me quite alot tbh :$

It was kinda meh, dunno if I still have it somewhere. I'll check.

 

1 hour ago, xoxor4d0xzz said:

Also, is setGravity a thing with your serverversion?

Please login or register to see this link.

 

Edit: I found the old database with all the tutorials, let's see if they're worth reposting.

1 person likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0