PDA

View Full Version : Using Visual Studio for Extension creation



Tielc
May 24th, 2018, 21:01
Does anyone here use Visual Studio for Extension creation? I use it personally to occasionally write c# windows apps. I'm finding the translation to pure xml and lua a little less than desirable and looking for pointers.

Visual Studio (Community) does some stuff really well, like formatting xml quickly understanding line breaks and indentation. However, it doesn't understand object names, classes, etc. from the FG xmls or lua. I've downloaded the "official" microsoft lua extension, and I'm not seeing a lot here. This is especially compounded when trying to add lua to an xml's script tag, it just throws in the towel on trying to understand anything including indentation.

On the flip side, Notepad++ is great at at least recognizing previously written strings in the file. This makes mistyping mistakes less frequent and find this very valuable. However, Notepad++ seems to struggle more with xml auto completions, understanding indentations, and my goodness, makes me shift+home all the time to remove full lines (as opposed to shift + delete).

It's like I'm trying to find a magical in-between. So beyond commiserating my experiences in these two products, has anyone found a way to get to a happy state of zen between the two?

darrenan
May 24th, 2018, 21:09
I'm in the same boat as you. Neither tool seems to be ideal, but I tend to use VS the most, mostly for the GIT integration so I can source-control my extensions.

Talyn
May 24th, 2018, 21:10
Nab the "XML Tools" addon for Notepad++ and that addresses everything you just mentioned, except possibly shift+delete, which I don't think I've ever used anyway, so don't miss it.

Tielc
May 25th, 2018, 02:56
Nab the "XML Tools" addon for Notepad++ and that addresses everything you just mentioned, except possibly shift+delete, which I don't think I've ever used anyway, so don't miss it.

This was really helpful, thanks for the tip! Any ideas on how to get the auto indent to work? I have the option enabled in the Notepad settings, but doesn't seem to do anything here (or for lua for that matter). I'll keep poking around looking for clues, but the auto closing tags was a big help already!

Varsuuk
May 25th, 2018, 04:35
I’ve been working with the Eclipse IDE. I loaded in the lua environ and use the git integration as well. I don’t do much fancy stuff but I usually softlink the ruleset from the clips workspace to the FG rulesets directory. Same for any module I am working on. The other rulesets/modules I scan for answers/ideas I simply import folder/filesystem where I select make link.

It definitely isn’t as good as when used as a Java or C++ ide.But for me, the left panel organization plus the context sensitive outlining makes navigation easier..

Valyar
May 25th, 2018, 07:47
I am using Visual Studio Code and/or Notepad++. Both have XML plugins for syntax color coding, XML tree view and tools to manipulate it. VSCode I also use for PowerShell and Python.
Still, don't know how good both are for LUA - I haven't yet started working with it (FG is the only use-case for LUA for me, so priorities in RL :O )

Visual Studio (I run Enterprise) is a bit of a overkill for me without proper SDK for FG that provides all nice features I am used to in C#.

dulux-oz
May 25th, 2018, 08:01
I've written all the DOEs, the DORCore, and the 13th Age Ruleset, CoreRules Module and Bestiary (plus ongoing projects) all in Notepad++

Valyar
May 25th, 2018, 08:07
I've written all the DOEs, the DORCore, and the 13th Age Ruleset, CoreRules Module and Bestiary (plus ongoing projects) all in Notepad++

What plug-ins are you using in Notepad++? Do you use an extension for have a tree-like folder structure or you deal with tabs, for example. I find having the project view of VS indispensable when working on projects with more than few files and folders (and FG's rulesets are quite big)

dulux-oz
May 25th, 2018, 08:33
I have a "tab list" down the right-hand side of my screen and flip from file to file as needed.

The global "find & replace" is really useful as well (baring the odd "oh sh!t" moment) :)

celestian
May 25th, 2018, 17:47
I've tried several different editors, like Atom, Notepad++, VS and a couple more I can't recall. I tend to always fall back to Notepad++ after a bit. Most of them have similar functionality (searchin, file content searches/directory search, context highlight, auto-complete, plugins/addons) but I've just found myself liking the simple view and interface of notepad++ a little more. I might go back and give Visual Studio a try again mainly because I've been teaching myself Unity and it's bundled with that... so no need to use 2 different ones if I can avoid it.

Valerian Stormbreaker
April 26th, 2019, 00:17
I'm new to programming FG extensions, rulesets and modules, but I'm a professional software engineer with over 20 years experience. When I used to program Valve server plugins using SourceMod, I extended visual studio to do various things to make plugin development easier. Because I'm new here, I'm not sure if any of these things will help, but the following link will show you how to do a lot of custom stuff in VS:

https://wiki.alliedmods.net/Building_SourceMod_Plugins_With_Visual_Studio

Varsuuk
April 26th, 2019, 03:25
My only (work) experience with VS dates back to 1.52 and brief use of 4.0. Even with so little current info. I keep installing all the versions since I’ve always had full MSDN with all but my time in Goldman - but I have only played a little with it and C#. Otherwise, it is GCC for my development and anything from KDE in old to Eclipse/Netbeans more currently. (I’ve worked in Solaris/Unix or Linux exclusively since ‘98 as much as I like VS it’s not too applicable)

Extensions are Lua and XML. The Lua is not “run” per se but embedded (with some restrictions and couple added features) in what I will call (no knowledge of it) the FG “engine”.

The only time I’ve ever used an IDE to do any work with FG “directly” was Par5e and my midway abandoned SWParse (no point eventually I’m updating parse when Turin game module creation matured to point of no longer needing it)

Since then, with my work on a ruleset, I’ve found it convenient for me to use Eclipse with Lua plug in. That doesn’t do anything for me test/run it’s just so it colors it and some other minor things. I know many use awesome text editors on Windows which worked great for me when was using parse (I have it but forgot) but I just am used to Eclipse from using it so much for years I my fingers can do stuff even when si am asleep which is usually late nights when work on it so it’s a good thing.

I’d advise you to use VS if it’s your editor of choice, but it will just be that - glorified Vi ;)

celestian
April 26th, 2019, 05:58
I’d advise you to use VS if it’s your editor of choice, but it will just be that - glorified Vi ;)

Nothing is glorified about VI :p I've been a unix systems engineer for 20+ years and I still only use it long enough to install something else ... which tends to be almost never.

Varsuuk
April 26th, 2019, 07:10
Indeed ;)

I used vi as the “simplest” (yes there are more basic pick, nano, etc but I meant it to be more generally recognizable) ... I used to work with long haired hippies ;p and ponytailed Canadians who would use vi and things like ctags ... why ... for me, vi is for simple script edits, configuration edits, fast mod on some simple couple file source project maybe and I am ssh’ed over and not worth (or allowed) to x over etc.

I swear this seniors dev would do entire Solaris/C++ projects in Vi. I would also smh at the Emacs folks but at least they had something more resembling an actual “hi” but the commands? Fahgeddibouddit

dulux-oz
April 26th, 2019, 07:58
Nothing is glorified about VI :p I've been a unix systems engineer for 20+ years and I still only use it long enough to install something else ... which tends to be almost never.

I know - that's why I switched to VIM :p

Valyar
April 26th, 2019, 10:04
Right...

Varsuuk
April 26th, 2019, 12:39
Well, ViM, of course...why didn’t you say so - that’s different - completely different - I withdraw my rant :)


I know - that's why I switched to VIM :p

celestian
April 26th, 2019, 15:13
I know - that's why I switched to VIM :p

I use "joe" in nix. It was one of the first ones to allow multiple files at once in window/views. There are probably some others now.