Welcome to the Builder Academy

Question flying bug - down to 1 little issue, then we have a snippet.Still need help pls

More
03 May 2013 17:55 - 03 May 2013 17:57 #2093 by JTP
Replied by JTP on topic flying bug
I did that also...

i only need to change a players POS_STANDING to POS_FLYING

ergo the ASPELL(spell_fly)
dunno what code should be, tryed the skill do_fly and changed to ASPELL

that compiled but people still walked and was standing, and score still says: you are standing.
Last edit: 03 May 2013 17:57 by JTP.

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

More
04 May 2013 08:44 #2098 by thomas
Replied by thomas on topic flying bug
Adding a new position to the mud is a rather large endavour. ("grep -ne "POS_|GET_POS\(" *.[ch]" to see what I mean).

However, to change a charaters position, just do "GET_POS(ch) = POS_FLYING;".

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

More
04 May 2013 13:48 - 04 May 2013 13:51 #2099 by Fizban
Replied by Fizban on topic flying bug
I don't think adding POS_FLYING is worth the effort, I'd just check for AFF_FLYING, instead. Otherwise anything that checks for POS_STANDING will return as false when FLYING, which probably isn't ideal since generally the checks for POS_STANDING are made with the assumption that any non-sitting/sleeping position is standing.

As such you'd need to change most instances of:

if (GET_POS(ch) == POS_STANDING)

to:

if ((GET_POS(ch) == POS_STANDING) || (GET_POS(ch) == POS_FLYING))

or else things would break.
Last edit: 04 May 2013 13:51 by Fizban.

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

More
04 May 2013 13:57 - 04 May 2013 14:07 #2100 by JTP
Replied by JTP on topic flying bug
Well i was able to use AFF_FLYING some places, but this needs POS_FLYING for do_score see below:

Also look, to see whats in a room is made of POS_STANDING like jtp is standing here.
Code:
switch (GET_POS(ch)) { case POS_DEAD: send_to_char(ch, "You are DEAD!\r\n"); break; case POS_MORTALLYW: send_to_char(ch, "You are mortally wounded! You should seek help!\r\n"); break; case POS_INCAP: send_to_char(ch, "You are incapacitated, slowly fading away...\r\n"); break; case POS_STUNNED: send_to_char(ch, "You are stunned! You can't move!\r\n"); break; case POS_SLEEPING: send_to_char(ch, "You are sleeping.\r\n"); break; case POS_RESTING: send_to_char(ch, "You are resting.\r\n"); break; case POS_SITTING: send_to_char(ch, "You are sitting.\r\n"); break; case POS_FIGHTING: send_to_char(ch, "You are fighting %s.\r\n", FIGHTING(ch) ? PERS(FIGHTING(ch), ch) : "thin air"); break; case POS_STANDING: send_to_char(ch, "You are standing.\r\n"); break; case POS_FLYING: send_to_char(ch, "You are flying.\r\n"); break; default: send_to_char(ch, "You are floating.\r\n"); break; }
.
Last edit: 04 May 2013 14:07 by JTP.

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

More
04 May 2013 14:02 - 04 May 2013 14:07 #2101 by JTP
Replied by JTP on topic flying bug
also rest, sit, sleep etc uses POS_ like do_sleep, would need POS_FLYING so people cant sleep while flying:

Code:
ACMD(do_sleep) { switch (GET_POS(ch)) { case POS_STANDING: case POS_SITTING: case POS_RESTING: send_to_char(ch, "You go to sleep.\r\n"); act("$n lies down and falls asleep.", TRUE, ch, 0, 0, TO_ROOM); GET_POS(ch) = POS_SLEEPING; break; case POS_SLEEPING: send_to_char(ch, "You are already sound asleep.\r\n"); break; case POS_FIGHTING: send_to_char(ch, "Sleep while fighting? Are you MAD?\r\n"); break; case POS_FLYING: send_to_char(ch, "Sleep while flying? Are you MAD?\r\n"); break; default: send_to_char(ch, "You stop floating around, and lie down to sleep.\r\n"); act("$n stops floating around, and lie down to sleep.", TRUE, ch, 0, 0, TO_ROOM); GET_POS(ch) = POS_SLEEPING; break; } }
.
Last edit: 04 May 2013 14:07 by JTP.

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

More
05 May 2013 00:28 #2108 by Fizban
Replied by Fizban on topic flying bug
Neither of those things require adding POS_FLYING to achieve.

For the first:
Code:
case POS_STANDING: + if (AFF_FLAGGED(ch, AFF_FLYING)) + send_to_char(ch, "You are flying.\r\n"); + else send_to_char(ch, "You are standing.\r\n"); break;

For the second:
Code:
ACMD(do_sleep) { + if (AFF_FLAGGED(ch, AFF_FLYING)) + { + send_to_char(ch, "You need to land before you can do that!\r\n"); + return; + } switch (GET_POS(ch)) {

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

Time to create page: 0.216 seconds