SmaugFUSS channels

Posted by Metsuro on Fri 09 Jun 2006 09:18 AM — 19 posts, 63,741 views.

USA #0
Alright I've been looking over how the channels work and this annoys me that the channels like imm and chat take the $ code and use them... I dont see how or why someone would do that?

You chat '$s.'
Metsuro chats 'his.'

USA #1
It's not clear to me what you're saying. Are you asking why the channels don't parse the variables? Are you asking how to make them parse the variables? (your "how or why" is a little confusing.)
USA #2
I am asking I meant why does it parse them already, to me its stupid to have the channels to parse them cause they arn't needed on those channels. So I would like to know how to make it not do it.
USA #3
Oh. From your post it looked like $s wasn't parsing for you, and for Metsuro it was.

If you don't want it to parse those, just bypass the act_string function calls. (That might not be the exact name, but it's similar.)

Undoubtedly they were added in the first place because somebody saw the need for them at some point. Either that, or it was just easiest to copy/paste the code from other channels that do need the variables.
USA #4
no see its not the act() thats the problem cause say is a act too and it doesn't parse them. And on the mud I'm metsuro. Thats the output from the mud when I'm snooping someone, and what I see.
USA #5
That's because the text in do_say's 'act' call is in the $t variable, so it doesn't get parsed. Look at how 'act' function is called in both cases and you will see the difference.
USA #6
act( AT_SAY, "&CYou say '$T'&D", ch, NULL, drunk_speech( capper(argument), ch ), TO_CHAR ); -- do_say


         snprintf( buf, MAX_STRING_LENGTH, "&z[&GGM&z] &Y%s:&w %s", capitalize( ch->name ), capper(argument) );
         act( AT_IMMORT, buf, ch, argument, NULL, TO_CHAR ); -- immtalk


the only thing i notice is that one is argument, NULL and the other is NULL, argument.
USA #7
I told you already: it's the $t variable. If you looked at the code for 'act', you'd see that it takes the fifth argument (the drunk_speech one) and plugs that in for $t.
USA #8
Well I dont really much like the way the channels work in SmaugFUSS, I got used to how the were in dbsc and I dont remember which verison that was... heh. But if so, this still doesn't really explain how i can make them not parse?
USA #9
Before understanding how to make it not parse, you need to understand how the system works in general... So, note that in 'say' it uses the 2nd argument as a format string, and the t variable tells it to use the 5th argument as the text. You can use this to pretty much immediately alter the channel handling, by having it not print the buffer, but a format string that uses the t variable and a fifth argument.
USA #10
alright my problem I guess is that the way most of the talk_channel uses act() which of course is the act_string later on, but the way it was done uses act to do the invisible setup as well? I just really dont understand i guess maybe? Or maybe I should just change all of talk_channel to the one of dbsc that uses send_to_char instead of the acts?
USA #11
Well looking at it more I understand act a lot more then I did but I am still not sure how I could "bypass" act because I dont really know how it was set up with the whole invis thing.
USA #12
Instead of using the text string as the argument to act, use "$t" as the argument and pass the text string as the fifth argument to act, similarly to how do_say does it. That will bypass the variable parsing since the $t variable contents don't get parsed. I strongly recommend against simply picking up another talk_channel and sticking it in since there's no telling if it'll actually work.
USA #13
I dont think that is possible? because not all the channels use use act like Immtalk, later down in the the function they use...

mudstrlcat( lbuf, buf, MAX_STRING_LENGTH );

I think this is what it uses to send the strings to the player?

         mudstrlcat( lbuf, buf, MAX_STRING_LENGTH );
         if( channel == CHANNEL_IMMTALK || channel == CHANNEL_AVTALK )
            act( AT_IMMORT, lbuf, ch, sbuf, vch, TO_VICT );
         else if( channel == CHANNEL_WARTALK )
            act( AT_WARTALK, lbuf, ch, sbuf, vch, TO_VICT );
         else if( channel == CHANNEL_RACETALK )
            act( AT_RACETALK, lbuf, ch, sbuf, vch, TO_VICT );
         else
            act( AT_GOSSIP, lbuf, ch, sbuf, vch, TO_VICT );
this at the bottom talk_channel is the only thing I could find that sends the strings to the player in anyway using the buf. Now I thought you could do something like replace the mudstrlcat with a send_to_pager but that by itself wont work because it doesn't allow for the invis parts. So maybe i'm just missing something?
USA #14
You're saying FUSS channels take variables like $n and makes them into "his" etc? I have stock FUSS running and mine doesn't do that...
USA #15
I'm the only one that does the coding on this, and the only thing within talk_channel I've changed is in immtalk and it looks and added capper to the arguments in the channels to add the cap and period. I'll have to try another copy but I am almost sure thats how it came.
USA #16
Alright... it might have been something I screwed up by accident I downloaded a new copy and it didn't parse them so now I'ma spend some time seeing what happened.
USA #17
Just do a diff between the files you've changed. You said you didn't change much. Or just compare talk_channel, I guess.
USA #18
I did but the problem was that my channels weren't using $t which I didn't really notice till just a few minutes after you said something Zeno. But instead all instances of $t were in my copy %s I dont think I changed them to %s but I might have... but thank you all for helping me solve this.