Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, Vladaar

Members: 1
Guests: 2
Stats
Files
Topics
Posts
Members
Newest Member
481
3,734
19,366
618
Micheal64X
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » AFKMud Support & Development » snippets and 1.53's mud.h
Forum Rules | Mark all | Recent Posts

snippets and 1.53's mud.h
< Newer Topic :: Older Topic > OK, I give up, time to beg for advi

Pages:<< prev 1 next >>
Post is unread #1 Jul 14, 2003, 10:40 am   Last edited Nov 25, 2007, 7:26 pm by Samson
Go to the top of the page
Go to the bottom of the page

Moonwolf

GroupMembers
Posts43
JoinedAug 25, 2005

Hi all

I'm totally lost in how to apply snippets to the 1.53 codebase. There seems to be some rather dramatic differences between how the AFKMud team has optimized the code, and the sort of codebase snippet instructions are aimed for.

My problem seems to be the DECLARE_DO_FUN's and bit vectors in mud.h ... They don't seem to exist anywhere in there to look at, let alone to add new ones from snippets.

Looking at the code, my guess is that the EXT_BV's (BV01 etc) are the equivalent inside AFKMud for the #define ACT_whatever XX parts listed in snippets, and I also guess that somewhere in build.c where the arrays for mob ACT flags are set does some nifty footwork in doing the necessary definitions. Unfortunately, all my guesses as to how to convert the snippet instructions I see to fit this fail miserably.

Don't get me wrong, I'm not saying I understand C and it's ilk in the slightest. If someone writes the AFKMud codebase in PHP, I'm your girl for patching it out, but in this particular arena I'm so severely out of my depth I might as well be trying to swim through the Marianas Trench :P

The snippet I'm trying to add is the healer mob one at http://www.smaugmuds.org/index.php?a=files&s=viewfile&fid=62 I know spec_cast_adept could be used instead, but I want my players to have to pay for healing, and the spec'd mob tends to be too spammy for my taste.

So if some kind soul could take pity on me and give me some advice on how to adapt the instructions in that snippet for mud.h and tables.c to work on the 1.53 codebase, it would be very much appreciated.

Kathi
       
Post is unread #2 Jul 15, 2003, 1:40 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,643
JoinedJan 1, 2002

Yes, there are some significant structural differences in AFKMud, as you seem to have noticed

The snippets on our page are geared toward adding to a stock Smaug base and as such if it's not an AFKMud feature it will require adjustment to make it fit. These following instructions should work in general for any Smaug snippet.

DECLARE_DO_FUN is no longer necessary, so you can skip that part. You can also skip the parts covering tables.c as well.

In the Makefile, you'll only need to add healer.c, there's no list of O files.

For the ACT_HEALER flag, that goes in olc.h, and needs to be added BEFORE the MAX_ACT_FLAG entry. The entry in build.c should be added to the end of the act_flags list.
       
Post is unread #3 Jul 15, 2003, 4:08 am
Go to the top of the page
Go to the bottom of the page

Xorith
The Null Value
GroupAFKMud Team
Posts254
JoinedFeb 23, 2003

Just throwing the service out here for anyone... if I have a free moment and you're really stressing about using snippets ment for SMAUG in AFKMud, I might be able to port it over for you.

Just send word

jwalker@NOSPAM.jw-tech.com (remove the NOSPAM )

I've been thinking about starting an AFKMud snippets page, and indeed I have two of my own (though small and not ALL that useful).

Hope I can help ;)

-- X
       
Post is unread #4 Jul 15, 2003, 6:37 am
Go to the top of the page
Go to the bottom of the page

Moonwolf

GroupMembers
Posts43
JoinedAug 25, 2005

OK, I think I figured it out. After taking Samson's advice on what bits I could just throw away, I tried compiling. It took a lot of grep and scratching my head trying to figure out why it kept telling me the spells were all first use of undeclared functions, but I fixed that with a copy and paste of a few ch_ret lines at the top from other files. It seems to work, but I'm curious about something.

Am I right in assuming this part:

spell(sn,ch->level,mob,ch);


Is telling the system to cast the spell at the level of the player asking the mob to cast it, as opposed to the level of the mob? If that's the case, how would I go about changing that so that it casts the spell at the level of the mob itself?

Is it OK to post the code I came up with here? I've never tried to break C code before, so I probably did things very clunkily, and would appreciate some feedback. That plus maybe someone else would like to use it.

One small step for a baby wiz, one giant leap backwards for mud coding everywhere

Kathi
       
Post is unread #5 Jul 15, 2003, 8:14 am
Go to the top of the page
Go to the bottom of the page

Xorith
The Null Value
GroupAFKMud Team
Posts254
JoinedFeb 23, 2003

I'd have to take a look, unfortunately. I don't know the order of arguments for the spell functions. If the argument is looking for an integer, then you could specify anything so long as it's an int. Meaning, if it's looking for a number then ch->level would be a number. So would mob->level, and so wound doing int vlevel = 10; (making a variable named vlevel that equals level 10) and sending vlevel in place of ch->level.


As for posting code, I believe that's alright. You might want to post it into the Coding section though. ;)

Anywho, back to my real life job *G*

-- X
       
Post is unread #6 Jul 15, 2003, 8:25 am
Go to the top of the page
Go to the bottom of the page

Moonwolf

GroupMembers
Posts43
JoinedAug 25, 2005

OK, I'll put it there, and someone can move it here if this is the right place for it

So far I've gotten the healer and undertaker snippets to work. Now that I know what the codebase is figuring out for itself, the nippets make much more sense, at least on the simple stuff.

Kathi
       
Pages:<< prev 1 next >>