How Would You Create This Room?

  • Matt
  • Matt's Avatar Topic Author
  • Offline
  • Gold Boarder
  • Gold Boarder
More
6 months 1 week ago #6513 by Matt
Matt created the topic: How Would You Create This Room?
So this is a bit of a creative thinking challenge. I would love to hear peoples ideas about how to build the following room.

It is a room from 'The Wishing Well', a Fighting Fantasy RPG from when I was a kid (remember those pick a patch style books?). Here is the room description as it appears in the book:

As you open the door, you see a circular room more than five metres across.
There is no floor in front of the door, only a metre wide walkway protruding two or some metres into the void.
Only darkness can be seen below.
Another similar walkway protrudes from the northern wall, next to the only exit from the room.

The distance between the ends of the walkways is about 1.5m, and so may be jumped, although this is difficult.
Any Hero may test his SKILL (and may include the Jump special skill) to see if he can jump the gap.
A failure means that the Hero falls into the pit…..only to reappear from overhead 2 minutes later, still falling.
This will be repeated until his co-adventurers find some way of rescuing him from his never ending fall.


I am looking for ways of reproducing this in tbaMUD.

Triggers / SpecProcs / coding changes all welcome! How would you go about it?

Please Log in or Create an account to join the conversation.

More
5 months 3 weeks ago #6550 by Parna
Parna replied the topic: How Would You Create This Room?
I'd do it by triggers. The room itself has two exits; back and down. There are one or two triggers.

The room desc is pretty much what you've written here except I would make small changes to things like "you see" (yeah, I'm one of THOSE). I'd upper-case jump and lower-case SKILL.

The first trigger is for command jump. Here's an example of a room command trigger for anyone reading this who is not used to command triggers. This trigger can work in two ways depending on if you have a jump skill or not. The jump social will not work here! If you have the skill, you need to do a skillcheck by comparing the skill level against your desired skill. If not, then it would be a luck thing using a random generated number. Your desired skill will be based on how difficult you really want the jump to be. This case looks like > 8. < 8 would be a very easy hop. < 5 would be medium (50% chance). The command argument would have to be n or north. If the player really wants to jump east, that would be the same as a fail. You'd need a section of the trigger for the fail (which could also be used for any movements other than jumping north). This would be an endless fall by moving down into the same room. Preferably this should have the ability to be rescued or to recall.

The potential second trigger is for muds that don't have a jump command but don't want to use luck. You can trigger a counter and add 1 after every failed jump and possibly add 2 after every successful jump. This would only be helpful if you are expecting the player to enter the room various times. The more often the player jumps, the easier the jump will become.

Please Log in or Create an account to join the conversation.

  • Matt
  • Matt's Avatar Topic Author
  • Offline
  • Gold Boarder
  • Gold Boarder
More
5 months 3 weeks ago #6556 by Matt
Matt replied the topic: How Would You Create This Room?
Agree on the descriptions, no 'you see' or 'you feel' - a good builder will make that happen with proper writing :D

Your second trigger idea got me thinking about the player variables options... and I think that is definitely the clever way to achieve this. Here's what I have so far:
#1008
Pit Entry Set Direction~
2 g 100
~
set t_1007_entry_direction %direction%
remote t_1007_entry_direction %actor.id%
~
This is a room entry trigger and it sets the variable t_1007_entry_direction onto the player. (1007 is the room vnum in this case). This can be referenced later to find out which door the player entered by, and therefore which side of the pit they are on.
#1007
Pit Jump~
2 c 100
jump~
if %actor.varexists(t_1007_entry_direction)%
   extract dir 1 %actor.t_1007_entry_direction%
   if %dir% == east
     %send% %actor% You leap across to the northern side!
     %teleport% %actor% 1010
   else 
    %send% %actor% You leap across to the eastern side!
    %teleport% %actor% 1006
   end
   %force% %actor% look
   nop %actor.wait(1)%
else
   %send% %actor% No entry direction set!
end
~
This is the jump command. It looks for the t_1007_entry_direction to determine which way the player came in. If they came in from the east, jumping would send them over the pit and north. And the reverse of this if they came in from the north.

That works nicely. It also stops a player jumping the same way they came from, which would be a bit odd. Next is to add a skill check of some sort with a random number call, which is easy.

How about the falling part?
I have thought about coding in gravity of some sort, for example a new room flag ROOM_GRAVITY. When a player or object enters such a room it would create a mud_event that moves players/objects one room down..
As a bonus you could use this code over and over for cliffs, pits, empty elevator shafts, falling through atmosphere...
Or is it a bit overkill?
Is there a simpler trigger solution to create the falling effect?

Please Log in or Create an account to join the conversation.

More
5 months 3 weeks ago #6562 by Parna
Parna replied the topic: How Would You Create This Room?
For the entry trigger, I used something similar in my park swan but I found it easier just to check the previous room rather than the direction. (Okay, after poring through pages of triggers I realize that I cheated and gave a different ticket for each side of the pond and just checked the vnums. However, the idea might still work. I don't know if its better, just an alternate idea.)

I hadn't thought how it would look to have someone jump north if they just came through the north door. However, it would amuse me to force a north with echos about the player jumping through the door and looking silly or embarrassed.

For the fall, I was expecting a down exit leading to the same room. However, I think a teleport back into the same room with a series of echos to show that the person is falling would work. However, as I write this I realize that the teleport isn't necessary. Only the echos are necessary.

I think in triggers rather than code. This is probably because I don't code, I only build. However, if you were to code in the gravity flag, would it be possible to change the title of the person to something like < falls slowly through the air> and to save the original title for when the person leaves the gravity room? Hmm, I could probably do this through triggers too though. If you're planning to use this in various places, coding is probably more efficient.

I've just realized. The purpose of the second trigger was to fake a skill which doesn't actually exist in the code. If your mud has no jump skill, you'd need to rely on luck or to fake a jump skill. Then you would make a player variable such as jump_skill. If the player has no jump_skill then jump_skill = 50. If the player has <100 he player jumps, oops, missed (you might want to use the random numbers anyways, just count in the skill) jump_skill = jump_skill + 1. The player succeeds, jump_skill = jump_skill + 2. This way, the more often you go through the room, the better you get at it until you're basically merrily whistling as you hop over that gap that used to seem so wide. Of course, since it's attached to the players profile, it can be used in different triggers in different zones.

The part that you called the second trigger was actually the second half of the first trigger but you're right there. It needs it's own trigger or else it will be eating at the room and preventing anything else happening. I had this problem where I couldn't see how to trigger the fall from the jump but I'm sure there would be ways of doing it like having the fall trigger triggered by movement downwards and dealing with any failed jumps by forcing the player to walk down.

Please Log in or Create an account to join the conversation.

Time to create page: 1.203 seconds