Welcome to the Builder Academy

Question Skill wear off messages

More
29 Apr 2021 23:05 #9844 by JTP
Replied by JTP on topic Skill wear off messages
Had forgotten one ) in the last Line but i still get error
Attachments:

Please Log in or Create an account to join the conversation.

More
29 Apr 2021 23:12 #9845 by JTP
Replied by JTP on topic Skill wear off messages
Here is the code
Attachments:

Please Log in or Create an account to join the conversation.

More
30 Apr 2021 17:00 #9846 by thomas
Replied by thomas on topic Skill wear off messages
Ah, now I see. You know, this is what happens when I write code directly into an answer and you copy it without understanding what it does.

There are two problems. First off, I asked you to add the second log lines a line too low, it needs to be immediaely following the first log() or it breaks the logic of the function.
Secondly, the comma should have been a semicolon at the end there. Like this:
Code:
+ log("Wearoff: char: %s, af->spell: %d, wear_off_msg: %s", GET_NAME(i), af->spell, spell_info[af->spell].wear_off_msg); + log("((%d > 0) && (%d <= %d)): %d, second check: %d", af->spell, af->spell, MAX_SPELLS, ((af->spell > 0) && (af->spell <= MAX_SPELLS))); if ((af->spell > 0) && (af->spell <= MAX_SPELLS)) if (!af->next || (af->next->spell != af->spell) || (af->next->duration > 0)) if (spell_info[af->spell].wear_off_msg) send_to_char(i, "%s\r\n", spell_info[af->spell].wear_off_msg); affect_remove(i, af);

Please Log in or Create an account to join the conversation.

More
01 May 2021 04:22 #9847 by JTP
Replied by JTP on topic Skill wear off messages
Ok adding this give me one error:

magic.c:72: error: `af_spell’ undeclared (first use in this function)

Please Log in or Create an account to join the conversation.

More
01 May 2021 06:47 #9848 by thomas
Replied by thomas on topic Skill wear off messages
Have a look at your code. I never wrote that, so it's probably a typo on your part.

However, this makes me seriously reconsider helping out in the future. Even if you are not a coder, when you get an error message, double check your input first.

Please Log in or Create an account to join the conversation.

More
01 May 2021 18:49 - 01 May 2021 21:32 #9849 by JTP
Replied by JTP on topic Skill wear off messages
Ok I had made a typo

now it’s 100% the same as you posted But it says to few arguments for format when I compile it
Last edit: 01 May 2021 21:32 by JTP.

Please Log in or Create an account to join the conversation.

Time to create page: 0.236 seconds