Jump to content
  • Advertisement
A4L

A Functional Impass - Advise me on how to proceed? (C#)

Recommended Posts

Hey guys.. Ii'm still reading this thread and planning to get back to this. I'm going ot be moving next week.. I have finished painting the new house and doing the floors.. so once I move in and get settled (and paint and redo the kitchen in the old house so I can sell it) I will be getting back into this.

The current idea is this..

I will be using the input phraser to spit out commands and targets. Like "get,vase" for example. Each command is boiled down form a thesaurus of words. So... "take the vase from the table" turns into "get,vase". Meaning that there should be a number of base commands like "get" "push" "talk" "ask" etc etc. These "base" commands are fed as strings to the objects, assuming it is allowed. These strings are used to trigger unique code for that individual object, or trigger default code. so basically "get()" on one object should trigger a different "get()" on another, unless it is triggering the base get() that everyone that allows get in the first place has as default.. even though the command processor has sent the exact same command.

That is basically what I am planning on right now.

The only real question I have now is how I can build the objects. At some point I need to insert unique code. At the moment the objects and rooms are generic and loaded from a text file. (See old blog post for details) I can place code strings in text files to be loaded at the time of initialization, (in the same way I can populate rooms with items) but then I am not sure I am able to use the visual studio's debugging and popup helpers.

I guess I will need to hardcore the individual rooms and test them as best I can and then move all that code to a text file to load or something like that.

On 2/11/2019 at 12:24 PM, chocolate_outline said:

Hi, I think the solution you are looking for is scripting. Each object in a room has an associated script, which is just a plain text file. The behaviour for every item in the game can be unique and as simple or complex as you like. Back in the day, a lot of text adventures were written in BASIC, so you're trying to do is probably a lot harder. (some of them are even open source https://github.com/SinclairQL/akalabeth

I thought about this kind of solution, but as I am new to programing and c# itself, the thing is I did not like the idea of making a brand new "language" on top of C#.. nor did I not want to have access to the popups in visual studio helping me or the debugging tools if there was an error.

On 2/11/2019 at 10:17 PM, duke_meister said:

Do you really want to reinvent this wheel? Fine if you do :)

But first have a look at TADS 3

The project is only being done as a exercise to teach me C#. Using an existing engine the obfuscates the coding through scripting defeats the entire purpose of the project's existence. The "game" is not the point here, but the journey itself.

Edited by A4L

Share this post


Link to post
Share on other sites
Advertisement
1 hour ago, A4L said:

The "game" is not the point here, but the journey itself.

No problem. I don't recall reading that in any of the prior posts. What you're wanting to do is difficult, which is why I asked the question.

Now that I know that, I shall post something after work. I fixed your code to work as you wanted, but I don't have access right now. It comes down to basic OO concepts. Get hold of a good book and get started :)

Edited by duke_meister

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!