Visual C# Express 2010 - Battle Dome Config help

Started by nathmatt, March 11, 2011, 02:13:20 pm

Previous topic - Next topic

nathmatt

March 11, 2011, 02:13:20 pm Last Edit: March 12, 2011, 09:11:44 am by nathmatt
ok i have almost completely rebuilt my Battle Dome Config program but im not sure if i should build the terrain config the same way as i did in python or if there if a better way in visual C#
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Blizzard

Use what you prefer. It's entirely up to you. I personally would use C# because I like it more. It is easier to make a functional GUI with it and it's faster to work with.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

nathmatt

March 11, 2011, 05:25:48 pm #2 Last Edit: March 11, 2011, 09:43:46 pm by nathmatt
oh thats not what i ment the layout of such this
Spoiler: ShowHide


which represents these 2 codes

Terrains[1] = [M,X,Y,D]


and

def self.Terrains(id)
 case id
 when 1 then return [list of maps]
 end
end


what i meant was is there a more effeciant or ezer to custimize way of doing that in c# thats done in python but c# should allow me to create a smaller aplication considering all they might need the latest .net
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


ForeverZer0

Do you mean you want the C# equivilant of those two snippets?
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

nathmatt

not realy just trying to figure out a better way to do it im thinking maybe a tree view but i can't figure out how to add more items to it
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


ForeverZer0

Use a List. Use this reference:
using System.Collections.Generics


Make a class or struct for Terrains, then you can initialize a list like this:
List<Terrain> terrains = new List();


Then you can manipulate it very much like a Ruby array.
terrains.Add(new Terrain(M, X, Y, D) // Substitue them values, obviously
terrains.RemoveAt(Index)
...etc, etc


Intelisense will help you with all the methods and what not.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

nathmatt

as for the aplication should i keep the same look ? as the 1 done in python
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


ForeverZer0

March 11, 2011, 11:25:08 pm #7 Last Edit: March 11, 2011, 11:33:52 pm by ForeverZer0
Let me go check it out. I honestly don't remember you posting it. Give me a few minutes....

EDIT:
Personally I would expand the size of the window and do away with the tabs. You can then simply have the generated script pop up in a dialog, or even have a SaveFileDialog pop up and save the text doc to a file.

If you want, I can upload you a copy of my CCTS Config solution so you can check out a few examples. One good thing if you do this in C#, you should be able to take the filesize of your app from 16 MB to probably less than 1 MB.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

nathmatt

March 11, 2011, 11:36:53 pm #8 Last Edit: March 12, 2011, 09:14:58 am by nathmatt
yea thats y i was making it in c# because by using python all the moduls i used had to be included but in c most if not all the moduls are already there.

and sure pm me or post ur CCTS Config project

edit ok i see what you mean i like that idea better i have a c# related question if i wanted to access the MapInfos to get lists of the names, ids, width, and, height what would i need to do.
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


ForeverZer0

Do you mean the .rxdata?
If so, that is a little more complicated. You would need to embed Ruby or IronRuby and have it dump the Marshalled data, setting the classes using an .rb file you have created to emulate RPG::MapInfos. Although embedding IronRuby in C# isn't overly complicated, this is kind of over-complicating a simple problem, and one that won't be too difficult for the user to enter themselves.

It would be far easier to just have your program make the user type it in, and then be able to save the settings. Serialization in C# is really easy, you can find some examples in the CCTS Config solution you got. To make it easier, include some methods to "batch" setup maps to reduce the pain-in-the-ass factor.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

nathmatt

ok so i have a list of classes and im tring to get it to send my data from the class with a specific id som i have

public static int[] Get_info(int id)
        {
            int m = 0;
            int x = 0;
            int y = 0;
            foreach (TerrainInfo t in TerrainInfos)
            {
                if (t.ID == id)
                {
                    m = t.Mapid; x = t.X; y = t.Y; int[] terrain = new int[] { m, x, y };
                    return terrain;
                }
            }
            return null;
        }


and i am trying to set the value of the numeric control with the value returned

int id = listTerrains.SelectedIndex;
Array terrain = Utility.Get_info(id);
TerrainMap.Value = terrain.GetValue(0);

but it says im getting an object and not a decimal what am i doing wrong
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Blizzard

Decimal is a special data type and is not the same as float. Use decimal.something to convert it. I can't remember now the name of the method.

I also suggest you use lambda expressions. :)
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.