New to the forum? Say hello in this topic! Make sure to read the rules.
RULE NR 3 UPDATED: Don't hurt, harass or provoke other forum members or people.

Debugging a script for SFD in Visual Studio

Share questions and tutorials related to the ScriptAPI and give suggestions for new functions you want to see.
Forum rules
By using the forum you agree to the following rules.
Post Reply
User avatar
Gurt
Lead Programmer
Lead Programmer
Posts: 901
Joined: Sun Feb 28, 2016 3:22 pm
Title: Lead programmer
Started SFD: Made it!
Location: Sweden
Gender:
Age: 27

Debugging a script for SFD in Visual Studio

Post by Gurt » Mon Nov 13, 2017 6:44 pm

 ! Message from: Gurt
This feature is available in Beta v.1.0.1
If you have Visual Studio installed you can debug scripts written in Superfighters Deluxe directly through the IDE with breakpoints.
This is done by pointing to the Visual Studio devenv.exe in you config.ini for SFD with DEVENV as key and full path to the devenv.exe as value. Example:
DEVENV=C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe

If DEVENV is setup the map editor will generate a full .cs source file each time you test run a map. This file will be opened in Visual Studio. Once the file has been opened you can set breakpoints and inspect your private values as you test your map.

To set breakpoints in any early code (like OnStartup) you can insert System.Diagnostics.Debugger.Break();

A few limitations apply.
- You can not edit and continue execution.
- You will not be able to inspect any proxy objects (any classes from the ScriptAPI) you may hold as references. (Workaround involves first reading any values to private variables and then inspecting those.)

This will hopefully help some of you create even better scripts.
Good luck!
1 x
Gurt

User avatar
Venom
Fighter
Fighter
Posts: 52
Joined: Sun Apr 09, 2017 3:49 pm
Title: DEAD
SFD Account: DEAD
SFD Alias: DEAD
Started SFD: DEAD
Location: DEAD
Gender:
Age: 14
Contact:

Post by Venom » Tue Nov 14, 2017 5:21 pm

will codeblocks work or IDE is required?
0 x
IM DED

User avatar
Gurt
Lead Programmer
Lead Programmer
Posts: 901
Joined: Sun Feb 28, 2016 3:22 pm
Title: Lead programmer
Started SFD: Made it!
Location: Sweden
Gender:
Age: 27

Post by Gurt » Tue Nov 14, 2017 6:31 pm

Venom wrote:
Tue Nov 14, 2017 5:21 pm
will codeblocks work or IDE is required?
Code::Blocks? Don't think it supports C# unless it's some plugin or newer support. I haven't tried any other IDE other than Visual Studio so I don't know.
0 x
Gurt

User avatar
Venom
Fighter
Fighter
Posts: 52
Joined: Sun Apr 09, 2017 3:49 pm
Title: DEAD
SFD Account: DEAD
SFD Alias: DEAD
Started SFD: DEAD
Location: DEAD
Gender:
Age: 14
Contact:

Post by Venom » Wed Nov 15, 2017 11:05 am

Gurt wrote:
Tue Nov 14, 2017 6:31 pm
Venom wrote:
Tue Nov 14, 2017 5:21 pm
will codeblocks work or IDE is required?
Code::Blocks? Don't think it supports C# unless it's some plugin or newer support. I haven't tried any other IDE other than Visual Studio so I don't know.
ok...
0 x
IM DED

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests