Ladies and Gents:

These forums are now closed and registration disabled.

Please join us at our new forum on Proboards. Our hope is that these new forums are more stable, provide more and better features, and allow continuation of the project forums in a safer, more secure, long term environment.


--The ME3Explorer Team

Visual Studio and code intro

Made by modders for modders. Step-by-step instructions on how to achieve specific modding goals with ME3Explorer. We *strongly* encourage you to post new tutorials on the wiki.

Visual Studio and code intro

Postby KFreon » 15 Jan 2014, 15:52

Introduction to VS for beginners and code for those who want it.

The prospect of trying to read code is daunting to say the least to most people. Unfortunately it is very useful to us coders, to have users who can give detailed information on a problem they're having.

So there are two kinds of people who want to use VS:

1) Users: People who want (Or I want) to look get more info on a problem they're having.
2) Beginner coders: People who want to learn how to code.

Both of these will be looked at here, but the coding part is at the end hidden.

Intro to debugging
First thing you need is the source code. Get the svn version for that.
Then open the solution file.

DON'T FREAK OUT!! It looks really complicated and weird, but ignore everything and just look at the important parts.

Now, if you're having a crash ie an exception, you can just start the program debugging by clicking "Start". ME3Explorer starts, then you just do what you do to make things break and wait till it does.
Then you get to the fun part. Basically just screenshot it for us, but if you want to know what's happening, read on.

Now you're in break mode. From here, you get the exact conditions where things broke. You can see the variables in question, the threads in action, and even change things if you want (Don't though...).

Intro to coding
This is a little more complicated to explain...

Right, so if you open one of the source files, say my "KFreonTools.cs" from the right hand pane, you get this giant wall of text.

From here, I've highlighted some important things. First of all, the file you just opened is a class. A class is like a box. This box has stuff in it, but it also has holes, some go in and some go out.
Functions link the in and out holes so that when you put stuff in, something happens inside the box, and maybe something goes out.

Now my class implements (ie copies some things of a larger box) the Form class. That is, it becomes a Form (Read: Window) with some extra functions in it.

Now, functions. These are the substance of things. A function takes something in, does stuff to it, and spits something out. The highlighted one there takes in a variable called "tex" which is of type TexNodeHash. The type tells the function what to expect. A simple type would be an int (a number) or a string (sequence of characters).
Back to the function.
Note the format of the definition:
permission returntype name(vartype varname)

Ignore the permission for now. The return type is the type of variable the function will return.
This one returns an array of bytes. Probably just google that stuff.

And that's a basic intro...not very complete or easy to read I'm sure.

Any questions, don't hesitate to ask :D

KFreon has been thanked by:
User avatar
Toolset Developer
Posts: 1665
Joined: 16 Apr 2013, 00:57
Has thanked: 83 time
Have thanks: 520 time

Re: Visual Studio and code intro

Postby FemShep » 17 Apr 2016, 07:04

A coder not using the dark theme!? Madness. How can one program into the morning hours with that white theme?
ME3Tweaks has modding guides, tools, forums for mods, a modding wiki, and ModMaker, an online mod creation tool.
ME3 Mod Manager, the civilized way of installing and managing ME3 mods.
ME3Tweaks Facebook Page
User avatar
Posts: 1101
Joined: 18 Oct 2012, 20:48
Has thanked: 42 time
Have thanks: 76 time

Re: Visual Studio and code intro

Postby KFreon » 17 Apr 2016, 11:07

How else does one wake up in the morning...
Dopamine needs a kick start :D
User avatar
Toolset Developer
Posts: 1665
Joined: 16 Apr 2013, 00:57
Has thanked: 83 time
Have thanks: 520 time

Return to Modders' Tutorials

Who is online

Users browsing this forum: No registered users and 0 guests