Register forum user name Search FAQ

Gammon Forum

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 ➜ Vampires x_x

Vampires x_x

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Mopop   (115 posts)  Bio
Date Tue 31 Jan 2006 04:45 AM (UTC)
Message
I been adding all my new races (all 21 of them) and I needed to remove vampire. I spent almost all day doing this and I was down to one thing where it was checking for VAMP_AC in mstat which i removed.


#define GET_AC(ch)		((ch)->armor				    \
				    + ( IS_AWAKE(ch)			    \
				    ? dex_app[get_curr_dex(ch)].defensive   \
				    : 0 )				    \
				    + VAMP_AC(ch))


I removed the + VAMP_AC

after that I compiled and got a strange error instead of thinking I took care of it.

act_wiz.c: In function `do_mstat':
act_wiz.c:1917: error: parse error before ';' token


pager_printf_color( ch, "&cHitroll : &C%-5d           &cAlign  : &w%-5d           &cArmorclass: &w%d\r\n",
                       GET_HITROLL( victim ), victim->alignment, GET_AC( victim ) );


Yeah It was fine, till now? What went wrong??? I would like to get these vampires out of mind I been doing this all day and I am pretty sure I screwed up nanny removing them. (Which I will probably have to post soon, depending if it worked or not :P) As always thanks in advance!

Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #1 on Tue 31 Jan 2006 05:07 AM (UTC)
Message
Your GET_AC probably looks like this:

#define GET_AC(ch)		((ch)->armor				    \
				    + ( IS_AWAKE(ch)			    \
				    ? dex_app[get_curr_dex(ch)].defensive   \
				    : 0 )				    \

Note that you have a trailing backslash at the end of the last line.

The backslash means to extend the macro to the next line. So you don't want it if the macro does not, in fact, extend.

Furthermore, if your GET_AC looks like the above, it is missing a closing parenthesis. You want it to look like:

#define GET_AC(ch)		((ch)->armor				    \
				    + ( IS_AWAKE(ch)			    \
				    ? dex_app[get_curr_dex(ch)].defensive   \
				    : 0 )				    \
				    )

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Mopop   (115 posts)  Bio
Date Reply #2 on Tue 31 Jan 2006 05:15 AM (UTC)
Message
Wow dur lol, simple simple. I really suck at () and brackets. Why did it mention it in act wiz tho? and not in mud.h? Thats what threw me off. ^_^ anywho glad to see a clan compile now to see how much damage i did lol!
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #3 on Tue 31 Jan 2006 08:50 AM (UTC)
Message
It's because the macro is expanded in act_wiz.cpp. What you see in mud.h isn't a function; it's what's called a macro. A macro is expanded to its text whenever you use it. So, strictly speaking, the error really was in act_wiz.cpp because that's where the macro was expanded.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #4 on Tue 31 Jan 2006 05:14 PM (UTC)
Message
Working in C++ lately, Ksilyan? =P

Just so you don't get confused Mopop, I'm sure he meant act_wiz.c

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #5 on Tue 31 Jan 2006 05:45 PM (UTC)
Message
Err, uhh... *looks around innocently*

Sorry :P Yes I did mean act_wiz.c.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Gatewaysysop2   USA  (146 posts)  Bio
Date Reply #6 on Wed 01 Feb 2006 01:35 AM (UTC)
Message
Just curious. If you're removing the vampire race, why are you taking out vamp_ac exactly? Do you not want the vampire _class_ to have that functionality anymore (ac adjustment based on time of day)? I always thought that was kind of cool, but maybe that's just me. ;)


"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 Conner   USA  (381 posts)  Bio
Date Reply #7 on Wed 01 Feb 2006 03:00 AM (UTC)
Message
He's actually trying to remove the whole vampire race/class coding from all the code, he's just going about via brute force method without fully understanding what he's yanking... I tried to advise him that the easy solution was to not remove it at all but just make vampire a non-player class. *shrug*

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
Top

Posted by Gatewaysysop2   USA  (146 posts)  Bio
Date Reply #8 on Wed 01 Feb 2006 04:45 AM (UTC)
Message
Oh. Well in that case, nevermind. ;)



"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 Mopop   (115 posts)  Bio
Date Reply #9 on Wed 01 Feb 2006 04:58 PM (UTC)
Message
I like doing things the hard way as a crash course to learn more about the code I guess =P I duuno call me stubborn haha.
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #10 on Wed 01 Feb 2006 06:29 PM (UTC)
Message
The only problem is that you might be breaking things in a very subtle manner, that will be hard if not impossible to detect later on. The errors could lead to crashes, or perhaps even worse, lead to changes in game play that you didn't intend and aren't aware about.

Still, it can be a good way to learn, as long as you're careful. And if you document every change you make, you should be ok.

I'm guessing that I should have mentioned earlier that you should comment at every place you removed something. :-)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Mopop   (115 posts)  Bio
Date Reply #11 on Wed 01 Feb 2006 09:04 PM (UTC)
Message
I hope not, Its only Vampires. Everything seems to be running great right now. I had a little problem a bit ago but it was because of a ~ I forgot in tongues.dat

If a problem arises I will try to find it and remove it, all part of my crash course :) I thank you for the advice and help tho ^_^ now If only I could figure something out in do_speak *mumbles*
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.


31,116 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.