Welcome to the Builder Academy

Question Skill wear off messages

More
07 Apr 2021 10:08 - 07 Apr 2021 14:34 #9793 by JTP
Skill wear off messages was created by JTP
So for a skill like meditate, then I would like it to actually tell players that they stopped meditating.

I set an aff type skill_meditate lasting 2 ticks. But when those two ticks are gone. They never know that they no longer meditate.

have anyone made a skill wear off system, and maybe could show how you made it work ?

much appreciated


Also I have this check:
if(affected_by_spell(ch,SKILL_MEDITATE)) {
 send_to_char(ch, "Your mind is already meditating, so rest and relax.\n\r"); 
return;
 }

But all I get is: Nah... You feel too relaxed to do that..

any idea why ?


 
Last edit: 07 Apr 2021 14:34 by JTP.

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

More
08 Apr 2021 21:02 #9795 by thomas
Replied by thomas on topic Skill wear off messages
I think the meditation-command has the wrong "minimum position" set in the command list. You're seeing this message because you're in POS_RESTING but the lowest level is something like POS_SITTING or POS_STANDING.

About wear_off-messages: they already exist, but for spells. Since skills are a "spell" structure, you could easily expand them with the wear_off_msg:
github.com/tbamud/tbamud/blob/dceb563a9b.../spell_parser.c#L704
Code:
-#define skillo(skill, name) spello(skill, name, 0, 0, 0, 0, 0, 0, 0, NULL); +#define skillo(skill, name, wearoff) spello(skill, name, 0, 0, 0, 0, 0, 0, 0, wearoff);
A bit lower in the same file:
Code:
-  skillo(SKILL_BACKSTAB, "backstab"); -  skillo(SKILL_BASH, "bash"); -  skillo(SKILL_HIDE, "hide"); -  skillo(SKILL_KICK, "kick"); -  skillo(SKILL_PICK_LOCK, "pick lock"); -  skillo(SKILL_RESCUE, "rescue"); -  skillo(SKILL_SNEAK, "sneak"); -  skillo(SKILL_STEAL, "steal"); -  skillo(SKILL_TRACK, "track"); -  skillo(SKILL_WHIRLWIND, "whirlwind"); -  skillo(SKILL_BANDAGE, "bandage"); -  skillo(SKILL_MEDITATE, "meditate"); +  skillo(SKILL_BACKSTAB, "backstab", NULL); +  skillo(SKILL_BASH, "bash", NULL); +  skillo(SKILL_HIDE, "hide", NULL); +  skillo(SKILL_KICK, "kick", NULL); +  skillo(SKILL_PICK_LOCK, "pick lock", NULL); +  skillo(SKILL_RESCUE, "rescue", NULL); +  skillo(SKILL_SNEAK, "sneak", NULL); +  skillo(SKILL_STEAL, "steal", NULL); +  skillo(SKILL_TRACK, "track", NULL); +  skillo(SKILL_WHIRLWIND, "whirlwind", NULL); +  skillo(SKILL_BANDAGE, "bandage", NULL); +  skillo(SKILL_MEDITATE, "meditate", "You are no longer meditating.");

 

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

More
08 Apr 2021 22:07 #9796 by JTP
Replied by JTP on topic Skill wear off messages
In interpreter.c meditate was set to STANDING...if I change to RESTING then I can keep typing meditate in game and it has no idea that it’s already on.

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

More
09 Apr 2021 21:58 #9798 by thomas
Replied by thomas on topic Skill wear off messages
Are you sure you set the affection on the character? Because the check you listed above should work if you do.

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

More
09 Apr 2021 21:59 #9799 by JTP
Replied by JTP on topic Skill wear off messages
Stat player clearly shows meditate 3 ticks

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

More
09 Apr 2021 22:01 #9800 by thomas
Replied by thomas on topic Skill wear off messages
I'd debug a bit if I were you - add in a couple of log statements to see what's going on, maybe run through gdb if you feel up to it.

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

Time to create page: 0.197 seconds