Difference between revisions of "Manual:Zone Manual/The Room Section/Climbing"

From DikuMUD Wiki
Jump to navigation Jump to search
(Created page with "= Climbing = This section describes how to implement the climbing skill in a room. Firstly, if you want a direction to be climbable, set the EX_CLIMB flag on the exist in qu...")
 
(checked against the current code (wiki review 2026-11-15))
 
Line 1: Line 1:
 
= Climbing =
 
= Climbing =
  
−
This section describes how to implement the climbing skill in a room.
+
Some ways can't be walked, only climbed: a cliff, a rope, a tree, a steep wall. This page shows how to make such an exit, and what happens to a player who fails the climb. The <code>climb</code> command itself is in <code>basemove.zon</code>; for the player's side see [[Help/Climb|help climb]].
  
−
Firstly, if you want a direction to be climbable, set the EX_CLIMB flag on the exist in question.
+
== A climbable exit ==
 +
Set <code>EX_CLIMB</code> on the exit, and give it a <code>difficulty</code>:
 +
<pre>
 +
up open {EX_CLIMB} difficulty 25 to ledge;
 +
</pre>
 +
A player who just types <code>up</code> gets "Alas, you must climb to go that way."; they have to type <code>climb up</code> (or <code>climb</code> and one of the exit's keywords). A climb costs 6 endurance, and a player needs at least 10 to try. NPCs that walk can't use the exit either.
  
−
  down open {EX_CLIMB} difficulty 0 to sew_ent@udsewer;
+
<code>difficulty</code> (0 to 250, default 0) is how hard the climb is: the player's climbing skill and dexterity are checked against it (see [[Manual:Game_Mechanics/Skills|Skills]]). Being drunk makes it harder.
  
−
Also note that you can specify how difficult a skill check is needed for the climb.  
+
== Falling ==
 +
A player who fails the climb falls. Where to depends on the room they are climbing from:
 +
* If the room has an exit with <code>EX_FALL_THIS_WAY</code>, they fall out through that exit into the next room. If that room has an <code>EX_FALL_THIS_WAY</code> exit too, they keep falling, room after room, until they reach a room without one (or the exit is closed, or would lead back to where the fall began). There they land "with a loud splat".
 +
* If it has none, they fall where they are and land in the same room.
 +
While falling a player can't do anything else.
  
−
You can also define which way you fall if you fail your climb. You do this by adding the EX_FALL_THIS_WAY:
+
So on a cliff you put <code>EX_FALL_THIS_WAY</code> on the way down, in every room on the cliff:
 +
<pre>
 +
ledge
 +
title "On a narrow ledge"
 +
descr
 +
"The ledge is barely wide enough to stand on. The cliff goes on up, and
 +
far below you can see the beach."
 +
movement SECT_MOUNTAIN
  
−
  down open {EX_CLIMB, EX_FALL_THIS_WAY} difficulty 0 to sew_ent@udsewer;
+
up open {EX_CLIMB} difficulty 40 to cliff_top;
 +
down open {EX_CLIMB, EX_FALL_THIS_WAY} difficulty 25 to beach;
 +
end
 +
</pre>
 +
A player who fails to climb up from the ledge falls down to the beach, and so does one who fails to climb down. The climbing exits don't need to be the falling exit. A rope bridge across a pit:
 +
<pre>
 +
rope_bridge
 +
title "On a rope bridge"
 +
descr
 +
"A rope bridge sways over a deep pit. It goes on east and west."
  
−
This means that if you try to climb down and fail your skill check, then you will fall down. You could of course also have a room like this:
+
east open {EX_CLIMB} difficulty 10 to rope_east;
 +
west open {EX_CLIMB} difficulty 10 to rope_west;
 +
down open {EX_CLIMB, EX_FALL_THIS_WAY} difficulty 0 to the_pit;
 +
end
 +
</pre>
 +
Fail to climb east or west, and you fall down into the pit.
  
−
  east open {EX_CLIMB} difficulty 10 to rope-east;
+
== Damage ==
−
  west open {EX_CLIMB} difficulty 10 to rope-west;
+
The fall does its damage once, on landing. The worse the climb failed, the more it hurts: 5 hit points for every 10 points the skill check failed by. A room can change the 5 with an extra named <code>$climb_</code> and the direction, whose number is the damage per 10 points of failure:
−
  down open {EX_CLIMB, EX_FALL_THIS_WAY} difficulty 0 to thepit;
+
<pre>
 +
extra {"$climb_down"} {1} ""
 +
</pre>
 +
On the ledge above, this makes a failed climb down hurt only a fifth as much. The extra is read in the room the player climbs from, for the direction they climb in. <code>gremlin.zon</code> has a cliff built this way.
  
−
Which means if you fail climbing east or west, then you'll "fall this way" which is down.
+
== Leftovers ==
 +
* <code>climb@function</code> in <code>function.zon</code> is an older way of making climbable rooms. It no longer does anything; use <code>EX_CLIMB</code>.
 +
* The <code>CLIMB_NAMES_ONLY</code> and <code>CLIMB_NOT_IN_EXITS</code> flags described in <code>wmacros.h</code> belonged to it and are commented out.
  
−
When you fall it keeps checking if there are more fall_this_way bits. So you can keep falling through many rooms.
+
Back to [[Manual:Zone_Manual/The_Room_Section|The Room Section]].
−
 
 
−
The amount of damage you get is a function of how badly you miss your climb skill combined with the damage for climbing which defaults to 10.
 
−
You can adjust the damage offset like this:
 
−
 
 
−
  extra {"$climb_down"} {1} "" // Do only 1 damage, adjusted for skill failure
 
−
 
 
−
Only needed if you need to define a damage different from the default of 10.
 

Latest revision as of 06:20, 15 November 2026

Climbing

Some ways can't be walked, only climbed: a cliff, a rope, a tree, a steep wall. This page shows how to make such an exit, and what happens to a player who fails the climb. The climb command itself is in basemove.zon; for the player's side see help climb.

A climbable exit

Set EX_CLIMB on the exit, and give it a difficulty:

up open {EX_CLIMB} difficulty 25 to ledge;

A player who just types up gets "Alas, you must climb to go that way."; they have to type climb up (or climb and one of the exit's keywords). A climb costs 6 endurance, and a player needs at least 10 to try. NPCs that walk can't use the exit either.

difficulty (0 to 250, default 0) is how hard the climb is: the player's climbing skill and dexterity are checked against it (see Skills). Being drunk makes it harder.

Falling

A player who fails the climb falls. Where to depends on the room they are climbing from:

  • If the room has an exit with EX_FALL_THIS_WAY, they fall out through that exit into the next room. If that room has an EX_FALL_THIS_WAY exit too, they keep falling, room after room, until they reach a room without one (or the exit is closed, or would lead back to where the fall began). There they land "with a loud splat".
  • If it has none, they fall where they are and land in the same room.

While falling a player can't do anything else.

So on a cliff you put EX_FALL_THIS_WAY on the way down, in every room on the cliff:

ledge
title "On a narrow ledge"
descr
"The ledge is barely wide enough to stand on. The cliff goes on up, and
far below you can see the beach."
movement SECT_MOUNTAIN

up open {EX_CLIMB} difficulty 40 to cliff_top;
down open {EX_CLIMB, EX_FALL_THIS_WAY} difficulty 25 to beach;
end

A player who fails to climb up from the ledge falls down to the beach, and so does one who fails to climb down. The climbing exits don't need to be the falling exit. A rope bridge across a pit:

rope_bridge
title "On a rope bridge"
descr
"A rope bridge sways over a deep pit. It goes on east and west."

east open {EX_CLIMB} difficulty 10 to rope_east;
west open {EX_CLIMB} difficulty 10 to rope_west;
down open {EX_CLIMB, EX_FALL_THIS_WAY} difficulty 0 to the_pit;
end

Fail to climb east or west, and you fall down into the pit.

Damage

The fall does its damage once, on landing. The worse the climb failed, the more it hurts: 5 hit points for every 10 points the skill check failed by. A room can change the 5 with an extra named $climb_ and the direction, whose number is the damage per 10 points of failure:

extra {"$climb_down"} {1} ""

On the ledge above, this makes a failed climb down hurt only a fifth as much. The extra is read in the room the player climbs from, for the direction they climb in. gremlin.zon has a cliff built this way.

Leftovers

  • climb@function in function.zon is an older way of making climbable rooms. It no longer does anything; use EX_CLIMB.
  • The CLIMB_NAMES_ONLY and CLIMB_NOT_IN_EXITS flags described in wmacros.h belonged to it and are commented out.

Back to The Room Section.