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, Google, Yandex, Bing

Members: 0
Guests: 17
Stats
Files
Topics
Posts
Members
Newest Member
481
3,739
19,386
621
KellieBusb
Today's Birthdays
Rane (42)
Related Links
» SmaugMuds.org » General » Smaug Snippets » Stat Reroll error
Forum Rules | Mark all | Recent Posts

Stat Reroll error
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 May 21, 2009, 12:02 pm
Go to the top of the page
Go to the bottom of the page

Hanaisse
Magician
GroupMembers
Posts196
JoinedNov 25, 2007

Adding the stat roller to my SmaugFUSS 1.9 and running into some issues. The snippet is obviously written for Smaug 1.4a. Could someone tell me how to fix this error?

comm.c: In function void nanny_get_new_race(DESCRIPTOR_DATA*, const char*)
comm.c:2328: error: buf was not declared in this scope


This is the line of code from the snippet;

snprintf( buf, MAX_STRING_LENGTH, "\r\nStr: %d  Int: %d  Wis: %d  Dex: %d  Con: %d  Cha: %d  Lck: %d\r\nKeep? (Y/N)",


       
Post is unread #2 May 21, 2009, 12:04 pm
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

It's filling up a temporary buffer, and will later (presumably) print that buffer to the character. You can declare the buffer by doing something like char buf[MAX_INPUT_LENGTH] but if you don't also send it, it's kind of an exercise in futility.
       
Post is unread #3 May 21, 2009, 12:20 pm
Go to the top of the page
Go to the bottom of the page

Hanaisse
Magician
GroupMembers
Posts196
JoinedNov 25, 2007

It's already declared with a char buf[MAX_STRING_LENGTH]. How do I get it to send?
       
Post is unread #4 May 21, 2009, 1:02 pm
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

Well, apparently it's not already declared, because otherwise you wouldn't have gotten the error... :wink:

You would send it using one of the normal methods, like send_to_char or whatever.
       
Post is unread #5 May 21, 2009, 3:17 pm
Go to the top of the page
Go to the bottom of the page

Hanaisse
Magician
GroupMembers
Posts196
JoinedNov 25, 2007

Hmm, it was declared in the function below it and I thought it was in this function but it was declaring an arg. So I added the buf below that and it compiles and works clean.

My first attempt at playing with the code and I actually managed to write a new nanny function :)
       
Pages:<< prev 1 next >>