in room tactical movement

 
Post new topic   Reply to topic    mudlab.org Forum Index -> Coding
View previous topic :: View next topic  
Author Message
wanderer



Joined: 17 Jun 2006
Posts: 3

PostPosted: Sun Jun 18, 2006 4:34 am    Post subject: in room tactical movement Reply with quote

could someone show me how this is done? I've been trying to figure it out for so long now...

it looks something like this:

*********
* @ *
* *
* O *
*********

and then inside that little box is @ for you and O for like ogre..or G for goblin
and you can move with in it...so you can advance on your enemy

editing the post because when I hit submit the little box was no longer a little box Razz
so just keep in mind that , thats what it is Smile
Back to top
View user's profile Send private message
Author Message
Sandi



Joined: 13 May 2005
Posts: 94
Location: Boston

PostPosted: Sun Jun 18, 2006 11:03 am    Post subject: Reply with quote

Welcome, wanderer!

You can use the 'code' tag in the post editor to preserve spaces so it doesn't all collapse to the left.

Are you asking how to code the display, the combat, or both?
Back to top
View user's profile Send private message Visit poster's website
Author Message
wanderer



Joined: 17 Jun 2006
Posts: 3

PostPosted: Sun Jun 18, 2006 12:50 pm    Post subject: Reply with quote

thanks! Very Happy

I don't need to change combat really, except to make a check for if you are close enough to engage. What I want is to specify a room size like 10x10, and then have that little map display. Then add a step command, like step n will move your character one step north inside the room. Each step would be 5 feet. So in a 10x10 room you would only have 4 spaces to be in. And I would like to know how to show the @ and O or whatever and update it as it progressed.
Back to top
View user's profile Send private message
Author Message
Thotter



Joined: 18 Jun 2006
Posts: 2

PostPosted: Sun Jun 18, 2006 5:54 pm    Post subject: Reply with quote

You could make a twodimensional array and then go through all the characters in the room to get their x-pos and y-pos. When you get them, you put the right char at the right place in the array.
This only leaves the problem of two characters at the same field. Have you tought about that?
Back to top
View user's profile Send private message
Author Message
wanderer



Joined: 17 Jun 2006
Posts: 3

PostPosted: Sun Jun 18, 2006 6:37 pm    Post subject: Reply with quote

nod. thats how it works out, but the symbol changes to an * when that happens. I'm very new to mud coding..and finding it very challenging. but wanting to get my ideas into the codebase.
I'm working with the Smaug codebase and trying to fit this concept into that.
any help would be greatly appreciated.
Back to top
View user's profile Send private message
Author Message
Thotter



Joined: 18 Jun 2006
Posts: 2

PostPosted: Sun Jun 18, 2006 7:16 pm    Post subject: Reply with quote

Ohkay...
Here is how I would do it. I am not a smaug coder though.
Add two variables to the character structure, one for the x-pos and one for the y-pos.
Then make that step command which manipulates those variables in whatever way you like.
Then make the draw function.
in that function you first create a 2dimensional array of width x height and fill it with dots. Then you go through all the mobs and players in that room, get their x and y pos and then you do "room_situation[x-pos][y-pos]='@'" for example. Then you send the whole thing to the char.
Now you can call that function whenever you like and it will send the situation in the room.

Sorry for the abstractness of this post, but I am unfamiliar with smaug and I don't know what structures it uses.

Thotter
Back to top
View user's profile Send private message
Author Message
Virago



Joined: 06 Jan 2006
Posts: 12
Location: Just south of Nashville

PostPosted: Tue Jun 20, 2006 3:37 pm    Post subject: Reply with quote

Making Smaug into hemisemidemiNethack? Interesting. Would your setup allow for multiple entities to take up the same "space" in a room, or will there be a limit on how many things can be in the room at once? This is assuming that the display is taken from the textual summary; if the display is generated first, and the text derived from that (if present at all), that's a whole different matter.

Does anyone know if GodWars II handles things in this manner? It's been many moons since I checked them out, but I could've sworn there was a similar flavor to the setup (albeit a vastly different combat system, etc.).
Back to top
View user's profile Send private message
Author Message
KaVir



Joined: 11 May 2005
Posts: 565
Location: Munich

PostPosted: Wed Jun 21, 2006 7:16 am    Post subject: Reply with quote

Virago wrote:
Does anyone know if GodWars II handles things in this manner?


You mean in regard to drawing the ascii map? Yes, it works pretty much like that, although it applies a line-of-sight stage before adding creatures/objects.

Or do you mean having multiple entities to overlap at the same coordinate position? If so, yes, I do that as well. It's easier to implement, less strain on the cpu (no collison detection to worry about), and easier from a playability perspective (you don't have to navigate around people).
Back to top
View user's profile Send private message Visit poster's website
Author Message
malaprop



Joined: 16 Jul 2005
Posts: 6
Location: Chicago

PostPosted: Wed Jun 21, 2006 12:20 pm    Post subject: Reply with quote

We've got this kind of in-room display in SIMud. Our code is online if you want to look into it, or just ask more.

Updating as people move means using a lot of fancy ansi cursor-positioning code, all of which will explode on Windows Telnet and several mud clients. It's probably not worth it, just write your 'look' command to display a static view.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    mudlab.org Forum Index -> Coding All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2002 phpBB Group
BBTech Template by © 2003-04 MDesign