RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Changing movement rules to allow flying

Dreadcor

Wanderer
Changing movement rules to allow flying

I am interested in making changes that would allow flying in certain situations, such as after polymorphing into a creature that can fly. I am a C++/C# programmer, but I have just begun to dig trough the runuo code. I imagine that one of the changes I will need to make is to modify the code that checks if a mobile can move over certain types of terain or accross certain elevation changes, etc. I have looked in Movement.cs and see a function call on m_Impl.CheckMovement(m, d, out newZ). Am I correct in assuming that within this function call is where I will find the relevant code? And where can I find the definition of IMovementImpl::CheckMovement(Mobile m, Direction d, out int newZ)?

As I mentioned, I have just begun digging through the runuo source, so please forgive me if I am missing something obvious. Thanks.
 

_Epila_

Sorceror
well, to begin to modify the core to allow players to fly, first you have to verify if the client allow this flying movement, not only the core

as the addition of SA, maybe the clients that support SA also support flying, but i dont know how it work

a good way, but not too easy, to start verifying if is possible to fly, is when you try walk(in a path that you cant), check if the client send valid walk request to the server, if yes, you can do a kind of reverse engineering from receiving the packet to the walkcheck, if it do not send, you cant fly (also check at some Packet List and search something that activate flying, if it exists

as i said, starting from scratch (like i did for this example) is not easy

at Mobile.cs there is a function called Move() that reflect in the Movement.cs, but im almost certainly that movement checks is done entirely by Move() at Mobile.cs

i think Movement.cs is just an interface, in case you want to make a new type mobile Oo?!
 
some one else had done this a good while ago and posted info on how to do it (but i have no idea where, it was a good while back)
the way they found to do it was to have the "invisible" tile appear where they where going for them to "travel" to at that z height

could also do something simular to the "flying carpet" simular way but using the invisible tile

the sa deal is not realy flying, it just places them so much above the ground over a cetain tile type, and only gargoyle bodies can do it
it is very very limited and a pain to set up if not using the default ter mur map and just those certain lines that OSI set up
 

_Epila_

Sorceror
yeah, you can use this flying carpet, its not a big task
just do not allow the player Z be higher than 100-120 compared with the location z, or you will experience black screens or missing statics
 

Dreadcor

Wanderer
Thanks for the replies you guys. But I still haven't found what I'm looking for...

Mobile::Move calls Mobile::CheckMovement, which in turn calls Movement.Movement.CheckMovement. But where is the definition of Movement.Movement.CheckMovement? Its not in Mobile.cs and its not in Movement.cs. I looked through Map.cs to see if there was anything relevant in there. I found some interesting line of sight stuff in there, but nothing about checking if a move was allowed. Where is the code that keeps someone from moving from the ground to roof of Brit bank, for example? Somewhere there is a piece of code that makes sure that if the increase in elevation is too great, you can't move there. Or if the terrain is water, you can't move there. This is the piece of code I seek.
 
a lot of it is also client side, controlled by what is in tiledata for if "passable", etc
jut like you can set yourself to cantwalk and can swim, but still can not move accross the water, but a basecreature set that way will
 

_Epila_

Sorceror
Dreadcor;861520 said:
Thanks for the replies you guys. But I still haven't found what I'm looking for...

Mobile::Move calls Mobile::CheckMovement, which in turn calls Movement.Movement.CheckMovement. But where is the definition of Movement.Movement.CheckMovement? Its not in Mobile.cs and its not in Movement.cs. I looked through Map.cs to see if there was anything relevant in there. I found some interesting line of sight stuff in there, but nothing about checking if a move was allowed. Where is the code that keeps someone from moving from the ground to roof of Brit bank, for example? Somewhere there is a piece of code that makes sure that if the increase in elevation is too great, you can't move there. Or if the terrain is water, you can't move there. This is the piece of code I seek.

the movement check is done by Move() at Mobile, the Movement.cs is just an interface to determine what functions the derivated classes if this must have
and of couse as graywolf said, this check is also done by client
 

Dreadcor

Wanderer
Okay, I think I may have found what I was looking for. On line 3088 of Mobile.cs you start to see some code that compares oldSector to newSector. I overlooked this code at first because I thought it had to do with loading blocks of the map or something. But upon further inspection, it looks like it is checking elevations and object heights and such to see if the move will be allowed. I wonder why they decided to call a single cell a sector... Oh well.

Thanks again for the comments guys.
 

Dreadcor

Wanderer
Okay, wait... I'm still not sure how newZ is determined in Mobile.Move( direction d ). I see that it is fed into CheckMovement, but unless you override CheckMovement, newZ is just the same as the mobile's current Z. Is it overridden somewhere? How is newZ calculated? I can't help feeling that I'm missing something terribly obvious.:confused:
 

Peoharen

Sorceror
some one else had done this a good while ago and posted info on how to do it (but i have no idea where, it was a good while back)
the way they found to do it was to have the "invisible" tile appear where they where going for them to "travel" to at that z height
I think ironically it was a Russian that told me about the flight tile so I could get SAs finished.
 
Top