Top Mud Sites Forum Return to TopMudSites.com
Go Back   Top Mud Sites Forum > Mud Development and Administration > MUD Coding
Click here to Register

Reply
 
Thread Tools
Old 09-03-2007, 01:06 AM   #1
tochi
New Member
 
Join Date: Sep 2007
Posts: 4
tochi is on a distinguished road
Unhappy npc summoning code bug (SMAUG)

howdy folks. i'm a bit of an amatuer coder here so be gentle.

we're working on developing a code that'll summon a large NPC to follow the player inside our MUD. basicly summon up a kind of silly homonculus. took bits from animate dead and a pre-existing summon familiar snippet and went to town.

the problem is that for some reason the NPC isn't showing up with the charm flag. it'll follow you, but you can't order it to do a single thing.

there've also been some odd crashes in our test MUD related to this, but the core dumps tell us nothing helpful and the body of the errors are the enigmatic 'called with threadlist_ix -1' sort.

anyway. here's the code itself. if anyone can figure out why the charm flag isn't turning itself on, it'd be great. if you can figure why it appears to make us volitile too, that'd be absotively astonishing.

code's totally free to use and modify, too. :3
tochi is offline   Reply With Quote
Old 09-03-2007, 01:18 AM   #2
Zeno
Member
 
Join Date: Jan 2005
Location: Saratoga, NY
Home MUD: Bleached InuYasha Galaxy
Posts: 189
Zeno is on a distinguished road
Send a message via AIM to Zeno Send a message via MSN to Zeno Send a message via Yahoo to Zeno
Re: npc summoning code bug (SMAUG)

For one, you don't need the affect_to_char if you already set the affected_by charm.

You also may want to set the mob first before it gets sent to the room, and then add_follower after it gets sent to the room.
Zeno is offline   Reply With Quote
Old 09-03-2007, 01:27 AM   #3
tochi
New Member
 
Join Date: Sep 2007
Posts: 4
tochi is on a distinguished road
Re: npc summoning code bug (SMAUG)

well, i'll give it a shot but i kind of wonder if it'll make a difference.

the tail end of things was a direct copy from animate dead, and the charm flag DID work for animate dead.

from animate dead:
compared to the daisy daisy:
essentially my additions were redundant. or are you saying that add_follower ought to be after the redundant xset_bits?
tochi is offline   Reply With Quote
Old 09-03-2007, 01:32 AM   #4
Zeno
Member
 
Join Date: Jan 2005
Location: Saratoga, NY
Home MUD: Bleached InuYasha Galaxy
Posts: 189
Zeno is on a distinguished road
Send a message via AIM to Zeno Send a message via MSN to Zeno Send a message via Yahoo to Zeno
Re: npc summoning code bug (SMAUG)

Here is the end of a function I wrote (it works fine). It creates a mob and goes under the control of the person.
Mine isn't set as a pet though.

If that doesn't work/help, tell me what message you are getting when you try to order it. Or is it not even getting charmed?
Zeno is offline   Reply With Quote
Old 09-03-2007, 01:35 AM   #5
tochi
New Member
 
Join Date: Sep 2007
Posts: 4
tochi is on a distinguished road
Re: npc summoning code bug (SMAUG)

it is not even getting charmed, that is the issue. i kind of did say that in the first post.
tochi is offline   Reply With Quote
Old 09-03-2007, 01:43 AM   #6
Zeno
Member
 
Join Date: Jan 2005
Location: Saratoga, NY
Home MUD: Bleached InuYasha Galaxy
Posts: 189
Zeno is on a distinguished road
Send a message via AIM to Zeno Send a message via MSN to Zeno Send a message via Yahoo to Zeno
Re: npc summoning code bug (SMAUG)

I know, but I meant is the problem still happening after you made the changes? Followed the order my code is in? Setting the bit should not fail.
Zeno is offline   Reply With Quote
Old 09-03-2007, 02:00 AM   #7
tochi
New Member
 
Join Date: Sep 2007
Posts: 4
tochi is on a distinguished road
Re: npc summoning code bug (SMAUG)

after some tweaking i managed to get it working. your initial suggestion about the char_to_room threw me because i already HAD the add_follower after it, so i thought you must have meant before it and things became messed up.

here's the current working code. i trimmed off some redundancies and nipped the tail end off you mentioned. not sure why it works when prior versions didn't.

tochi is offline   Reply With Quote
Old 09-03-2007, 02:43 AM   #8
Zeno
Member
 
Join Date: Jan 2005
Location: Saratoga, NY
Home MUD: Bleached InuYasha Galaxy
Posts: 189
Zeno is on a distinguished road
Send a message via AIM to Zeno Send a message via MSN to Zeno Send a message via Yahoo to Zeno
Re: npc summoning code bug (SMAUG)

You don't need that af.type etc stuff either, since it's never used.
Zeno is offline   Reply With Quote
Reply


Thread Tools


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -4. The time now is 12:32 AM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Style based on a design by Essilor
Copyright Top Mud Sites.com 2022