The MUD Connector

Mud Development and Administration => Builder's Forum => Topic started by: Panchy on January 17, 2017, 5:49 PM

Title: Is it possible to build a room to view fights in another room in SMAUG?
Post by: Panchy on January 17, 2017, 5:49 PM
On a game I work on I trying to figure out how to make a room to view fights in without players having a chance to interfere in the fight and possibly heal a fighter. Is this possible at all in the SMAUG/DBS/SWR codebase?
Title: Re: Is it possible to build a room to view fights in another room in SMAUG?
Post by: Epilogy on January 18, 2017, 12:27 AM
I imagine so.

I'm not a coder... but I'd look at how the imm command snoop works, and try to adapt that somehow.
Title: Re: Is it possible to build a room to view fights in another room in SMAUG?
Post by: Dokkar on January 18, 2017, 1:43 AM
I know it's possible in ROM.  And Smaug is close-ish...(I think?) so it should be doable.
Title: Re: Is it possible to build a room to view fights in another room in SMAUG?
Post by: Quixadhal on January 18, 2017, 5:57 AM
Of course it's possible.  How much effort do you want to put into it?
Title: Re: Is it possible to build a room to view fights in another room in SMAUG?
Post by: RahjIII on January 18, 2017, 10:34 AM
If you are just trying to 'televise' what goes on in one room into another room, you could try adding a 'sends to room X' field or list onto your room structure, then patch act() so that when it is called with TO_ROOM and it sees a linked room, it also sends a copy of the act message to the players in the linked room.

Alternatively, if you are ok with only televising into adjacent rooms, you could add a new door flag for act() to consider when it is called with TO_ROOM.

You might want to patch your do_look routine to make use of whatever mechanism you choose, in case you want your viewers to be able to look directly at the combatants.
Title: Re: Is it possible to build a room to view fights in another room in SMAUG?
Post by: Hades_Kane on January 18, 2017, 3:54 PM
We did it in ROM fairly easy.

We created an item type that works as a one way or two way, audio, visual, or both, and whether it was the source or target object type to broadcast according to the values, and it was as simple as putting a check in act or send_to_char and related functions to check the room for a source, and if found, check for its target and clone the output to that room.
Title: Re: Is it possible to build a room to view fights in another room in SMAUG?
Post by: Drizzt1216 on March 18, 2017, 2:51 PM
Of course it's possible.  How much effort do you want to put into it?

Optimally less effort than it takes to view or respond to an old thread I made.

Oh wait....
Title: Re: Is it possible to build a room to view fights in another room in SMAUG?
Post by: Quixadhal on March 18, 2017, 4:48 PM
It kinda depends on your game design.  In an LPMUD, rooms usually have an event that fires whenever something happens, so you'd just hook into those events and do them to that room + another target room.

In a DikuMUD, every bit of code usually does its own printing to the players.  So, you'd have to add if() checks to every bit of code that would output to the players to check for a non-empty target room, and have it also mirror to that room's players.

Printing to a room is easy, trapping all instances of things printing to a room is more annoying.
Title: Re: Is it possible to build a room to view fights in another room in SMAUG?
Post by: Ateraan on March 18, 2017, 5:04 PM
On a game I work on I trying to figure out how to make a room to view fights in without players having a chance to interfere in the fight and possibly heal a fighter. Is this possible at all in the SMAUG/DBS/SWR codebase?
We do this kind of thing on Ateraan with Arena fight viewing from the stands and Leather ball tourneys where you watch the action from the stands.

What I've found, however, depending on your base broadcasting code, you may have to identify what you want the viewer to see and not to see. I don't advise using snoop code as this is low level and might not provide the results you are seeking.
Title: Re: Is it possible to build a room to view fights in another room in SMAUG?
Post by: AdventuresWithJ on May 16, 2018, 7:37 AM
We have this on the mud i'm active on (Erion). There's a place called "monster colosseum" and you fight monsters, 1 v 1 , progressively for 20 rounds. There is a viewing area for other players to come and watch. Killing each gives you a token you redeem for gear/runes (stat boosting on eq)


On a game I work on I trying to figure out how to make a room to view fights in without players having a chance to interfere in the fight and possibly heal a fighter. Is this possible at all in the SMAUG/DBS/SWR codebase?