had an idea, and just want to know how possible it owuld be to make, which is an altitude code. Something that would let people using fly to travel into rooms above others, and maybe allow for exits at certant alltitudes (like the Astral Plane or Olympus, for some examples). I'm just wondering how it might be doable, as the added effect on combat would be interesting, seeing as how it could give people like pixies an advantage over others since they are a weaker race (sorry if I offend and pixie fans, they make good spellcasters). If someone decided to try and make one to post on MUD magic as a SMAUG snippet, it would be great, but if not an idea on what it would take besides pretty much a rewrite of the combat and movement system.
Alltitude Code idea
Posted by Dralnu on Sun 17 Apr 2005 06:15 PM — 10 posts, 41,493 views.
In mud.h, struct char_data, add an entry for
sh_int altitude;
Then, assuming you want people to be able to fly higher/lower if they have wings, or have the fly spell,
create a fly command.
Fly up would perform ch->altitude ++;
Fly down would perform ch->altitude--;
Perhaps a land command would also be in order, to zero the value.
Then, you could just add an exit value for altitude, and a check to see if ch->altitude >= exit->altitude.
As for combat, I'd suggest a combat check that would compare both char's altitudes against each other. If, say, the difference between the values is greater than or equal to two, they would not be able to hit each other w/o bows.
However, if the difference is only one, then whichever char's at a higher altitude could have a hit/dodge bonus.
's just a basic outline, but I'm sure you could work it from there.
Cheers.
sh_int altitude;
Then, assuming you want people to be able to fly higher/lower if they have wings, or have the fly spell,
create a fly command.
Fly up would perform ch->altitude ++;
Fly down would perform ch->altitude--;
Perhaps a land command would also be in order, to zero the value.
Then, you could just add an exit value for altitude, and a check to see if ch->altitude >= exit->altitude.
As for combat, I'd suggest a combat check that would compare both char's altitudes against each other. If, say, the difference between the values is greater than or equal to two, they would not be able to hit each other w/o bows.
However, if the difference is only one, then whichever char's at a higher altitude could have a hit/dodge bonus.
's just a basic outline, but I'm sure you could work it from there.
Cheers.
And you'd likely want to modify look and such too so that a flying PC/Mob would give the message "<name> is here, flying about <altitude> above you." Or something like that.
Thanks. I'm fairly new to coding, and was thinking that it would be alot more complicated then that. Appreciate it :)
Mmf. I'm sure there's a complicated way to do it, but..
A major part of coding is figuring out the simplest (and cleanest! :D) way to achieve a given task. :P
A major part of coding is figuring out the simplest (and cleanest! :D) way to achieve a given task. :P
Couldnt you just connect rooms and make the higher rooms flying rooms only (eg. make a new flag where you have to be flying)? Thats how I would do it, well....maybe not exactly, but it seems even more simple then the proposed idea.
What I was thinking was make it whee you have to be at a certaint alltitude to even see the exit. I mean if a cave openning is a few hundered feet up a ledge, you won't see it standing at the bottom of the cliff...
Hrmmm. I am in agreement with Whiteknight on this one.
If you used the earlier suggestion of having a few rooms going "up" with the "nofloor" setting and the "air" sector type, people would 1) have to fly to get up there and 2) never see the exit at the end of the series of "up" rooms unless they flew up there to the final room in the series.
Would that not suffice? I would think that's a preferable way to do it without having to hard code anything new. IMHO, the other way would be a bit over complicated to achieve the desired effect. My $.02 anyway.
If you used the earlier suggestion of having a few rooms going "up" with the "nofloor" setting and the "air" sector type, people would 1) have to fly to get up there and 2) never see the exit at the end of the series of "up" rooms unless they flew up there to the final room in the series.
Would that not suffice? I would think that's a preferable way to do it without having to hard code anything new. IMHO, the other way would be a bit over complicated to achieve the desired effect. My $.02 anyway.
Hmm moving up... that's the same as making individual rooms, which is >not< altitude.. what the person wants is to be in the SAME room with other objects/people etc. and give the actual image of being in the air.
Personally I think just adding an altitude to CHAR_DATA and having it be increased based on the argument in a "fly" command, allowing them to raise up and down at will.
Than for exits, you could add an altitude entry to the appropriate spot, and than find the part around here:
if (pexit->to_room && (!IS_SET (pexit->exit_info, EX_WINDOW)
|| IS_SET (pexit->exit_info, EX_ISDOOR))
&& !IS_SET (pexit->exit_info, EX_HIDDEN))
in do_exits, and check if their height, is a certain amount in relation to the door(ex: ch->altitude == pexit->altitude) or
(ch->altitude == (pexit->altitude - 5) || ch->altitude == (pexit->altitude + 5))
The first would require them to be in the same room, the second would require to be 5 rooms away up or down.
With a little learning you could also add individual messages for how far things are:
50 feet = A small figure stands below you, about 44 feet away
20 feet = A rather large man stands below you, about 14 feet down.
etc. etc.
You will also want to modify can_see so that players cannot see others who are too far away, which will by default, also disallow fighting. You may also do(as someone said) add in a few bonuses for being higher or lower than your enemy.
This can also open up for in-room movement.. add the same things but in a smaller portion, allowing for players to move around in the room, modifying a distanceW, distanceE, etc.(distanceW, distanceE etc. means the distance to the end of the room).
You would also want to modify redit to allow changing of altitude and perhaps modify "look" so that players can look up to see other people flying around. You could even do similar to objects by adding the altitude and modifying can_see_obj.
Edit-------
I may have mistaken in the poster's wishes.. regardless this is still a good idea in my opinion.
Hmm I like this idea :-p I might even consider adding it to my mud haha.
Personally I think just adding an altitude to CHAR_DATA and having it be increased based on the argument in a "fly" command, allowing them to raise up and down at will.
Than for exits, you could add an altitude entry to the appropriate spot, and than find the part around here:
if (pexit->to_room && (!IS_SET (pexit->exit_info, EX_WINDOW)
|| IS_SET (pexit->exit_info, EX_ISDOOR))
&& !IS_SET (pexit->exit_info, EX_HIDDEN))
in do_exits, and check if their height, is a certain amount in relation to the door(ex: ch->altitude == pexit->altitude) or
(ch->altitude == (pexit->altitude - 5) || ch->altitude == (pexit->altitude + 5))
The first would require them to be in the same room, the second would require to be 5 rooms away up or down.
With a little learning you could also add individual messages for how far things are:
50 feet = A small figure stands below you, about 44 feet away
20 feet = A rather large man stands below you, about 14 feet down.
etc. etc.
You will also want to modify can_see so that players cannot see others who are too far away, which will by default, also disallow fighting. You may also do(as someone said) add in a few bonuses for being higher or lower than your enemy.
This can also open up for in-room movement.. add the same things but in a smaller portion, allowing for players to move around in the room, modifying a distanceW, distanceE, etc.(distanceW, distanceE etc. means the distance to the end of the room).
You would also want to modify redit to allow changing of altitude and perhaps modify "look" so that players can look up to see other people flying around. You could even do similar to objects by adding the altitude and modifying can_see_obj.
Edit-------
I may have mistaken in the poster's wishes.. regardless this is still a good idea in my opinion.
Hmm I like this idea :-p I might even consider adding it to my mud haha.
That was close to it. Until I get a little farther into fixing this up, it'll be on a back burner.