Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ SMAUG coding
➜ Actflags causing crashes [SWR]
Actflags causing crashes [SWR]
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1
2 3
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #15 on Fri 20 May 2005 07:35 PM (UTC) |
Message
| In frame 0, print ch->name for me. Is it a NPC or player? |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Evre
(19 posts) Bio
|
Date
| Reply #16 on Fri 20 May 2005 07:37 PM (UTC) |
Message
| (gdb) print ch->name
$2 = 0x8280318 "secretary"
That'd be my mob (NPC) I'm setting the SENTINEL flag to.
If you need a client-side view of the crash...
Research Facility Kierkeguard - Entryway {2001[indoors]
The room expands just slightly from the Foyer to the south, the two divided
by a thick metal border inlaid around the rooms' edges. Soft lighting and
light blue walls give off a sense of serenity, while the cold metal
accents and furnishings keep a business-like touch in the air.
A polished mahogany desk rests in the center of the room. Two computers and
a stack of papers lie atop its reflective surface.
Obvious exits:
North - (closed)
South - Research Facility Kierkeguard - Foyer
A secretary sits at a computer here.
(Blue Aura) A security guard stands watch here.
A secretary says 'Welcome to the facility.'
vnum:<#2001> / wizinvis: 0
mset secretary flags sentinel
Build: Evre: mset secretary flags sentinel
[And here's where the MUD goes unresponsive] | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #17 on Fri 20 May 2005 07:39 PM (UTC) |
Message
| As gdb reports, it's crashing on this line:
if( IS_NPC( ch ) || ch->pcdata->condition[COND_DRUNK] <= 0 )
return;
Can you show me the IS_NPC macro? Should be in mud.h
It should return before the drunk check, so that should be fine. I'm not sure what's going on, but I'm going to suggest changing back the changes you made to the hunger/thirst code. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Evre
(19 posts) Bio
|
Date
| Reply #18 on Fri 20 May 2005 07:42 PM (UTC) |
Message
| #define IS_NPC(ch) (IS_SET((ch)->act, ACT_IS_NPC))
That's the only bit of code that defines IS_NPC, any other search results just turn up lines that use it in mud.h. I hate to put the bloody thirst/hunger system in again. Suppose I'll have to find another way around it. | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #19 on Fri 20 May 2005 07:44 PM (UTC) |
Message
| Ah, I realize the problem, perhaps. Yes, it is flags it seems, not your change. Since its checking act flags, it's the flags that crashed as you said. Have you made any changes to the act flags in the code at all? This is not a normal SWR crash. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Evre
(19 posts) Bio
|
Date
| Reply #20 on Fri 20 May 2005 07:45 PM (UTC) |
Message
| No, I haven't intenionally changed any of the flag codes (that's far too over my head), and none of the snippets I installed made any changes to them... oddness. o.O | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #21 on Fri 20 May 2005 08:45 PM (UTC) |
Message
| Hm, can you show the act flag struct (in mud.h) and the const struct in build.c here? Has this problem always happened? If not, when did it happen, after a certain change? |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Nick Cash
USA (626 posts) Bio
|
Date
| Reply #22 on Fri 20 May 2005 09:11 PM (UTC) |
Message
|
if( IS_NPC( ch ) || ch->pcdata->condition[COND_DRUNK] <= 0 )
return;
I think if it is an NPC the conditional will stop with IS_NPC, but in case it doesnt you are probably pointing to data that doesnt exist. This'll crash your program quite easily. No data == bad.
Not sure if its the source of the crash, but its definitely something to be aware of. You could change it like so:
if( IS_NPC( ch ) || (ch->pcdata != NULL && ch->pcdata->condition[COND_DRUNK] <= 0 ) )
return;
|
~Nick Cash
http://www.nick-cash.com | Top |
|
Posted by
| Evre
(19 posts) Bio
|
Date
| Reply #23 on Sat 21 May 2005 05:09 AM (UTC) |
Message
| The ACTFLAG definition structure in mud.h
/*
* ACT bits for mobs.
* Used in #MOBILES.
*/
#define ACT_IS_NPC BV00 /* Auto set for mobs */
#define ACT_SENTINEL BV01 /* Stays in one room */
#define ACT_SCAVENGER BV02 /* Picks up objects */
#define ACT_AGGRESSIVE BV05 /* Attacks PC's */
#define ACT_STAY_AREA BV06 /* Won't leave area */
#define ACT_WIMPY BV07 /* Flees when hurt */
#define ACT_PET BV08 /* Auto set for pets */
#define ACT_TRAIN BV09 /* Can train PC's */
#define ACT_PRACTICE BV10 /* Can practice PC's */
#define ACT_IMMORTAL BV11 /* Cannot be killed */
#define ACT_DEADLY BV12 /* Has a deadly poison */
#define ACT_POLYSELF BV13
#define ACT_META_AGGR BV14 /* Extremely aggressive */
#define ACT_GUARDIAN BV15 /* Protects master */
#define ACT_RUNNING BV16 /* Hunts quickly */
#define ACT_NOWANDER BV17 /* Doesn't wander */
#define ACT_MOUNTABLE BV18 /* Can be mounted */
#define ACT_MOUNTED BV19 /* Is mounted */
#define ACT_SCHOLAR BV20 /* Can teach languages */
#define ACT_SECRETIVE BV21 /* actions aren't seen */
#define ACT_POLYMORPHED BV22 /* Mob is a ch */
#define ACT_MOBINVIS BV23 /* Like wizinvis */
#define ACT_NOASSIST BV24 /* Doesn't assist mobs */
#define ACT_NOKILL BV25 /* Mob can't die */
#define ACT_DROID BV26 /* mob is a droid */
#define ACT_NOCORPSE BV27
#define ACT_PROTOTYPE BV30 /* A prototype mob */
/* 20 acts */
And the const structure for the act flags in build.c
char *const act_flags[] = {
"npc", "sentinel", "scavenger", "r3", "r3", "aggressive", "stayarea",
"wimpy", "pet", "train", "practice", "immortal", "deadly", "polyself",
"meta_aggr", "guardian", "running", "nowander", "mountable", "mounted", "scholar",
"secretive", "polymorphed", "mobinvis", "noassist", "nokill", "droid", "nocorpse",
"r28", "r29", "prototype", "r31"
};
Both sets of code came stock with the distrobution of source I'm using and haven't been changed (by myself, anyway, and I'm the only person toying with the source at the moment... Hell, I'm the only person connecting to my server at the moment). Same thing goes with the code Whiteknight was concerned with, though I recognize the potential bug and enacted his suggested changes anyway. Didn't fix the ACTFLAG problem, but I didn't expect it to.
I don't believe I've thanked any of you for being so patient and imparting so much advice and help. You've a great deal of gratitude from me. | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #24 on Sat 21 May 2005 06:10 AM (UTC) |
Message
| I don't seem anything wrong there. The only thing I can suggest now is to go back through each change and test the crash. If it doesn't crash, then you know that the latest change you reverted was the issue. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Evre
(19 posts) Bio
|
Date
| Reply #25 on Sat 21 May 2005 06:18 AM (UTC) |
Message
| Ah... that's happy news. The one time I get lazy and neglect to comment my changes it bites me in the rear... A lesson hard learned, I suppose.
If I recall correctly, the last change I made was to the hunger and thirst code - with the ifchecks that determine what effects to place on the player should they become too hungry or thirsty, they had a check that ignored anyone that had level = IS_AVATAR or something to that effect, so I think I changed it to apply to anyone whose level was under 1. It didn't seem like the best idea, but it did sound like the quickest way to rid myself of that horrid system.
Regardless, thank you for your time and patience. | Top |
|
Posted by
| Gatewaysysop2
USA (146 posts) Bio
|
Date
| Reply #26 on Sat 21 May 2005 05:14 PM (UTC) |
Message
| Hmmm.
Just an off the wall idea here. Are you certain the flags you intend to change are the ones being changed? Maybe it's changing the NPC flag instead, which I'm sure would cuase problems if you lifted it from an NPC. :-o
Just an idea. It would explain why it crashes on the line that checks for NPC status and then checks the con_drunk stuff. If it doesn't think it's an NPC it'll blow right past and attempt to check data that the mob does not have, which would probably cause the crash.
|
"The world of men is dreaming, it has gone mad in its sleep, and a snake is strangling it, but it can't wake up." -D.H. Lawrence | Top |
|
Posted by
| Evre
(19 posts) Bio
|
Date
| Reply #27 on Sat 21 May 2005 07:40 PM (UTC) |
Message
| I'm not certain what you're asking here so I'll just detail the problem in hopes that it'll answer your question;
Using mostly Stock SWR code (The flag coding hadn't been changed), I attempt to set a sentinel flag (aggressive does it as well, haven't tried the rest) on a self-made mob (mcreate secretary etc etc) using mset secretary flags SENTINEL, which causes the crash. The mob is one of my own making, and upon an mstat, it shows that it has the IS_NPC flag. As far as the flag code itself goes as far as checking for NPC data that isn't there, I don't see why it would if I haven't changed it from stock? | Top |
|
Posted by
| Gatewaysysop2
USA (146 posts) Bio
|
Date
| Reply #28 on Sun 22 May 2005 01:30 AM (UTC) |
Message
| What I was asking is exactly what was said. Namely, are you certain the flags you're trying to change are the ones being changed? Maybe if something is off, you're telling it to apply the sentinel flag but really it's adding/removing a different flag altogether. Have you tried settings flags that work and using MSTAT to see if the correct flag has been added/removed from the mob?
Also have you tried digging up a backup from before any recent changes to see if you can replicate this behavior? If not then you can be certain it was something you changed and it's only a matter of back tracking.
If you can do this even with a stock copy of the distribution, that would be of even more interest, because it would indicate that there's probably a bug of some kind.
Anyway, more information is always useful so please post again with what you've found out. |
"The world of men is dreaming, it has gone mad in its sleep, and a snake is strangling it, but it can't wake up." -D.H. Lawrence | Top |
|
Posted by
| Evre
(19 posts) Bio
|
Date
| Reply #29 on Sun 22 May 2005 05:27 PM (UTC) Amended on Sun 22 May 2005 11:04 PM (UTC) by Evre
|
Message
| Still in the process of figuring out exactly what's going on, but I thought I'd go ahead and share some newer issues. Apparently when I set the PROTOTYPE flag, several flags are set (As I suppose they're supposed to be) - Among them are "sentinel" "scavenger" "r3" and "r3" (it displays twice). The R3 flag is just a placeholder isn't it?
Well, I've tried most of the flags and only prototype neglects to cause a crash. Another curious thing is that after I set the prototype flag on an NPC, I set him to AGGRESSIVE as well. This is what I got;
mset guard flags aggressive
Build: Evre: mset guard flags aggressive
vnum:<#2000> / wizinvis: 0
look
Research Facility Kierkeguard - Foyer {2000[indoors]
The cool, calm ambience of the room accents its mixture of lavish oak and steel furnishings. The room itself is of fair size for a foyer. Paintings of pleasant landscapes dot the light blue walls, perforated with simple half-oval light fixtures that give off a soft white glow toward the smooth white ceiling.
Obvious exits:
North - Research Facility Kierkeguard - Entryway
(Link Dead) (Blue Aura) A security guard stands watch here.
He went /link dead/. o.O A few moments after that the MUD crashed, which is strange as well because there was a delay this time. Is this common behavior for NPCs? And, on that same token, what exactly does the blue aura imply? I had assumed prototype but when I checked my secretary, who doesn't have the prototype flag, she's got a blue aura as well.
- EDIT -
Rather than double post, I'll just add on to what I've already posted... The bug's been there for as long as I can recall, actually, though I don't have any backups dating back before I first starting changing text strings, but I do recall that a few days after I first got the MUD running I logged on and tried to show a friend how to create a "monster" but the MUD kept crashing. I didn't realize it at the time but it was because I was setting the AGGRESSIVE flag.
I tried changing the thirst/hunger code back to normal, but the bug persists. Lacking any other option, I'm going to go through and post anything relevant to flag setting -
In build.c
if( IS_NPC( victim ) )
{
value = get_actflag( arg3 );
if( value < 0 || value >= 31 )
ch_printf( ch, "Unknown flag: %s\n\r", arg3 );
else if( 1 << value == ACT_PROTOTYPE && ch->top_level < sysdata.level_modify_proto )
send_to_char( "You cannot change the prototype flag.\n\r", ch );
else if( 1 << value == ACT_IS_NPC )
send_to_char( "If the NPC flag could be changed, it would cause many problems.\n\r", ch );
else
TOGGLE_BIT( victim->act, value );
}
else
{
value = get_plrflag( arg3 );
if( value < 0 || value >= 31 )
ch_printf( ch, "Unknown flag: %s\n\r", arg3 );
else if( 1 << value == ACT_IS_NPC )
send_to_char( "If the NPC flag could be changed, it would cause many problems.\n\r", ch );
else
{
ftoggle = TRUE;
TOGGLE_BIT( victim->act, value );
}
}
}
if( ftoggle )
send_to_char( "Flags set.\n\r", ch );
if( IS_SET( victim->act, ACT_PROTOTYPE ) || ( value == ACT_PROTOTYPE && protoflag ) )
victim->pIndexData->act = victim->act;
return;
In mud.h (for the TOGGLE_BIT code)
#define SET_BIT(var, bit) ((var) |= (bit))
#define REMOVE_BIT(var, bit) ((var) &= ~(bit))
#define TOGGLE_BIT(var, bit) ((var) ^= (bit))
(ACT flag structure from mud.h is posted earlier in this thread so I won't bother reposting it.)
That's all the relevant code I can think to find at the moment. If I'm spamming with too much of this stuff or if I'm not heading in the right direction, don't hesitate to tell me. Thanks. | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
99,733 views.
This is page 2, subject is 3 pages long:
1
2 3
It is now over 60 days since the last post. This thread is closed.
Refresh page
top