Welcome to the Builder Academy

Question Foe condition

More
03 Aug 2018 23:06 #8164 by Parnassus
Replied by Parnassus on topic Foe condition
Now that I have a current version of TBA, I wanted to play with snippets. I'm hoping that someone can fix this snippet for me. I know that this is totally irritating for anyone who understands code because I treated it like a frankentrigger .

I got so many errors that I took it apart, shook it up, stuck parts of it into the existing code and left parts of it out. (Hmm, I wonder what these three screws are supposed to be for...) but now it actually runs (sorta).

I understand that the first error is that it says:
m) Mana Points M) Max Mana Points\r\n");
g) Gold M) Alignment\r\n");
and yeah, that doesn't go well. The alignment code is actually "a".

So this is what the output looks like:
> display all
100h(101H) 100m(100M) 99v(100V) XP:172021 Gold:6757 MoOkay.
The part after Gold:6757 is in red because the prompt thinks it's the mob prompt. Part of the text is a repeat of the last line sent to the screen.
Here's what happens while fighting:
99h(101H) 100m(100M) 99v(100V) XP:172030 Gold:6757 Align:(10%) Awful condition > >
-That 10% after the align is actually the mob percentage.

> display eEgax
XP:172081 Gold:6767 TNL:77919 Align:56 Mob: N/A> >
Here's what happens while fighting:
XP:172113 Gold:6767 TNL:77919 Align:56(20%) Pretty hurt > >
You can see that this is not too bad except that the (28%) looks like alignment when it's actually mob percentages.

This one is even better!
101h(101H) 100m(100M) 100v(100V) XP:172304 Gold:6767 AligThe creepy crawler is incapacitated and will slowly
die, if not aided.
(-30%)
Bleeding awfully from big wounds > >

First, I think the line length is too short. You can see that by the way it cuts off.
Second, I changed :
count = snprintf(prompt + len, sizeof(prompt) - len, " %sMob: %sN/A", CCNRM(d->character, C_NRM), CCRED(d->character, C_NRM));
to
count = snprintf(prompt + len, sizeof(prompt) - len, " %sMob: %sN/A", CCRED(d->character, C_NRM), CCNRM(d->character, C_NRM));
just to stop all the text on screen from being red. It seems to have also added an extra > to the prompt.

I've probably also done a lot of things in the most inefficient way possible. I also thought that the colours for hp, mana, moves were different but they're now all white. I'm not sure about that though.

This is the mess the current code is in:
Warning: Spoiler!

If anyone wants to play with this trigger in its original form, there's a link further up but I'll repeat it .

Thanks for any help you can give me. I forgot that the bespoke prompt was there so I might try that one next but I'm still finding patches confusing.

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

More
04 Aug 2018 09:33 #8167 by WhiskyTest
Replied by WhiskyTest on topic Foe condition
Bespoke prompt is running on After the Breaking MUD, recommend testing it there and see if it meets your needs. Happy to help patch it in if you have questions

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

More
05 Aug 2018 16:45 #8173 by Parnassus
Replied by Parnassus on topic Foe condition
I think my brain is in shutdown mode right now but I've downloaded the bespoke and I'll look at it again when I have some time. So far the fancy-prompt is doing okay as long as I don't overload it. The part I really look forward to in your bespoke is the newline option. I've played on a mud with that prompt option and it just makes the prompt so much more versatile!

And, yeah, when I get around to it, I'll be in touch for more help :) Thanks.

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

More
05 Aug 2018 16:53 #8174 by Sascha
Replied by Sascha on topic Foe condition
The prompt is amazing and it's running beautifully at After the Breaking. It does everything that was on my wish list.

Will you stand against the coming Storm? After the Breaking: STORMRIDERS MUD - atbmud.dune.net port 4000

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

More
29 Aug 2018 02:15 #8196 by Parnassus
Replied by Parnassus on topic Foe condition
The reason my prompt looks so odd is that the line is cut. It turns out that there's a reason the snippet says:
/* Note, prompt is truncated at MAX_PROMPT_LENGTH chars (structs.h) */

I raised the number and everything is now working fine.

structs.h
-#define MAX_PROMPT_LENGTH 96 /**< Max length of prompt */
+#define MAX_PROMPT_LENGTH 250 /**< Max length of prompt */

I didn't use the snippet "as is" so I can't verify that it can be put in and run without adjustments.

Since it's working pretty much the way I wanted it, it'll probably be a bit longer before I check out the bespoke prompt. Sorry about that.

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

More
29 Aug 2018 04:36 #8199 by JTP
Replied by JTP on topic Foe condition
The prompt code worked for me when i added it long time ago. I also had to increase prompt length though.

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

Time to create page: 0.316 seconds