Page 1 of 1
Auto completion text in the script IDE
Posted: Thu Jul 21, 2016 6:52 pm
by JakSparro98
I don't think right now there is a shortcut for autocomplete words or display all available methods/attributes for a class when typing.
So I want to ask, there will be an IntelliSense-like system in the script IDE?
Re: Auto completion text in the script IDE
Posted: Fri Jul 22, 2016 11:51 am
by Motto73
Yeah, that would be nice to know. I have scripted with MonoDevelop-IDE and I love it when I'm typing and then it suggests some methods etc.
It would be great if we had this in our IDE, especially for new coders.
Re: Auto completion text in the script IDE
Posted: Fri Jul 22, 2016 1:52 pm
by JakSparro98
Motto73 wrote:Yeah, that would be nice to know. I have scripted with MonoDevelop-IDE and I love it when I'm typing and then it suggests some methods etc.
It would be great if we had this in our IDE, especially for new coders.
Not only for new coders, if gurt decides to modify or add new methods and classes you don't need to open the documentation anymore, because in the IDE you can see the parameters that the function has, what type it returns or also open a short documentation popup for the method you are over with the mouse (like in Eclipse).
Re: Auto completion text in the script IDE
Posted: Fri Jul 22, 2016 10:26 pm
by Gurt
Map Editor Help wrote:Note: The script window is a plain-text editor and does not provide any visual aid in your code.
I will not bother with implementing a suggestion box. Not the focus for SFD.
If you want some visual aid I suggest you use Notepad++ with C# language selected. When done in Notepad++ simply copy-paste your code into the Script window. This is how I create smaller scripts.
If you want a full IDE with intellisense for larger scripts I suggest you do the following:
1: Download and install Microsoft Visual Studio Community 2013.
2: Create a new C# console project.
3: Add a new reference and browse to the SFD.GameScriptInterface.dll file and select it in the SFD installation folder.
4: Create and add the following class to your project:
Code: Select all
// All available system namespaces in the ScriptAPI (as of Pre-Alpha 1.9.4).
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using SFDGameScriptInterface;
namespace ConsoleApplication1
{
class MyScript : GameScriptInterface
{
/// <summary>
/// Placeholder constructor that's not to be included in the ScriptWindow!
/// </summary>
public MyScript() : base(null)
{
}
/* SCRIPT STARTS HERE - COPY BELOW INTO THE SCRIPT WINDOW */
public void OnStartup()
{
HelloWorld();
}
void HelloWorld()
{
Game.ShowPopupMessage("Hello World!");
}
/* SCRIPT ENDS HERE - COPY ABOVE INTO THE SCRIPT WINDOW */
}
}
5: Start coding with full intellisense and live error checking. Compile. No errors? Copy-paste the code between the "SCRIPT STARTS HERE" and "SCRIPT ENDS HERE" comments into the ScriptWindow and try running the code in SFD.