LPMuds.net
September 09, 2010, 04:03:48 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: This is the forum page. For the main LPMuds page, visit http://lpmuds.net
 
   Home   SITE FAQ INTERMUD DOWNLOADS LINKS Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Hiho Andras here  (Read 497 times)
Andras
Acquaintance
*
Offline Offline

Posts: 15


View Profile
« on: June 09, 2010, 10:40:35 PM »

Hi, I use DGD which I guess is based on Lpmud 2.4.5 sins its a map in there named so.
Very clean mud, not that much files in it.

Ive solved some of my problems, which was I wanted weapons and npcs in their own files, then wanted to add
them to the room and add weapon to the npc. After checking throw like all files I finally found a way to do it.
yeye Its kinda simple but it was something like move_object("/object/xxx/xxx/", this_object); nothing biggy.
then command("fatta " + "svärdet"); to get the npc to wield the sword. all good there. Just showing Ive
looked throw files Tongue

now to my question.
Im trying to fix a guild object. Ive found a file which ive modified alittle so you cant drop the object.
The thing with a guild is you want to be able to join and leave, and then the biggest thing, the guild
chat!

There are no files with "channels" or so. So my guess Is I need to modify the "shout" thing and
add that to the guild object. Is that correct?
Modify so only those with the object can hear the shout.
and well rename the shout to something like

guildchat hi
guildchat andras says: Hi!

Logged
Andras
Acquaintance
*
Offline Offline

Posts: 15


View Profile
« Reply #1 on: June 10, 2010, 11:23:22 AM »

add_action("quitguild","lämnagillet"); <--- works, that will destruct the object.
add_action("quitguild","lämna gillet"); <--- dosnt work, anyone know how to fix it? or dosnt it work in the standard plain lpmud 2.4.5 (dgd)?
Logged
vexcesban
Acquaintance
*
Offline Offline

Posts: 20


-Noobie Mud Admin-


View Profile
« Reply #2 on: June 12, 2010, 06:51:05 AM »

maybe this is what you're looking for, i dont know

add_action("quitguild","lämna");

quitguild(string s){
  if(!s || s != "gillet"){
    write("lämna what?\n");
    return 1;
  }
  player->quit_guild();
  return 1;
}
Logged
Andras
Acquaintance
*
Offline Offline

Posts: 15


View Profile
« Reply #3 on: June 12, 2010, 11:42:47 AM »

thanks, modified it alittle and it works. Smiley Thanks for the help
« Last Edit: June 12, 2010, 11:46:27 AM by Andras » Logged
Andras
Acquaintance
*
Offline Offline

Posts: 15


View Profile
« Reply #4 on: June 13, 2010, 10:16:38 AM »

Code:
#define GK_OLD(x) gk(x)
#define gk(x) gTellstring=x; filter_objects(users(),"filter_tell",this_object())

static string gTellstring;
static int listen_to_shouts_from_level;

filter_tell(ob) {
    if (ob == this_player())
return 0;
    return ob->catch_shout(gTellstring);
}

/* This is called for every shouted string to this player.
*/
catch_shout(str)
{
    if (this_player()->query_level() >= listen_to_shouts_from_level) {
tell_object(this_object(),str);
return 1;
    }
    return 0;
}

Can this be used, with alittle modifying for the guildchat.
The thing I want is, or atleast what I think I want is.
"gk hello" -> sends hello to the guildobject which sends
it to the players whom has the gobj.
"guildchat andras: hello"

ps. I have this code in the gobj.c
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!