Welcome to the Builder Academy

Question Echoes, Sleeping and Checks

More
03 Dec 2013 03:25 - 03 Dec 2013 14:22 #4553 by krell
I posted a bug to tba's bug list where I noticed that I saw a MOB's scripted echo's when my character was sleeping. Apparently Parna's work around is to employ "sleep checks" where sends aren't sent if the PC is sleeping. I don't know how this would apply to echoes sent to a room, but that's besides the point.

My question,are echoes supposed to be observed by the sleeping PC or MOB or is that an implementation error?

Thanks.
Last edit: 03 Dec 2013 14:22 by krell.

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

More
03 Dec 2013 21:05 #4555 by thomas
Replied by thomas on topic Echoes, Sleeping and Checks
echos are supposed to work even if sleeping.

Remember, you might have items like alarm clocks, effects like poison, etc.
To support this type of scenario, %echo% is meant to be filtered by the script writer.

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

More
03 Dec 2013 21:44 - 04 Dec 2013 05:34 #4557 by krell
Replied by krell on topic Echoes, Sleeping and Checks
I see. Thanks, I'll have to revise some of my scripts then. I might ask this question again in a couple of months so I'll try to save this post and save everyone the trouble. :-)

Addendum:
However 'help %echo%' reveals:

%echo% <message>
Message is sent to all non-sleeping characters in the same room that this
trigger is executing in.

If echo is supposed to be filtered by the script writer then the help file should probably reflect this. Furthermore, how do I not send echoes to sleeping characters? Would the following work, or would it only work for sends?

Code:
if %actor.pos% != sleeping %echo% %self.name% jumpsin the air and does a backflip! end

Addendmum 2:

It seems that 1) using that position as a condition has no effect on whether or not the echo is seen by the sleeping character and 2) using position as condition works for %send% %actor% <string> as long as %actor% has a determined value (which makes a lot of sense as %actor% is a variable).

So, unless my trigger targets everyone in the room, at least some of the !sleeping characters won't see the appropriate strings if there is more than one person in the room.

Thoughts? Concerns? Corrections?
Last edit: 04 Dec 2013 05:34 by krell.

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

More
07 Dec 2013 20:19 - 07 Dec 2013 20:19 #4558 by Rumble
Replied by Rumble on topic Echoes, Sleeping and Checks
Updated the help file. Let me know if you catch anything else. I also updated the trigger example to include a loop to check every character in the room to see if they are sleeping.
Code:
tstat 18 Name: 'Switch Echo Example', VNum: [ 18], RNum: [ 18] Trigger Intended Assignment: Rooms Trigger Type: Enter , Numeric Arg: 100, Arg list: None * By Rumble of The Builder Academy tbamud.com 9091 * Since this is an ENTER trigger we must put a wait in here * so it doesn't fire before the player enters the room wait 1 switch %random.4% case 1 * only the person (actor) entering the room will see this. %send% %actor% You trip over a root as you walk into the room. * everyone in the room except the actor will see this. %echoaround% %actor% %actor.name% trips on a root while walking into the room. * everyone in the room will see this. %echo% The root suddenly springs to life and attacks! * let everyone in the zone hear about this. %zoneecho% %self.vnum% %actor.name% is a clutz. break case 2 %send% %actor% You strut into the room. %echoaround% %actor% %actor.name% Seems to have a big head.. %echo% A strong breeze kicks some leaves up into the air. break case 3 %echo% A light breeze picks up, causing the leaves to rustle quietly. break case 4 * echoes go to everyone, even sleeping players. To prevent this try: set target_char %self.people% while %target_char% set tmp_target %target_char.next_in_room% if %target_char.pos% != sleeping %send% %target_char% You are not sleeping else %send% %target_char% You are sleeping end set target_char %tmp_target% done break default * this should be here, even if it's never reached %echo% This is the default case, just in case I missed something. Get it? Just in case! break done

Rumble
The Builder Academy
tbamud.com 9091
rumble@tbamud.com
Last edit: 07 Dec 2013 20:19 by Rumble.

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

More
08 Dec 2013 04:34 #4559 by Parnassus
I have to say that when I told Krell about my sleepchecks, I had the feeling that they WERE echos, and not send tos. In my defense, I've had this icky cold and my brain hasn't been working properly. Originally, my trigger used echos but I felt they were too "loud" so I switched them. The sleepchecks came later so I'd never actually tried them on echos.

I appreciate Rumble's updated trigger, since I feel I'll be using it somewhere along the line, but the real point is that Krell and the original helpfile are right. If you're sleeping, how would you be knowing all the echoey stuff without waking up? In my opinion, it would be better to fix echo to only hit non-sleepers. If the builder wants something to hit sleepers, let the builder specify that, instead. How many echos make sense to be seen by sleepers? For instance, when I'm sleeping, will I see Rumble being a klutz and tripping over that branch? Imagine putting in sleepchecks for every echo that a sleeping person wouldn't see?

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

More
08 Dec 2013 06:20 - 08 Dec 2013 18:11 #4562 by krell
Replied by krell on topic Echoes, Sleeping and Checks
I'm of the opinion that one form of announcement be sent to all characters by default and the other type only be sent to those who are not sleeping. As it is, both echoes and sends are sent by default to all characters. Echoes are difficult to filter on and I think it would make more sense that, given the difficulty to filter echoes, they be by default only sent to !sleeping characters.

Then, if the script writer wanted to send echoes to all characters in the room sleeping or not, you'd use the loop. If the script writer wanted to be creative about how much the sleeping character noticed she or he could use random.# and switch.

A possible example.

Code:
set next_char %self.vnum% while %next_char% if %next_char% == sleeping switch %random.10% case 1 return 0 break case 2 return 0 break case 3 return 0 break case 4 return 0 break case 5 %send% %next_char% something disturbs your sleep. break case 6 %send% %next_char% something disturbs your sleep. break case 7 %send% %next_char% something disturbs your sleep. break case 8 %send% %next_char% a loud noise annoys you making you turn over. break case 9 %send% %next_char% a loud noise annoys you making you turn over. break case 10 %send% %next_char% something annoying disrupts your slumber and you wake up. %force% %next_char% wake break default %echo% @RERROR: value in wrong place!@n break done end set tmp_char %next_char.next_in_room% set next_char %tmp_char done %echo% The display of canned foods falls crashing to the ground!
Last edit: 08 Dec 2013 18:11 by krell.

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

Time to create page: 0.213 seconds