Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
Bug in do_drag( )
Oct 8, 2017, 12:40 am
By GatewaySysop
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Beastmaster 6D sound files
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex, Bing, Yahoo!, DotBot, Sogou

Members: 0
Guests: 3
Stats
Files
Topics
Posts
Members
Newest Member
476
3,704
19,231
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SWR FUSS » Trying to install EXT_BVs for...
Forum Rules | Mark all | Recent Posts

Trying to install EXT_BVs for SWR
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Oct 5, 2005, 5:12 pm
Go to the top of the page
Go to the bottom of the page

Halcyon
Magician
GroupMembers
Posts187
JoinedApr 12, 2005

I'm trying to install extended bitvectors into SWRFUSS, and after figuring out how I wanted it done, I got to work, and so far, I haven't had much trouble. I started by trying to convert act flags, which, yes, is a bit involved. It's going slowly but smoothly, though.

And now, it hits.

Area files.

Here's how SWRFUSS prints out act flags for mob in area files stock:

      fprintf( fpout, "%d %d %d %c\n", pMobIndex->act,
               pMobIndex->affected_by, pMobIndex->alignment, complexmob ? 'Z' : 'S' );


Ok, now, obviously, when load_mobile calls to that line, it's going to expect pMobIndex->act to be a single integer. If I change it to read an extended bitvector, what's going to happen is that it's not going to take just the initial integer in, it's going to take affected_by and alignment as well. So I can't change it to print out an extended bitvector just like that. Old area files will just vomit and everything'll die.

If SWR used Version numbers for Area files stock, then this wouldn't be a problem... But it doesn't. So my question is, is there any easier way to deal with this than to add version support to SWR area files? That's gonna be a pain, and I'd love to avoid it if at all possible. Any ideas?
       
Post is unread #2 Oct 5, 2005, 5:41 pm   Last edited Oct 5, 2005, 5:41 pm by Samson
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Have you tried simply doing this?

fprintf( fpout, "%s %d %d %c\n", print_bitvector( &pMobIndex->act ),
               pMobIndex->affected_by, pMobIndex->alignment, complexmob ? 'Z' : 'S' );


If memory serves, it isn't necessary to do anything special to get it to write these. And reading them should be as simple as using fread_bitvector in the right spot in db.c. I converted several of these and I don't recall ever having to use versioning support to read older files.

You will have to avoid using print_bitvector more than once in the same fprintf call if you convert more, but that's easy enough to do as well.
       
Post is unread #3 Oct 5, 2005, 5:53 pm
Go to the top of the page
Go to the bottom of the page

Halcyon
Magician
GroupMembers
Posts187
JoinedApr 12, 2005

Hrm...

If that's the case, then it's possible I misunderstood how EXT_BVs are read.

I'll just have to try it that way and see what happens. I just asked to make sure, because I didn't want the nuisance of corrupting all my area files with a silly mistake. I'll see what happens.
       
Post is unread #4 Oct 5, 2005, 6:04 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Make backups. Best thing you can do when testing potentially damaging modifications. Then you don't need to worry about hosing them at all.
       
Post is unread #5 Oct 5, 2005, 6:28 pm   Last edited Oct 5, 2005, 7:07 pm by Halcyon
Go to the top of the page
Go to the bottom of the page

Halcyon
Magician
GroupMembers
Posts187
JoinedApr 12, 2005

*Post deleted*

Just asking about a problem that arose from the fact that I didn't have the sense to change "act" from an int to an EXT_BV in the char_data array...

>.> I'm gonna go back to my corner now.

And on that note, thanks for the advice, the conversion went perfectly. :)
       
Post is unread #6 Oct 6, 2005, 7:19 pm
Go to the top of the page
Go to the bottom of the page

Halcyon
Magician
GroupMembers
Posts187
JoinedApr 12, 2005

...Great, now I have a new problem.

I tried to apply extended bitvectors for affects, but I'm having an issue with the way the race_table in SWR stores data on bitvectors.

If it's a single bitvector, it works fine... No problems. But one of the races uses TWO bitvectors as an argument, like so:

    "Quarren", AFF_AQUA_BREATH + AFF_INFRARED, -1, +1, 0, +1, -1, 0, 0, 0, 0, 0, 0, 0, 0, LANG_MON_CALAMARI},


Now, in nanny and in do_save, I have it set to do this to apply race affects:

			ch->affected_by = multimeb( race_table[ch->race].affected );


It seemed to work okay for the most part, but when I log in or save as this particular race... KA-BOOM.

I don't really know what to do about it. =( Any ideas?
       
Post is unread #7 Oct 6, 2005, 8:03 pm
Go to the top of the page
Go to the bottom of the page

Halcyon
Magician
GroupMembers
Posts187
JoinedApr 12, 2005

It's actually starting to show that I'm having that problem in a lot of places, such as spell_affectchar. I had it call to this:

af.bitvector = multimeb( saf->bitvector );


Instead of just this:

af.bitvector = saf->bitvector


...Because the latter doesn't work anymore. It just doesn't work right at all. Any suggestions?
       
Post is unread #8 Oct 6, 2005, 8:18 pm   Last edited Oct 6, 2005, 10:03 pm by Halcyon
Go to the top of the page
Go to the bottom of the page

Halcyon
Magician
GroupMembers
Posts187
JoinedApr 12, 2005

...I'm just about ready to give up on this project.

The conversion for acts that I thought went okay apparently didn't.

Player flags: autoexits blank combine prompt ansi autocred wrist2

...Wrist2 is a damned wear_loc flag. Anybody know what's going on here? I'm losing my mind trying to figure this mess out. I'd really like to get these extended bitvectors in to save some work later, but this is driving me insane.

Edit: This seems to be a completely isolated incident. It probably happened while I was converting between a few different methods.
       
Post is unread #9 Oct 6, 2005, 8:44 pm
Go to the top of the page
Go to the bottom of the page

Greven
Magician
GroupMembers
Posts204
JoinedMar 5, 2005

As for your races, I beleive that you can actually assign a reference from a function into the structure definition, so you could have
"Quarren", AFF_AQUA_BREATH + AFF_INFRARED, -1, +1, 0, +1, -1, 0, 0, 0, 0, 0, 0, 0, 0, LANG_MON_CALAMARI},
become
"Quarren", multimeb(AFF_AQUA_BREATH,AFF_INFRARED,-1), -1, +1, 0, +1, -1, 0, 0, 0, 0, 0, 0, 0, 0, LANG_MON_CALAMARI},
This is untested as I have completely redone the way that I do my races.

As for your spell_affectchar, what is saf->bitvector defined? I can't access the code to check at the moment, but I don't think you need meb at all, you SHOULD be able to just define it straight across, I do it in several places in my code.

As for your player flag print, where did you get the function from? smaug?
       
Post is unread #10 Oct 6, 2005, 10:12 pm
Go to the top of the page
Go to the bottom of the page

Halcyon
Magician
GroupMembers
Posts187
JoinedApr 12, 2005

Well, Greven and I discussed the problem on AIM, and after we tried a bunch of his ideas, we completely drew a blank. I dunno what to do at this point, really, so odds are, I'm just gonna drop making extended bitvector affects.

When I think about it, it kinda seems like a bad idea, because when I looked at Smaug, it seemed as though actually using a bitvector past 31 doesn't work right normally, and requires some special processing. I found weird things like "APPLY_EXT_AFFECT" or something like that, and there were only 3 calls to it. Maybe it's just a leftover or something, I dunno. Anyways, thanks for trying folks.
       
Post is unread #11 Oct 6, 2005, 11:12 pm
Go to the top of the page
Go to the bottom of the page

Halcyon
Magician
GroupMembers
Posts187
JoinedApr 12, 2005

...Ok, forget the last thing I said.

I fiddled around a bit and finally got the majority of the previous problems under control, but now...

Affects aren't actually registering bitvectors when they're called, so using sneak, for example, affects a char with sneak for so and so many rounds with bits *NONE*. Which I can't figure out. The only explanation is that affect_modify isn't working right, but I can't figure out why not.
       
Pages:<< prev 1 next >>