Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (604)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (654)
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 994 times)
0 Members and 1 Guest are viewing this topic.
Offline MickeyB

Senior Devvie

my game will work, my game will work!

« Posted 2005-03-24 11: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 )



Current Project:
Offline MickeyB

Senior Devvie

my game will work, my game will work!

« Reply #1 - Posted 2005-03-27 13: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!



Current Project:
Offline blahblahblahh

JGO Coder

Medals: 1

« Reply #2 - Posted 2005-03-27 14: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"


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

« Reply #3 - Posted 2005-03-27 14: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 Devvie

my game will work, my game will work!

« Reply #4 - Posted 2005-03-28 14: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...


Current Project:
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

SHC (30 views)
2015-08-01 03:58:20

Jesse (20 views)
2015-07-29 04:35:27

Riven (40 views)
2015-07-27 16:38:00

Riven (22 views)
2015-07-27 15:35:20

Riven (25 views)
2015-07-27 12:26:13

Riven (15 views)
2015-07-27 12:23:39

BurntPizza (37 views)
2015-07-25 00:14:37

BurntPizza (46 views)
2015-07-24 22:06:39

BurntPizza (31 views)
2015-07-24 06:06:53

NoxInc (37 views)
2015-07-22 22:16:53
List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21 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‑
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!