Jump to content
Xtreme .Net Talk

coder4hire

Members
  • Posts

    3
  • Joined

  • Last visited

coder4hire's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Greetings! I am trying to write a program for a friend that basically takes away some of the work a DM has to do in D&D. What I need the most help with is XML. I am trying to convert some of the tables in the DMs guide to XML. Having practically no prior experience in doing so, I find myself needing some assistance in not only creating the initial XML files, but also figuring out a good way to parse through the file based upon a randomly generated dice roll. A small example of the table I have chosen to start off with converting to XML is as follows: Level d% ---Coins--- d% Goods d% Items 1st 01-14 ---- 01-90 ---- 01-71 ---- 15-29 1d6X1,000 cp 91-95 1 gem 72-95 1 mundane 30-52 1d8X100 sp 96-100 1 art 96-100 1 minor 53-95 2d8X10 gp 96-100 1d4X10 pp For those that have never ran a D&D game, you roll 3 times for each level of treasure you want to generate. Once for coins, once for Goods and once for Items. I already have a Roller class that generates random dice rolls based on the number of die you pass it and the die type (d4, d6, d8... etc.). What I want to do is convert the above table to XML so that, once the DM chooses the level he wants from a Dropdownlist, I can have my program generate 3 rolls of a d100 and automatically select the proper treasure for each of the three categories for that level. It would also be very nice if it automatically calculated the total number of treasures (coins, goods and items) for each category. But that may be something I do not implement right away. I am rambling on too much. I know you all don't need all the details. Basically what I am trying to do is make it so that the DM doesn't need to concentrate so much on rolling dice. That way he/she can concentrate more on the storytelling aspect of the game. And, as an added benefit, I get to learn more about XML and programming in .NET. Any help with a good way to format the above table into an XML file and then parse through it the way I need to would be greatly appreciated. :) --coder
  2. Okay, I have run into problems like this before when trying to browse workgroup computers. You could be right about using UNC to pass the server and path name. After re-reading your original post (should have paid better attention the first time LOL), it appears that you may have created an object reference in your code and then not set that reference to an instance of that object. An example of doing this (in C#) might be as follows: SqlCommand myCommand; That is an example of creating a reference to an object but not instantiating (creating an instance of) it. In C# there are 2 ways to instantiate an object. You can do so when you first reference it, like so: SqlCommand myCommand = new SqlCommand(someCommandString); //This creates a reference to the object SqlCommand and instantiates it Or, as follows: SqlCommand myCommand; //This creates the object reference only myCommand = new SqlCommand(someCommandString); //This actually instantiates the object referrence As bpayne111 stated, without looking at your code it is difficult to say what might be causing the problem. Try setting break points in your code and then Stepping Into it (F11, I believe??) one line at a time to find out where the exception occurs. This should give you a good idea of what is causing the problem and where to fix it. Sorry for the previous confusion. Don't know what I was thinking. LOL. --coder
  3. Your problem is that you are running two different workgroups. Your Win98 PCs and your WinXP PC cannot "see" each other. Try putting all PCs in the same workgroup. That should fix your problem. --coder
×
×
  • Create New...