Client Login Area
LiveZilla Live Chat Software
Main Menu
Results 1 to 1 of 1

Thread: My RPG System - VB.NET

  1. #1
    Verified Community Member
    Join Date
    March 8, 2010
    Location
    Lakewood, CO
    Posts
    700

    Default My RPG System - VB.NET

    So other than creating a Content Managment System (CMS) I'm also working on a RPG. Now the engine I'm using for the RPG is Ogre3D with a .NET plugin so I won't have to learn another language. Though I'd share some of the systems I have read up on and started to build. Also You may notice that i have it all for a CMD window. Thats because I'm testing things out before I start building the 3-D game.

    Character Class - This will change when I add more characters.

    Code:
    Imports System
    Imports System.Collections.Generic
    Imports System.Text
    
    *CENSORED* *CENSORED* Public Class Hero
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* Inherits Character
    *CENSORED* *CENSORED* *CENSORED* *CENSORED*Public Shared Sub Initialize(ByVal hero As Hero)
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* hero.CurrentHealth = 18
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* hero.MaxHealth = 18
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* hero.CurrentMagic = 8
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* hero.MaxMagic = 8
                hero.CurrentWeapon = Sword
                hero.CurrentArmor = Leather
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* hero.Strength = 10
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* hero.Defense = 3
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* hero.Agility = 6
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* hero.Experience = 0
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* hero.Gold = 0
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* While hero.Identifier Is Nothing OrElse hero.Identifier = "" OrElse hero.Identifier = " "
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* Console.WriteLine("What is your Hero's name?")
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* hero.Identifier = Console.ReadLine()
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* End While
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* hero.isAlive = True
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* hero.AttackDamage = hero.Strength
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* End Sub
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* End Class*CENSORED* *CENSORED*
    And here is a little save system. The extension will most likely be changed so people who have no knowldge of how to set default openers for files won't be able to change things. Not to mention there will be a better save system eventually

    Data Saving -

    Code:
    Imports System
    Imports System.Collections.Generic
    Imports System.Text
    Imports System.IO
    
     Public Class DataHandler
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* Public Sub New()
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* 
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* End Sub
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* Public Sub Save(ByVal hero As Hero)
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* If Directory.Exists("c:\SaveRPG") = False Then
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* Directory.CreateDirectory("c:\SaveRPG")
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* End If
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* Dim file As New StreamWriter("c:\SaveRPG\PlayerData.txt")
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* 
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* file.WriteLine(hero.CurrentHealth)
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* file.WriteLine(hero.MaxHealth)
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* file.WriteLine(hero.CurrentMagic)
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* file.WriteLine(hero.MaxMagic)            
        	    file.WriteLine(hero.CurrentWeapon)
    	    file.WriteLine(hero.CurrentArmor)
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* file.WriteLine(hero.Strength)
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* file.WriteLine(hero.Defense)
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* file.WriteLine(hero.Agility)
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* file.WriteLine(hero.Experience)
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* file.WriteLine(hero.Gold)
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* file.WriteLine(hero.AttackDamage)
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* file.WriteLine(hero.Identifier)
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* For Each item As String In hero.items
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* file.WriteLine(item)
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* Next
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* 
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* file.Close()
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* Console.WriteLine("Game Save successful")
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* Console.WriteLine("Press enter to continue...")
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* Console.ReadLine()
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* End Sub
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* 
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* Public Sub Load(ByVal hero As Hero)
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* Dim done As Boolean = False
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* Dim item As String
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* Dim file As New StreamReader("c:\SaveRPG\PlayerData.txt")
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* hero.CurrentHealth = Integer.Parse(file.ReadLine())
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* hero.MaxHealth = Integer.Parse(file.ReadLine())
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* hero.CurrentMagic = Integer.Parse(file.ReadLine())
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* hero.MaxMagic = Integer.Parse(file.ReadLine())
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* hero.Strength = Integer.Parse(file.ReadLine())
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* hero.Defense = Integer.Parse(file.ReadLine())
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* hero.Agility = Integer.Parse(file.ReadLine())
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* hero.Experience = Integer.Parse(file.ReadLine())
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* hero.Gold = Integer.Parse(file.ReadLine())
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* hero.AttackDamage = Integer.Parse(file.ReadLine())
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* hero.Identifier = file.ReadLine()
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* While done = False
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* item = file.ReadLine()
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* If item IsNot Nothing Then
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* hero.items.Add(item)
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* Else
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* done = True
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* End If
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* End While
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* 
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* 
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* file.Close()
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* Console.WriteLine("Load Successful {0}.", hero.Identifier)
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* Console.WriteLine("Press enter to continue...")
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* *CENSORED* Console.ReadLine()
    *CENSORED* *CENSORED* *CENSORED* *CENSORED* End Sub
    *CENSORED* *CENSORED* End Class

    Save system is not complete. As you can see that it's loading function is not complete. Next system I will be looking into is an Inventory. Not sure how I will implement this yet but I figrued for now just a listbox which will list all the items.

    A potion system is in the making already also. Not to mention a spells/skill system. Once I have the inventory system done and working I will start on the spells/skills and finish the potions.

    Whats with spaces being censored? This is totally confusing!
    Last edited by crzyone9584; April 19th, 2010 at 10:45 AM.
    Living to Kill, Killing to Live

    Come learn more about Project NLIXD!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •