Re: begining programming

@Arbuz, you seem very attached to AutoIt. Personally, I would not recommend AutoIt. Sure, Ghorthalon made some of his games in AutoIt, but that was before he discovered PureBASIC.
If you want to build a text game, you need to give us just a little bit more information, such as:

  1. What genre of game do you want? (e.g.: action, action-adventure, adventure, roll-playing, etc.)

  2. What programming language do you want it in?

    • This is one of the most arguable topics in the programming world. There are more than 600 programming languages in existance - and more and more of them are growing. When I ask about the programming language you want it in, I'm asking about which one you'd prefer. I will give an example of some programming languages that I've found ideal for text-game development later in this post. As a hint of warning, do not ask any programmer what the best programming language is. Countless deb ates and flame wars have been started on this exact topic, so it's rather fragile. If you do ask someone, though, your bound to get an opinion, rather than an honest answer. For instance, if I asked Tward what the best programming language was, he might say C++ or Python, depending on his preference. Now, if you asked me the same thing, you would get a completely different answer. To summarize, just don't ask a programmer what the best programming language is unless you want to start a very dangerous flame war or debate that is everlasting and will get you absolutely nowhere.

  3. What theme would you want? (e.g.: Fantasy, technological, biological, heroic, etc.)

These are just a few of the questions you need to answer before developing anything involving gaming. Below is an example of how to add commands to certain MUDs and MOOs, just to give you an example. You can either pick from one of my examples, or you can ask for something else.

Adding a command to ResortMUD
  • Go to either act_comm.c, act_info.c, act_move.c, act_obj.c, or act_wiz.c and open the respective file. Act_comm.c is meant for general commands; act_info.c is for informational commands; act_move.c is for movement and other transitive commands; act_obj.c is for commands that manipulate the objects in the environment; and act_wiz.c is for immortal commands.

  • Go to the very end, and type the following code for a hello world command:

void do_helloworld (CHAR_DATA *ch, char *argument)
{
send_to_char ("Hello world!", ch);
return;
}
  • Save the file and go to the file known as 'do.h'. This is the header file for the command table. A header file is a file that is included to a main source code file; it defines functions, structures, etc. The command table is a list of definitions which define various information about a command, such as it's name, level, position, logging value, flags, where it's shown in the commands list, etc. Add the following to the end of do.h, just before the #endif:

DECLARE_DO_FUN (do_helloworld);
  • Go and open 'do.c', the main definition of the command table. Find the place where it says the following:

case 'h':

And find a safe place, then add:

if (strcmp (name, "do_helloworld"))
return do_helloworld;
  • Now, compile the game using the 'make' command on a Linux system, or use the best method for program compilation. Make sure to use the makefile!

  • In the game, make sure you've ran the following command:

cedit copyover code do_copyover
cedit save cmdtable

If you've successfully ran those commands, run:

copyover
cedit helloworld create do_helloworld

If it says "command added" without any errors after it, you've just added a new command! You'll need to edit command.dat to make it permanent, though, as ResortMUD likes to replace the code property with random hexadecimal values like (0x3f4181b) (which resolves to the integer 66328603 in our decimal system, if your curious), something I find very irritating.

Adding a command in MOO

It is relatively easy to add a command in MOO. In your MOO (make sure your a programmer or wizard), follow the following steps:

  1. Type:

@verb $player:helloworld
@program $player:helloworld
player:tell ("Hello world!");
.

You've just coded your first command in MOO!

Note

Please beware that if you make your own MOO, it will be much harder to get to a good MOO that players will enjoy, especially for combat, magic, etc. I am not trying to warn you away from MOO. However, if your just getting started with programming, I'd go for a MUD like ResortMUD where you get a nice toolbox and toolkit to play with first before you dive in and learn the code.



_______________________________________________
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : visualstudio via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : arbuz via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : momo7807 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : arbuz via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : momo7807 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : visualstudio via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : arbuz via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : arbuz via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Guitarman via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : arbuz via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : momo7807 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : arbuz via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Guitarman via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : arbuz via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : dhruv via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : momo7807 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Guitarman via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : arbuz via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : visualstudio via Audiogames-reflector

Reply via email to