Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (475)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (530)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  General MudObject thoughts/questions...  (Read 774 times)
0 Members and 1 Guest are viewing this topic.
Offline MickeyB

Senior Member




my game will work, my game will work!


« Posted 2005-03-24 12:35:17 »

Having a little trouble with my logic.  I have commands, that are bsh scripts, that are available to all players based on security/access level.

I have a MudObject with a few required variables like id, name, desription and type. To make good use of the MudObject...I was thinkging:

- To keep it as general as possible, I considered using a hashmap<String, MudVariable> to hold additional variables so each object could possibly have a different set without have to extend and create numerous classed for it.

- Then do the same with methods.  Have a hashmap<String, BSHScriptName> so each object could have various methods.

- Add a few helper methods for add/remove and get.  Make a single set of object methods so if 3 different objects have the TurnInvisible method, its one script and used by all (or potentially different ones, stored logically on a drive so TurnInvisible can function differently for a player and a dragon, and so on).

- Or....each object has a sinle script with variables and methods unique to it?(seems things would get convoluted this way, not knowing what 46 different TurnInvisibles do on 46 different objects)...

Thoughts?  ( I am using beanshell )


M

MickeyB

Current Project: http://www22.brinkster.com/mbowles/
Offline MickeyB

Senior Member




my game will work, my game will work!


« Reply #1 - Posted 2005-03-27 15:18:06 »

As an initial test, I am looking for a few people to hit this telnet address, see if you can connect and try a few commands(look, wave, say) and then quit to leave.  Let me know how it goes...thanks!

http://telnet:68.57.86.113:11212

MickeyB

Current Project: http://www22.brinkster.com/mbowles/
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #2 - Posted 2005-03-27 16:10:14 »

Some advice, having done exactly this approach to java muds several times before Smiley

1. Make every command have the following methods in addition to any others:
- shortdescription (one line)
- longdescription (paragraphs)
- infoOnArgument( int n ) (explains valid values for the nth arg, and tells you waht to put there)

2. Make a built-in help command (or not built-in, but always present) which:
- invoked with no args? Iterates over all commands, printing:
   command - "help command" - shortdescription
- invoked with one arg? finds that command and prints the short desc and long desc and number of args
- invoked with two args? finds that command and prints the infoOnArgument for the arg named by the second arg to help (either an index or a name if you're using named-args)

3. Append "no such command!" with "type help for a list of commands"

4. Even better, alias "?" to typing "help"

HTH

malloc will be first against the wall when the revolution comes...
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #3 - Posted 2005-03-27 16:10:38 »

PS: well done for getting colours into telnet in java...

malloc will be first against the wall when the revolution comes...
Offline MickeyB

Senior Member




my game will work, my game will work!


« Reply #4 - Posted 2005-03-28 16:34:35 »

Thanks!  I have a commands command that right now lists the command names available.  I will add the additional ideas for the command descriptions.  
'help say' would return...
say - to say something to all in immediate area.
usage - say [text to say]

or something like that...

MickeyB

Current Project: http://www22.brinkster.com/mbowles/
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

ctomni231 (34 views)
2014-07-18 06:55:21

Zero Volt (30 views)
2014-07-17 23:47:54

danieldean (25 views)
2014-07-17 23:41:23

MustardPeter (27 views)
2014-07-16 23:30:00

Cero (42 views)
2014-07-16 00:42:17

Riven (44 views)
2014-07-14 18:02:53

OpenGLShaders (33 views)
2014-07-14 16:23:47

Riven (34 views)
2014-07-14 11:51:35

quew8 (30 views)
2014-07-13 13:57:52

SHC (66 views)
2014-07-12 17:50:04
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!