Porting SWR Engineering to SMAUG as a crafting class

Posted by Imake13 on Sun 24 Dec 2006 05:24 AM — 12 posts, 36,962 views.

USA #0
So I'm a long time smaug/swr builder who has decided to teach himself to code recently. I run smaug and swr on my box with cygwin and build in them. Eventually I want to release both of my area collections as a new stock for both codebases. I'd like to learn to code so I can clean up and customize both codebases as well.

So here is what I am trying to figure out now. I love that you can craft your own items in SWR. I was really suprised when I first got into SMAUG that this wasn't possible. So I have been thinking that it would be cool to port it over to SMAUG. I really have no idea how to do this, and I was curious if either:

a. someone would like to do this and then make it available to the community

b. someone would like to help me do this, keeping in mind im a pretty big newb

or c. someone would like to come and do it for me...


thoughts?
USA #1
Other than some skills, I don't think it's SWR specific. A few constants here and there and you should be good. Try copying the create item function over to Smaug and see what errors you get.
USA #2
Alternatively, there are forging/crafting snippets for Smaug floating around out there too. You might check some of the major snippet repositories like www.mudbytes.net for one of them.
USA #3
well let's see...

for starters:

structure has no member named 'top_level'

and

structure has no member named 'dest_buf_2'


those are the worst... i get about 2 miles of errors involving them.


thoughts?
USA #4
You copied the create item function?

top_level is a level, so replace that with just level. Can you show us the line that has dest_buf_2?
USA #5
i have cygwin... so how do i get a log of my errors? do i just have to type it out?
USA #6
Right click->Mark, highlight then hit enter. That's how you can copy text.
USA #7
/*
case 1:
if( !ch->dest_buf )
return;
if( !ch->dest_buf_2 )
return;
strcpy( arg, ch->dest_buf );
DISPOSE( ch->dest_buf );
strcpy( arg2, ch->dest_buf_2 );
DISPOSE( ch->dest_buf_2 );
break;

case SUB_TIMER_DO_ABORT:
DISPOSE( ch->dest_buf );
DISPOSE( ch->dest_buf_2 );
ch->substate = SUB_NONE;
send_to_char( "&RYou are interupted and fail to finish your work.\n\r", ch );
return;
*/
}
USA #8
i commented it out for the sake of trying to compile... but yeah... it's borked.
USA #9
Argh, it's a timed skill? Try commenting out the lines that contain dest_buf_2.
USA #10
i got a core dump and this error when i just commented out those lines.

$ 4 [main] smaug 57536 _cygtls::handle_exceptions: Error while dumping sta
te (probably corrupted stack)
Segmentation fault (core dumped)
$
USA #11
You mean it compiled? That was pretty easy. So it's crashing when you try to use it now?