[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUDs
. -> [Folder]  General
. . -> [Subject]  Error Compiling Act_wiz.c, (fixed)

Error Compiling Act_wiz.c, (fixed)

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


Pages: 1 2  

Posted by Dextermovies   (65 posts)  [Biography] bio
Date Tue 01 Dec 2009 12:11 AM (UTC)
Message
Here are there errors I get
act_wiz.c:2018: error: subscripted value is neither array nor pointer
act_wiz.c:2024: warning: implicit declaration of function ‘stc’
act_wiz.c:2028: error: subscripted value is neither array nor pointer
act_wiz.c:2031: warning: implicit declaration of function ‘set_pc_name’
act_wiz.c:2041: error: subscripted value is neither array nor pointer
act_wiz.c:2045: warning: implicit declaration of function ‘set_enter_room_text’
make: *** [obj/act_wiz.o] Error 1


Here is the command in question:
void do_form(CHAR_DATA *ch, char *argument)
{
    	char buf[MAX_STRING_LENGTH];

    	if (argument[0]=='\0')
    	{
		send_to_char("Change your form to resemble what?\n\r",ch);
		return;
    	}
    
	if (!str_cmp(argument,"self") )
    	{
		if (!IS_AFFECTED(ch,AFF_POLYMORPH) && !IS_VAMPAFF(ch,VAM_DISGUISED))
		{
	    		send_to_char( "You already look like yourself!\n\r", ch );
	    		return;
		}
	
		stc("You transform back to your old form",ch);
    		sprintf(buf, "%s's form blurs and shifts to resemble %s.",	ch->name,argument);
    		act(buf,ch,NULL,NULL,TO_ROOM);
		REMOVE_BIT(ch->affected_by, AFF_POLYMORPH);
		REMOVE_BIT(ch->pcdata->stats[UNI_AFF], VAM_DISGUISED);
    		free_string( ch->morph );
    		ch->morph = str_dup( "" );
		set_pc_name(ch, ch->pcdata->switchname);
		return;
    	}

    	sprintf(buf, "%s's form blurs and shifts to resemble %s.",	ch->name,argument);
    	act(buf,ch,NULL,NULL,TO_ROOM);
    	set_pc_name(ch, argument);
    	free_string( ch->morph );
    	ch->morph = str_dup( argument );
    	SET_BIT(ch->affected_by, AFF_POLYMORPH);
    	SET_BIT(ch->pcdata->stats[UNI_AFF], VAM_DISGUISED);    
    	send_to_char("Your form blurs and shifts to resemble ",ch);
    	send_to_char(argument,ch);
    	send_to_char(".\n\r",ch);
    	set_enter_room_text(ch, "");
    	return;
}


If you need any other info please let me know, I am new to coding muds
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #1 on Tue 01 Dec 2009 01:17 AM (UTC)
Message
What lines are what?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Dextermovies   (65 posts)  [Biography] bio
Date Reply #2 on Tue 01 Dec 2009 01:33 AM (UTC)
Message
		if (!IS_AFFECTED(ch,AFF_POLYMORPH) && !IS_VAMPAFF(ch,VAM_DISGUISED))

REMOVE_BIT(ch->affected_by, AFF_POLYMORPH);

SET_BIT(ch->pcdata->stats[UNI_AFF], VAM_DISGUISED);    
[\code]
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Tue 01 Dec 2009 09:43 AM (UTC)
Message
You gave error messages with 6 lines: 2018, 2024, 2028, 2031, 2041 and 2045.

Your recent post doesn't clarify that much. Can you indicate on the original post which of the lines have those lines numbers (eg. put a comment at the end of each line).

Also, are there other messages further up, like missing include files?


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Dextermovies   (65 posts)  [Biography] bio
Date Reply #4 on Tue 01 Dec 2009 12:12 PM (UTC)

Amended on Wed 02 Dec 2009 03:13 AM (UTC) by Nick Gammon

Message

2006void do_form(CHAR_DATA *ch, char *argument)
2007{
2008    	char buf[MAX_STRING_LENGTH];
2009
2010    	if (argument[0]=='\0')
2011  	{
2012		send_to_char("Change your form to resemble what?\n\r",ch);
2013		return;
2014    	}
2015    
2016	if (!str_cmp(argument,"self") )
2017    	{
2018		if (!IS_AFFECTED(ch,AFF_POLYMORPH) && !IS_VAMPAFF(ch,VAM_DISGUISED))
2019		{
2020	    		send_to_char( "You already look like yourself!\n\r", ch );
2021	    		return;
2022		}
2023	
2024		stc("You transform back to your old form",ch);
2025    		sprintf(buf, "%s's form blurs and shifts to resemble %s.",	ch->name,argument);
2026    		act(buf,ch,NULL,NULL,TO_ROOM);
2027		REMOVE_BIT(ch->affected_by, AFF_POLYMORPH);
2028		REMOVE_BIT(ch->pcdata->stats[UNI_AFF], VAM_DISGUISED);
2029    		free_string( ch->morph );
2030    		ch->morph = str_dup( "" );
2031		set_pc_name(ch, ch->pcdata->switchname);
2032		return;
2033    	}
2034
2035    	sprintf(buf, "%s's form blurs and shifts to resemble %s.",	ch->name,argument);
2036   	act(buf,ch,NULL,NULL,TO_ROOM);
2037    	set_pc_name(ch, argument);
2038    	free_string( ch->morph );
2039    	ch->morph = str_dup( argument );
2040    	SET_BIT(ch->affected_by, AFF_POLYMORPH);
2041    	SET_BIT(ch->pcdata->stats[UNI_AFF], VAM_DISGUISED);    
2041    	send_to_char("Your form blurs and shifts to resemble ",ch);
2042    	send_to_char(argument,ch);
2043    	send_to_char(".\n\r",ch);
2044    	set_enter_room_text(ch, "");
2045    	return;
2046 }  



Move every thing up one line, there seems to be a one line discrepancy in my code :(

And no there is no ini file missing errors or warnings :(
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #5 on Tue 01 Dec 2009 05:00 PM (UTC)
Message
Does REMOVE_BIT work in other places?

Are you sure you aren't suppose to be using xREMOVE_BIT?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Dextermovies   (65 posts)  [Biography] bio
Date Reply #6 on Tue 01 Dec 2009 05:17 PM (UTC)

Amended on Tue 01 Dec 2009 05:33 PM (UTC) by Dextermovies

Message
Yes it works in other places, After adding the x I now get This

act_wiz.c: In function ‘do_form’:
act_wiz.c:2018: error: subscripted value is neither array nor pointer
act_wiz.c:2024: warning: implicit declaration of function ‘stc’
act_wiz.c:2027: warning: implicit declaration of function ‘xREMOVE_BIT’
act_wiz.c:2028: error: subscripted value is neither array nor pointer
act_wiz.c:2031: warning: implicit declaration of function ‘set_pc_name’
act_wiz.c:2040: warning: implicit declaration of function ‘xSET_BIT’
act_wiz.c:2041: error: subscripted value is neither array nor pointer
act_wiz.c:2045: warning: implicit declaration of function ‘set_enter_room_text’
make: *** [obj/act_wiz.o] Error 1
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #7 on Tue 01 Dec 2009 05:40 PM (UTC)
Message
If you comment out REMOVE_BIT(ch->affected_by, AFF_POLYMORPH); does it remove one error?

Does a different AFF work instead of polymorph?

Does REMOVE_BIT(ch->affected_by, AFF_POLYMORPH); in a different code section work?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Dextermovies   (65 posts)  [Biography] bio
Date Reply #8 on Tue 01 Dec 2009 11:12 PM (UTC)
Message
Yes that removes an error.
I am un sure as it is not my code, I am redoing TBW ( The Beast Within )
And yes it does work other places.
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #9 on Wed 02 Dec 2009 01:48 AM (UTC)
Message
It works in other places? Other files, or other functions?

If other files, sounds like you're missing an include somewhere or missing externs.

If another function in the same file, then I have no idea. That wouldn't make much sense.

What is UNI_AFF? Where is it declared?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Dextermovies   (65 posts)  [Biography] bio
Date Reply #10 on Wed 02 Dec 2009 02:39 AM (UTC)
Message
UNI_AFF is an AFF made after the orignal creator of TBW Unifex .... it is defined in dystopia.h

It was a diff file, soi I must be missing a include some where .., thanks
[Go to top] top

Posted by Dextermovies   (65 posts)  [Biography] bio
Date Reply #11 on Wed 02 Dec 2009 08:20 PM (UTC)
Message
Nope I am not missing an include
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #12 on Wed 02 Dec 2009 08:22 PM (UTC)
Message
Can you show the declaration for ch->pcdata->stats? UNI_AFF and VAM_DISGUISED too.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Dextermovies   (65 posts)  [Biography] bio
Date Reply #13 on Wed 02 Dec 2009 10:04 PM (UTC)
Message
Found in dystopia.h That is not all of pc data.

struct pc_data
{
int            stats;
}

I did not find any thing else not related to other mud classes in the code for it.


AFF_UNI


#define IS_VAMPAFF(ch, sn)	(IS_SET((ch)->pcdata->stats[UNI_AFF], (sn)))

#define UNI_AFF		1 /* vampaff */



Nothing for the last one.


[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #14 on Wed 02 Dec 2009 10:19 PM (UTC)
Message
It's impossible that stats is just an int and yet used as an array. That code could never have possibly worked. Where did you get this source?

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] 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.


52,684 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]