Web Analytics Made Easy -
StatCounter How do you create an item inventory in batch? - CodingForum

Announcement

Collapse
No announcement yet.

How do you create an item inventory in batch?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do you create an item inventory in batch?

    Help?
    I am a very new to programming like a full fledged newby, so if i seem to ask stupid questions i am sorry.

    I am working in batch on making a text based adventure. I cannot seem to find anyway of making an item inventory system. I dont even care if you cannot look in on it as long as you can pick items up they and they are moved to the inventory and are no longer availible where they werw found.
    pls help, freefall

    Oh and if this is not in the right part of the forum pls alert me.
    also i am sorry for miss spelled words im typing this in a hurry.

  • #2
    Whew, why are you using batch for something like this? I don't think batch handles user arrays at all, so I'm not sure where you're pulling from and writing to. I did a little batch work up about a year ago to automate backup recovery to a disaster recovery domain, but I recall that the 'arrays' I had to create were the most hacked up solution ever. Batch files are just too primitive to do most of these things.
    Why not change to a language like C to do this? Its a heck of a lot easier to use C than it is to use batch for any type of interaction.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

    Comment


    • #3
      Or if you want to keep with something you don't have to compile first, I would recommend Perl or Lua.
      OracleGuy

      Comment


      • #4
        Originally posted by Fou-Lu View Post
        Whew, why are you using batch for something like this? I don't think batch handles user arrays at all, so I'm not sure where you're pulling from and writing to. I did a little batch work up about a year ago to automate backup recovery to a disaster recovery domain, but I recall that the 'arrays' I had to create were the most hacked up solution ever. Batch files are just too primitive to do most of these things.
        Why not change to a language like C to do this? Its a heck of a lot easier to use C than it is to use batch for any type of interaction.
        Thanks. is "C"=C#?

        Comment


        • #5
          Originally posted by oracleguy View Post
          Or if you want to keep with something you don't have to compile first, I would recommend Perl or Lua.
          thanks im real new to this

          Comment


          • #6
            Originally posted by freefall View Post
            Thanks. is "C"=C#?
            No. C and C# are completely different (as is C and C++); however, C# and many of the third generation languages (PHP, Java, C#, C++, and a lot of others) are often referred to as C-based languages in that their syntax is very similar to C.

            Originally posted by freefall View Post
            thanks im real new to this
            Oh yeah I was even thinking of a few scripting ones as well, but failed to mention any >.<

            Think of batch as more of a way to sequentially processes some type of data, often unmonitored, and often scheduled. Its not really designed to be overly interacted with (although it certainly can be, I just find it hard to do as it will create spaghetti code [uses things like labels and 'goto' type syntax that is very difficult to debug]).

            I don't want to actually suggest a script language like PHP or Perl for you to use. Perl was my first actual language, and because it was my choice of language it did make it a little more difficult to learn languages like C due to my lack of understanding of key principles like datatypes and memory. C is also one of the more complex one's to work with; its relentless, it makes you as the developer write code that manages memory (garbage collection / GC), but has a lot of real pros as well: very fast, if written correctly it makes cross platform fairly easy to deal with, memory management (yep its a pro and a con), etc.
            Everyone has got to start somewhere. I'd suggest starting hard and moving to easy. A language is a tool, programming is principle; its the same across all. Learning C (or C++ it doesn't really matter; I'd use C since its procedural to learn on, then move to C++) has a huge advantage in that every language you learn after it will become easier and easier since many of the things you used to have to worry about are no longer handled by you.

            Oh, and in case it helps; if I were in your shoes making a text based RPG game, I would likely choose Java as my language of choice. Java is cross platform designed, object oriented, I can build a gui on top of it, I can pack it as an applet or RMI it and serve it online, its free, supported by some cellular devices, etc etc. Java is IMO also a fantastic language to learn in especially if you are wanting to start in an OO language instead of a procedural one. It carries pretty much all the features of C, but is a lot slower, and lacks the more complicated things which are handled under the hood by the JRE.
            PHP Code:
            header('HTTP/1.1 420 Enhance Your Calm'); 
            Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

            Comment

            Working...
            X