Drac Codes: Getting into C# programming again!

List your programs here (game-related or other software).

Moderators: scallenger, Rebel, madppiper, TresCom Support Team

User avatar
Draconisaurus
T-Rex Killer
T-Rex Killer
Posts: 14046
Joined: Mon Dec 06, 2004 5:21 pm
Antispam: No
Location: Isla Sorna
Contact:

Drac Codes: Getting into C# programming again!

Post by Draconisaurus »

Hey all. I'll start by saying, that I took two years of programming in high school. Learning Visual Basic .NET and Visual C# .NET informed my original entry into scripting in Trespasser. Strings, bools, floats, etc. But after those two years I never went back to C# or any other language.
Recently I decided to get back into it. My brain is in some state where modding is not such a high priority. I still enjoy it, but by now I've made quite a few mods, and many of the new things I make are not too different from what I've already done. So! I am learning C# again, to make games with. :nerd:

I tried installing Visual Studio, but alas, my tiny laptop's HD was too small, and Visual Studio apparently can't be installed on a USB drive. So, I've installed "VS Code" instead, and been slowly learning how to use it. After running through various hoops and watching some videos, I managed my first new program: Jurassic Travel Plan. It is really very short; a text game where 4 possible outcomes. There isn't much to it, but feedback is appreciated..! You can find it here: https://www.mediafire.com/file/ytyjhpba ... an.7z/file

I am cooking up lots of plans for coding projects. One is a simple text app to display data about all builds+levels of Trespasser, such as number of each dinosaur species, number of each gun, number of each crate. This one might get done. But my new major project is: turn the Tres Walkthrough, into a text adventure game. Basically an RPG using only text in a console app, where you type in letters to carry out actions after the current player location/events is described. I've just finished re-reading the walkthrough, I think it is all possible in some manner in a text game. In the meantime I'll make a smaller text game to continue learning how to do it.

All for now!
User avatar
tatu
-=TresCom Website Manager=-
-=TresCom Website Manager=-
Posts: 5088
Joined: Fri Jun 24, 2005 9:40 pm
Antispam: No
Location: Sweden
Contact:

Re: Drac Codes: Getting into C# programming again!

Post by tatu »

As you know, I enjoyed this. And it makes me want a Trespasser-style/inspired text-adventure/visual novel style of game :D
Active project: Trespasser: Isla Sorna
Status:
BE-PH1: Released
PH2-IT: Pre-released
PL-SUM: In production

"...there used to be more benches, but InGen's workers removed them during the evacuation in the name of framerate."
User avatar
Rebel
-=TresCom Developer=-
-=TresCom Developer=-
Posts: 6119
Joined: Sun Nov 10, 2002 10:26 pm
Location: That country nobody likes (you know the one)
Contact:

Re: Drac Codes: Getting into C# programming again!

Post by Rebel »

I personally never cared for C#, so I when I do program I revert to old C or C++ along with Windows programming. I started with DOS and I think it was Fortran while in the Air Force 45 years ago,
but I've forgotten all of those yesteryear programming languages now. When I was in High School, they just started with Computer Science courses, but I was already in my senior year, so I didn't
see much point in getting evolved with it then. I had no choice when I joined the service (since it was pertinent to my position).

On point, I encourage you do get back into it, Drac. Computer technology isn't going anywhere (unless, of course, the world gets destroyed), so if I were as young as you are, I'd try my best to
keep up with programming and its continual evolution. :)
User avatar
Draconisaurus
T-Rex Killer
T-Rex Killer
Posts: 14046
Joined: Mon Dec 06, 2004 5:21 pm
Antispam: No
Location: Isla Sorna
Contact:

Re: Drac Codes: Getting into C# programming again!

Post by Draconisaurus »

Didn't know you were in the Airforce, sounds cool. I started my coding adventure wanting to be open to learning various different languages; I think I technically still am, but after seeing how much there is to learn to use C#, I think I'll stick with it for a while. I do still think there might be a language which I prefer, somewhere down the line. C# sometimes seems to make assumptions and things, leaps of uh somethings which make it slightly ambiguous to me what is referring to what. Still, I learned C# in high school, so I want to start with it. I remember, as it seems, pretty well how to navigate programming generally, however I find myself sad at how much I forgot. I used to have a whole binder full of programs I made! It's long gone.

What sort of things did you code in the Airforce?
And, any comments on my tiny program? Heheh

Hmmm ah why not. Here is the source for my tiny text game:

Code: Select all

//Jurassic Travel Plan Game

using System;

namespace JurassicTravelPlan2 {
    class Program {
	    static void Main(string[] args) {
            //Variables for Jurassic Travel Plan
            string SIslandDestination = "";
            string SNublarActivity = "";
            string SSornaActivity = "";
            string STraveling = "Y";

            while (STraveling == "Y") {
                //Introduce user, get selection
                Console.WriteLine("Welcome to InGen! Where do you want to travel?");
                Console.Write("Type N for Isla Nublar, S for Isla Sorna: ");
                SIslandDestination = Console.ReadLine();
                //Convert input for use
                SIslandDestination = SIslandDestination.ToUpper();
    
                //Check for valid island
                while (SIslandDestination != "N" && SIslandDestination != "S") {
                    //Inform user of incorrect input, recollect selection, convert input
                    Console.WriteLine("'" + SIslandDestination + "' is not an island!");
                    Console.Write("Type N for Isla Nublar, S for Isla Sorna: ");
                        SIslandDestination = Console.ReadLine();
                    SIslandDestination = SIslandDestination.ToUpper();
                }
    
                //Island destination adventure
                switch (SIslandDestination) {
                    case "N":
                    //Travel to Isla Nublar
                    Console.WriteLine("You have chosen to visit Isla Nublar!");
                    Console.WriteLine("Boarding an InGen helicopter, you find yourself");
                    Console.WriteLine("flying across the ocean. Isla Nublar, also known");
                    Console.WriteLine("as 'Cloud Island', appears before you. The");
                    Console.WriteLine("helicopter lands after a bumpy descent.");
                    Console.WriteLine("Do you take the automated tour in the explorer,");
                    Console.WriteLine("or do you decide to play it safe and stay at");
                    Console.WriteLine("the Visitors Lodge?\n");
                    Console.Write("Type T for Tour or V for Visitors Lodge: ");
                    SNublarActivity = Console.ReadLine();
                    SNublarActivity = SNublarActivity.ToUpper();

                    //Check for valid activity
                    while (SNublarActivity != "T" && SNublarActivity != "V") {
                        //Inform user of incorrect input, recollect selection, convert input
                        Console.WriteLine("'" + SNublarActivity + "' is not an activity!");
                        Console.Write("Type T for Tour or V for Visitors Lodge: ");
                        SNublarActivity = Console.ReadLine();
                        SNublarActivity = SNublarActivity.ToUpper();
                   }

                    //Activities on Isla Nublar
                    switch (SNublarActivity) {
                        case "T":
                        //Take the automated tour
                        Console.WriteLine("You are at the Visitor Center. A green,");
                        Console.WriteLine("yellow, and red Ford Explorer pulls up,");
                        Console.WriteLine("running on a track in the middle of the");
                        Console.WriteLine("roadway. You get inside, and the vehicle");
                        Console.WriteLine("drives itself to a large wooden gate. On");
                        Console.WriteLine("the other side, paddocks containing");
                        Console.WriteLine("dinosaurs amaze you. However, partway");
                        Console.WriteLine("through the tour, the power goes out.");
                        Console.WriteLine("RRRRRRRrrrrr, r-rr-rrrr....");
                        Console.WriteLine("An enormous tyrannosaurus breaks through");
                        Console.WriteLine("the fence, grabs your vehicle, and tosses");
                        Console.WriteLine("it over the concrete moat!");
                        Console.WriteLine("The world spins briefly before the car");
                        Console.WriteLine("crashes into the ground below.");
                        Console.WriteLine("YOU ARE DEAD!\n");
                        //End of automated tour
                        break;

                        case "V":
                        //Go to the Visitors Lodge
                        Console.WriteLine("A gas powered Jeep brings you to the");
                        Console.WriteLine("Visitors Lodge, an impressive, tall");
                        Console.WriteLine("building topped with glass pyramids. A TV");
                        Console.WriteLine("in the corner features various channels");
                        Console.WriteLine("showing living dinosaurs going about their");
                        Console.WriteLine("prehistoric lives. You grab a soda, sit");
                        Console.WriteLine("back, and enjoy your stay.");
                        Console.WriteLine("YOU ARE ALIVE!\n");
                        //End of Visitors Lodge visit
                        break;
                    }
                    //End of Isla Nublar visit
                    break;

                    case "S":
                    //Travel to Isla Sorna
                    Console.WriteLine("You have chosen to visit Isla Sorna!");
                    Console.WriteLine("An InGen helicopter brings you across the");
                    Console.WriteLine("ocean. The vast island, also called 'Site");
                    Console.WriteLine("B', looms ahead. It is home both to InGen");
                    Console.WriteLine("cloning and support facilities, and to free-");
                    Console.WriteLine("roaming dinosaurs.");
                    Console.WriteLine("Do you visit the facilities, or visit the");
                    Console.WriteLine("dinosaurs in the wilderness?\n");    
                    Console.Write("Type F for Facilities or D for Dinosaurs: ");
                    SSornaActivity = Console.ReadLine();
                    SSornaActivity = SSornaActivity.ToUpper();

                    //Check for valid activity
                    while (SSornaActivity != "F" && SSornaActivity != "D") {
                        //Inform user of incorrect input, recollect selection, convert input
                        Console.WriteLine("'" + SSornaActivity + "' is not an activity!");
                        Console.Write("Type F for Facilities or D for Dinosaurs: ");
                        SSornaActivity = Console.ReadLine();
                        SSornaActivity = SSornaActivity.ToUpper();
                    }

                    //Activities on Isla Sorna
                    switch (SSornaActivity) {
                        case "F":
                        //Visit the facilities
                        Console.WriteLine("The helicopoter takes you to the Site B");
                        Console.WriteLine("Worker Village. An InGen employee takes");
                        Console.WriteLine("you on a tour of the various buildings.");
                        Console.WriteLine("There is an Operations Center, managing the");
                        Console.WriteLine("island's activities; there are plantation-");
                        Console.WriteLine("style cottages, housing workers; there is a");
                        Console.WriteLine("lab, where DNA and egg production is managed;");
                        Console.WriteLine("and there is a small gas station. You are");
                        Console.WriteLine("impressed, and get a good night's sleep in");
                        Console.WriteLine("guest quarters.");
                        Console.WriteLine("YOU ARE ALIVE!\n");
                        //End of facility visit
                        break;

                        case "D":
                        //Visit the dinosaurs
                        Console.WriteLine("The helicopter sets you down beside a tall");
                        Console.WriteLine("pine forest. You feel as if you have traveled");
                        Console.WriteLine("back in time to the Mesozoic. Nearby, a herd");
                        Console.WriteLine("of stegosaurs drinks from a pond. A booming");
                        Console.WriteLine("sauropod sounds off in the distnace. After a");
                        Console.WriteLine("while, you hear a new animal sound. The");
                        Console.WriteLine("helicopter pilot's eyes widen, and tells you");
                        Console.WriteLine("it is time to go. Upon finding the helicopter,");
                        Console.WriteLine("a velociraptor is already lying in wait. You");
                        Console.WriteLine("turn to run, but two other raptors have");
                        Console.WriteLine("appeared, blocking your path! They leap into");
                        Console.WriteLine("the air and knock the two of you down,");
                        Console.WriteLine("slashing with toe-claws, biting into your");
                        Console.WriteLine("flesh with razor sharp teeth...");
                        Console.WriteLine("YOU ARE DEAD!\n");
                        //End of dinosaur visitN
                        break;
                    }
                    //End of island visit
                    break;
                }
                //Ask user if they wish to play again
                Console.WriteLine("Play again?");
                Console.Write("Type Y for Yes or N for No: ");
                STraveling = Console.ReadLine();
                STraveling = STraveling.ToUpper();

                //Check for valid answer
                while (STraveling != "Y" && STraveling != "N") {
                    //Inform user of incorrect input, recollect selection, convert input
                    Console.WriteLine("'" + STraveling + "' is not an answer!");
                    Console.Write("Type Y for Yes or N for No: ");
                    STraveling = Console.ReadLine();
                    STraveling = STraveling.ToUpper();
                }
            }

            Console.WriteLine("Thank you for visiting InGen's facilities!");
            Console.WriteLine("Have a nice day. \n");
            Console.Write("Press any key to exit.");
            Console.ReadKey();
        }
    }
}
User avatar
Rebel
-=TresCom Developer=-
-=TresCom Developer=-
Posts: 6119
Joined: Sun Nov 10, 2002 10:26 pm
Location: That country nobody likes (you know the one)
Contact:

Re: Drac Codes: Getting into C# programming again!

Post by Rebel »

Draconisaurus wrote: Mon Mar 04, 2024 5:08 pm What sort of things did you code in the Airforce?

Eh, even after all these years, I still never talk about that, Drac. Let's just say that Russia was our most dangerous adversary
at the time, and most of our efforts pertained to keeping our ears and eyes on them in the most clandestine ways. I'm none
to fond of China these days either.
I'll never trust either -

And, any comments on my tiny program?
I just downloaded it. I'll give it a look, see what yah got. ;) I don't think that I've played a text-based game in years, but
anything trespasser related in aok with me.
User avatar
Rebel
-=TresCom Developer=-
-=TresCom Developer=-
Posts: 6119
Joined: Sun Nov 10, 2002 10:26 pm
Location: That country nobody likes (you know the one)
Contact:

Re: Drac Codes: Getting into C# programming again!

Post by Rebel »

Works fine, Drac. I'd suggest adding more options since it is rather short (although I'm assuming that you just started this). The Dinos option could have
something like 'choose run away' or 'stay and fight', or something similar. Maybe add randomization to the equation as well. ;)
User avatar
Draconisaurus
T-Rex Killer
T-Rex Killer
Posts: 14046
Joined: Mon Dec 06, 2004 5:21 pm
Antispam: No
Location: Isla Sorna
Contact:

Re: Drac Codes: Getting into C# programming again!

Post by Draconisaurus »

Russia and China, hmmm. Sounds deep. And a bit exciting. For myself, as with Tres, I don't like to get paid for my artforms. I just like to make stuff people can go around in.

Well this text adventure game was really meant to be my version of "Hello World!", nothing more than an intro game to make sure I knew the steps of making a program start to finish. Rather than making this one longer, I have multiple plans for future text adventures. The most notable of which is - a text adventure based on the Tres Walkthrough. It's sure to take a while, and I want to get some of the format down before I start it, so there'll be at least one game before that coming around from me. A simple option with randomly-generated success chance to run away from a raptor, is in the plans.
User avatar
Draconisaurus
T-Rex Killer
T-Rex Killer
Posts: 14046
Joined: Mon Dec 06, 2004 5:21 pm
Antispam: No
Location: Isla Sorna
Contact:

Re: Drac Codes: Getting into C# programming again!

Post by Draconisaurus »

Hey all! After several days I have finished my next program: the Trespasser Dinosaur Listing. It is a console application that lets you indicate levels and dinosaur species to view from the retail game, telling you how many of each species are in a level and what the names of those instances are. Not terribly exciting but hopefully worth a fun little exploration. Interested in any feedback:

https://www.mediafire.com/file/gnzrd0mb ... g.exe/file
TresDinoListScreen01.png
TresDinoListScreen01.png (30.21 KiB) Viewed 173 times
User avatar
Hilwo
Dilophosaurus
Dilophosaurus
Posts: 2644
Joined: Mon Nov 11, 2002 7:06 pm

Re: Drac Codes: Getting into C# programming again!

Post by Hilwo »

Cool! But; are the 'motion detectors' set to search only for the expected number of dinosaurs in a level, or also for any higher number? ;)
User avatar
Draconisaurus
T-Rex Killer
T-Rex Killer
Posts: 14046
Joined: Mon Dec 06, 2004 5:21 pm
Antispam: No
Location: Isla Sorna
Contact:

Re: Drac Codes: Getting into C# programming again!

Post by Draconisaurus »

Lmao. Method was to shift-select the base dino in the basement, which selects all instances with a name that continues from that.
User avatar
Hilwo
Dilophosaurus
Dilophosaurus
Posts: 2644
Joined: Mon Nov 11, 2002 7:06 pm

Re: Drac Codes: Getting into C# programming again!

Post by Hilwo »

Draconisaurus wrote: Fri Mar 15, 2024 4:24 pm Lmao. Method was to shift-select the base dino in the basement, which selects all instances with a name that continues from that.
Clever :) Could it be used in-game somehow, or was that not what you had in mind?
User avatar
Draconisaurus
T-Rex Killer
T-Rex Killer
Posts: 14046
Joined: Mon Dec 06, 2004 5:21 pm
Antispam: No
Location: Isla Sorna
Contact:

Re: Drac Codes: Getting into C# programming again!

Post by Draconisaurus »

Don't quite follow. What would be used ingame?
User avatar
Hilwo
Dilophosaurus
Dilophosaurus
Posts: 2644
Joined: Mon Nov 11, 2002 7:06 pm

Re: Drac Codes: Getting into C# programming again!

Post by Hilwo »

Draconisaurus wrote: Sat Mar 16, 2024 4:14 pm Don't quite follow. What would be used ingame?
What I meant was, could it be used ingame in such a way that a player character could use a monitor like that to 'scan' the area and be notified which dinosaurs would be in the vicinity?
User avatar
Draconisaurus
T-Rex Killer
T-Rex Killer
Posts: 14046
Joined: Mon Dec 06, 2004 5:21 pm
Antispam: No
Location: Isla Sorna
Contact:

Re: Drac Codes: Getting into C# programming again!

Post by Draconisaurus »

Argh I wouldn't know how to do that. The app above is simply for telling you how many of each dino there are in a given retail level, and what their instance names are. Can't really use it while playinng, and it gives no info on location.

I am having second thoughts on the Walkthrough console app text adventure. I may still do it; however I am starting to think there might be an element, as with accuracy modeling. High stress from the attempt to remain accurate. I like a bit of wiggle room for creativity. We'll see. My next project is a small text adventure set in the film Worker Village.
User avatar
Hilwo
Dilophosaurus
Dilophosaurus
Posts: 2644
Joined: Mon Nov 11, 2002 7:06 pm

Re: Drac Codes: Getting into C# programming again!

Post by Hilwo »

Draconisaurus wrote:Argh I wouldn't know how to do that. The app above is simply for telling you how many of each dino there are in a given retail level, and what their instance names are. Can't really use it while playinng, and it gives no info on location.
No worries, it was just a thought :) Your app reminded me of the portion in the novel where Malcolm pointed out their dino counter flaw.
Post Reply