[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Adding eq slots, segmentation fault when look self
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Adding eq slots, segmentation fault when look self

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Zynk   (11 posts)  [Biography] bio
Date Wed 30 Nov 2005 08:07 AM (UTC)  quote  ]
Message
I've successfully added new eq slots that are just a basic slot like the way stock head slot works. I tried adding a hooves slot that works exactly like neck where there are 2 slots. I copied the code directly in act_obj.c and changed every instance of neck to hooves and every other part where hooves was added, i did so the same way neck was, everything compiled and i can wear 2 hoof items now safely. However, when i type eq to look at myself, the mud crashes, and i get a segmentation fault(core dumped) error. I'm not sure which part of the code i should even be looking at that would be causing this, and i've double checked the code to make sure there werent any mix ups of hooves1 and hooves2. If anyone can at least point me in the right direction it'd be greatly appreciated, thanks:) - Zynk
[Go to top] top

Posted by Robert Powell   Australia  (367 posts)  [Biography] bio
Date Reply #1 on Wed 30 Nov 2005 11:40 AM (UTC)  quote  ]

Amended on Wed 30 Nov 2005 11:42 AM (UTC) by Robert Powell

Message
The best place to start is to read through Nick's Beginners Guide to GDB. Learn the basics of using GDB and then you can post the backtrace output and then someone will be able to help you further.

Here is the link to the relevent page http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=3653

Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated.
[Go to top] top

Posted by Zynk   (11 posts)  [Biography] bio
Date Reply #2 on Wed 30 Nov 2005 10:58 PM (UTC)  quote  ]
Message
Thanks, i ended up figuring out the problem via my lightbulb method(i.e. i was doing something other than coding and all of a sudden it hit me, literally like a lightbulb over my head and i fixed it). But looking into this gdb debugging this will make things a lot easier in the future, thanks! - zynk
[Go to top] top

Posted by Gatewaysysop2   USA  (142 posts)  [Biography] bio
Date Reply #3 on Thu 01 Dec 2005 03:06 AM (UTC)  quote  ]
Message
Perhaps you can elaborate on your error so that others might understand if they encounter the same problem when adding EQ slots themselves?



"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
[Go to top] top

Posted by Robert Powell   Australia  (367 posts)  [Biography] bio
Date Reply #4 on Thu 01 Dec 2005 04:37 AM (UTC)  quote  ]
Message
The lightbulb or blindly stumble across the problem will only work for a while. Once you get into harder to see problems, knowing how to use GDB to look in your core dump, or to attach to a running process to step throught some known buggy code will make youir life 10 times easier. Do take the time to read through Nick's GDB guide, it will help you in the long run.

Peace.

Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated.
[Go to top] top

Posted by Zynk   (11 posts)  [Biography] bio
Date Reply #5 on Thu 01 Dec 2005 04:38 AM (UTC)  quote  ]
Message
Well, i added the eq slots via a snippet. This snippet talked about the max wear bit vector for eq slots but gave no mention to the max wear_name in mud.h. It turned out that i had hit my max, and the 2nd eq slot was the 30th(stock comes with 29 slots). So i had to go in and change the the max wear name to the desired maximum. It gave warning when compiled along the lines of the maximum items in an array has been exceeded, but
it compiled correctly. I didnt notice this the first time i had compiled, so just simply changing the maximum was all that needed done:/. As i'm now learning, almost everything is allocated x amount of memory and when things are added it needs changed, as such was this case.
[Go to top] 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.


2,456 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Web site powered by FutureQuest.Net]