Pages:<< prev 1 next >>


Conjurer

GroupMembers
Posts429
JoinedMar 7, 2005
Really scratching my head on this one. Flying mounts do not work in stock code. Surprised nobody noticed this long ago, but I guess I haven't play tested it until now either, so ...
Anyway, if you look in act_move.c, function will_fall( ), you'll see this:
Because of the way it is written, the check still works as expected with no mount, i.e. ch falls if not AFF_FLYING. The problem is that, presumably, ch will be most often using a flying mount when ch can't fly themselves. And therein lies the quandary. The way this is written, with the OR condition, the mere fact that ch isn't flying is sufficient to cause the check to return TRUE and subsequently drop ch into the room below.
What I believe they meant to do was this:
That is to say, make it so that ch will fall if not either AFF_FLYING or mounted on a mobile that is AFF_FLYING.
Hope that helps to get your flying mounts working as intended.

Anyway, if you look in act_move.c, function will_fall( ), you'll see this:
bool will_fall( CHAR_DATA * ch, int fall ) { if( xIS_SET( ch->in_room->room_flags, ROOM_NOFLOOR ) && CAN_GO( ch, DIR_DOWN ) && ( !IS_AFFECTED( ch, AFF_FLYING ) || ( ch->mount && !IS_AFFECTED( ch->mount, AFF_FLYING ) ) ) )
Because of the way it is written, the check still works as expected with no mount, i.e. ch falls if not AFF_FLYING. The problem is that, presumably, ch will be most often using a flying mount when ch can't fly themselves. And therein lies the quandary. The way this is written, with the OR condition, the mere fact that ch isn't flying is sufficient to cause the check to return TRUE and subsequently drop ch into the room below.
What I believe they meant to do was this:
if ( xIS_SET( ch->in_room->room_flags, ROOM_NOFLOOR ) && CAN_GO( ch, DIR_DOWN )
&& !( IS_AFFECTED( ch, AFF_FLYING ) || ( ch->mount && IS_AFFECTED( ch->mount, AFF_FLYING ) ) ) )
That is to say, make it so that ch will fall if not either AFF_FLYING or mounted on a mobile that is AFF_FLYING.
Hope that helps to get your flying mounts working as intended.




Apprentice

GroupMembers
Posts86
JoinedAug 25, 2003
Hi, my codebase is not default, but look also in move_char
if ( IS_NPC(ch) && xIS_SET(ch->act, ACT_MOUNTED) )
i think is better
if ( IS_NPC(ch) && xIS_SET(ch->act, ACT_MOUNTED) && !fall )
try: room nofloor, dir down open and ride (you fly) a horse without fly.
The horse can't fall down.
bye
mat
if ( IS_NPC(ch) && xIS_SET(ch->act, ACT_MOUNTED) )
i think is better
if ( IS_NPC(ch) && xIS_SET(ch->act, ACT_MOUNTED) && !fall )
try: room nofloor, dir down open and ride (you fly) a horse without fly.
The horse can't fall down.
bye
mat


Conjurer

GroupMembers
Posts429
JoinedMar 7, 2005
Matteo2303 said:
Hi, my codebase is not default, but look also in move_char
if ( IS_NPC(ch) && xIS_SET(ch->act, ACT_MOUNTED) )
i think is better
if ( IS_NPC(ch) && xIS_SET(ch->act, ACT_MOUNTED) && !fall )
try: room nofloor, dir down open and ride (you fly) a horse without fly.
The horse can't fall down.
bye
mat
Kudos to Matteo, this is a good find.
In my code, it seems like will_fall( ) was forcing the PC rider to fall and moving the mount with him, but not necessarily injuring the mount in the fall as intended. Likewise, an NPC mounted on a flying NPC was not falling as expected. Making this change, I believe the mount should now fall and take the rider with, which is much better.

Some testing in a room with nofloor and a flying horse. Let's see what happens if we clip his wings by making him 'land' which removes the flying flag:
<!-- Produced by MUSHclient v 5.06 - www.mushclient.com --> <table border=0 cellpadding=5 bgcolor="#000000"> <tr><td> <pre><code><font size=2 face="FixedSys, Lucida Console, Courier New, Courier"><font color="#0"> </font><font color="#00FF00">In the Air </font><font color="#C0C0C0">You are flying in the air high above Darkhaven. You can see the whole countryside from here: It is truly a splendid sight to behold. Gazing upward, you see a bright rainbow. </font><font color="#008080">Exits: up down. </font><font color="#FF00FF">A nightmare is here, kicking at you with its flaming hooves. Thorin Oakenshield is here, upon A pitch-black nightmare. </font><font color="#C0C0C0"><</font><font color="#FFFF00">1979hp </font><font color="#00FFFF">900m </font><font color="#00FF00">1542mv</font><font color="#C0C0C0">> (Invis 65) force nightmare land </font><font color="#C0C0C0">A pitch-black nightmare lands. A pitch-black nightmare falls down. Thorin Oakenshield falls down upon A pitch-black nightmare. </font></font></code></pre> </td></tr></table>
And the aftermath below:
<!-- Produced by MUSHclient v 5.06 - www.mushclient.com --> <table border=0 cellpadding=5 bgcolor="#000000"> <tr><td> <pre><code><font size=2 face="FixedSys, Lucida Console, Courier New, Courier"><font color="#0"> </font><font color="#00FF00">Darkhaven Square </font><font color="#C0C0C0">You are standing within the expanse of the famous Darkhaven Square. A stone statue of occupies the square's center, surrounded by gardens of shrubbery which enhance the air of serenity and peace here in the center of the city. The main road lead away in the cardinal directions, while to the northeast and northwest are forested paths. The spires of a cathedral can be seen rising to the northwest. </font><font color="#008080">Exits: north east south west up northeast northwest. </font><font color="#808080">The corpse of Thorin Oakenshield lies here. </font><font color="#800000">A pool of spilled blood lies here. </font><font color="#FF00FF">A pitch-black nightmare is sprawled out here. </font><font color="#C0C0C0"><</font><font color="#FFFF00">1979hp </font><font color="#00FFFF">900m </font><font color="#00FF00">1540mv</font><font color="#C0C0C0">> (Invis 65) l nightmare The nightmare is a wholly evil being, sent out by the rulers of the lower planes to torment mortals. It vaguely resembles a horse, with a hide blacker than the darkest night, and hooves that burn with unholy fires. A pitch-black nightmare is almost dead. </font></font></code></pre> </td></tr></table>
Much better!
Thanks for sharing a important tweak to this fix!



Apprentice

GroupMembers
Posts86
JoinedAug 25, 2003
Hi, my english is so bad that I cant explain enoght what I mean in private message.
"!fall" fix it's part of fix, but not fix all the "bug"... I don't have enought time at this moment but I'll try to explain better than I can.
I compiled your codebase 1.9 and run for test and I linked two rooms in this way:
redit exit 5 1201
(and in room 1201)
redit exit 4 1200
(You can also add in room 1201 redit exit 0 1200 for go to north and test without use land command from room 1201. In room 1201 you can also remove private nomob flags if you want test also with mob only, but for now you need PC(rider) and NPC(horse) ).
then in room 1200:
minvo horse
mount horse
redit flags nofloor
the problem is that horse move from 1200 to 1201 don't using move_char but...
so all subroutine of move char are bypassed for horse.
Probably it's easy to fix.. I'm looking for this as soon as possible.
PS: try
Bye
mat
"!fall" fix it's part of fix, but not fix all the "bug"... I don't have enought time at this moment but I'll try to explain better than I can.
I compiled your codebase 1.9 and run for test and I linked two rooms in this way:
redit exit 5 1201
(and in room 1201)
redit exit 4 1200
(You can also add in room 1201 redit exit 0 1200 for go to north and test without use land command from room 1201. In room 1201 you can also remove private nomob flags if you want test also with mob only, but for now you need PC(rider) and NPC(horse) ).
ROOM 1200 | (down) ( up ) | ROOM 1201
then in room 1200:
minvo horse
mount horse
redit flags nofloor
<49hp 145m 110mv> <#1200> You're falling down... Thoric's Den - - - -<---- Vnum: 1201 ----------------------------->- -<-U-(*)--->- - - - [Exits: Up] +-----------+ You find yourself in a cozy little room. This is the place | | where Thoric comes to relax, and get inspired! Looking around | | yourself, you find this to be quite a comfortable, medieval | | room, which seems to be inside some sort of log cabin. There's | | a very nice looking leather chair here in front of a huge | @ | fireplace, with a good blaze going. On the mantle you see a | | fine assortment of pipes, and a couple jars of high quality | | pipeweed. On the floor you spot a full bear-skin rug in front | | of the fireplace, and you suddenly get the urge to make | | yourself comfortable in front of the fire with a mug of hot +-----------+ coffee, fill a pipe up with some pipeweed, relax and listen to tales of days long past. (Mount) A beautiful manor riding horse stands here. OUCH! You hit the ground! That really did HURT! <29hp 145m 110mv> <#1201> mst horse Mobile name: riding horse Vnum: 2455 Sex: neutral Room: 1201 Count: 4 Killed: 0 Str: 13 )( Int: 13 )( Wis: 13 )( Dex: 13 )( Con: 13 )( Cha: 13 )( Lck: 13 Level : 9 class : 03/warrior Race : 86/horse Hps : 127/127 Mana : 100/100 Move : 100/100 Hitroll : 2 Align : 200 Armorclass: 1 Damroll : 2 Wimpy : 0 Position : 12 Fighting: (none) Master : (none) Leader : (none) Hating : (none) Hunting: (none) Fearing : (none) Mob hitdie : 9d3+100 Mob damdie : 3d3+ 2 Index damdie : 3d3+ 2 NumAttacks : 0 MentalState: 0 EmotionalState: 0 Save versus: 0 0 0 0 0 Items: (0/5) Weight (0/140) Year: -1 Secs: 0 Timer: 0 Gold: 1000 Act Flags : npc mountable mounted Affected by: detect_invis detect_hidden Speaks: 1 Speaking: 262145 Experience: 0 Languages : common clan Shortdesc : a riding horse Longdesc : A beautiful manor riding horse stands here. Body Parts : head legs heart brains guts eye tail Attacks : Defenses :
the problem is that horse move from 1200 to 1201 don't using move_char but...
/* * Mount bug fix test. -Orion */ if( char_died( ch->mount ) ) return global_retcode; if( ch->mount ) { char_from_room( ch->mount ); char_to_room( ch->mount, to_room ); }
so all subroutine of move char are bypassed for horse.
Probably it's easy to fix.. I'm looking for this as soon as possible.
PS: try
- mount yourself the horse
Bye
mat



Conjurer

GroupMembers
Posts429
JoinedMar 7, 2005
Ahh, good catch, it does behave different for PC rider vs. NPC.
I wonder - could it be as simple as having a check in the falling damage so that if a PC is being damaged, also damage their mount in the fall, if applicable? Or is that over simplifying it?
I'll check later today.
I wonder - could it be as simple as having a check in the falling damage so that if a PC is being damaged, also damage their mount in the fall, if applicable? Or is that over simplifying it?
I'll check later today.



Conjurer

GroupMembers
Posts429
JoinedMar 7, 2005
Thinking about it... couldn't you just do this?
If CH is falling, despite having a mount to ride, evidently his mount is not capable of flying and should be falling too. Since they will end up at the same place, there should be no need to drag the mount along here. After all, they will meet when they hit the ground.
Thoughts?
if( ch->mount && !fall )
{
char_from_room( ch->mount );
char_to_room( ch->mount, to_room );
}
If CH is falling, despite having a mount to ride, evidently his mount is not capable of flying and should be falling too. Since they will end up at the same place, there should be no need to drag the mount along here. After all, they will meet when they hit the ground.

Thoughts?


Apprentice

GroupMembers
Posts86
JoinedAug 25, 2003
GatewaySysop said:
Thinking about it... couldn't you just do this?
if( ch->mount && !fall ) { char_from_room( ch->mount ); char_to_room( ch->mount, to_room ); }
If CH is falling, despite having a mount to ride, evidently his mount is not capable of flying and should be falling too. Since they will end up at the same place, there should be no need to drag the mount along here. After all, they will meet when they hit the ground.![]()
Thoughts?
I think it's apparently a good solution.
I tested a little and seems work great, but I want look move_char routine one more time before apply this fix and test also with mudprog, mpdamage, char_died situations during fall between more than one room etc...
The only "strange" thing in this fix is that ch falling down before ch->mount (horse) but it's not so much important probably, only a little illogical.
Other solution that I'm also was thinking (like you said) it's damage horse with rider at the end.
Am I going to damage the rider? ----> I immediately damage the mount...
In my opinion if ( ch->mount && !fall ) is better idea but need to be tested in details.
Bye
mat



Conjurer

GroupMembers
Posts429
JoinedMar 7, 2005
For what it's worth, I did try to do some additional testing with the above fix, and so far no issues found. Anyone else spot anything yet?
Pages:<< prev 1 next >>