This forum is locked and will eventually go offline. If you have feedback to share you can find us in our Discord channel "MythoLogic Interactive" https://discord.gg/nECKnbT7gk

Forum rules

Auto completion text in the script IDE

Here you can find answered ScriptAPI topics.
Forum rules
By using the forum you agree to the following rules.
Locked
User avatar
JakSparro98
Superfighter
Superfighter
Posts: 530
Joined: Fri Jul 15, 2016 7:56 pm
Started SFD: PreAlpha 1.0.5
Location: Rome, Italy
Gender:
Age: 27

Auto completion text in the script IDE

Post by JakSparro98 » Thu Jul 21, 2016 6:52 pm

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?
2 x

User avatar
Motto73
Superfighter
Superfighter
Posts: 316
Joined: Mon May 09, 2016 7:35 am
Title: Lazy ass
SFD Account: Motto73
Started SFD: Multiplayer Test Demo
Location: Sunny City
Gender:
Age: 26

Post by Motto73 » Fri Jul 22, 2016 11:51 am

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.
0 x
Image

User avatar
JakSparro98
Superfighter
Superfighter
Posts: 530
Joined: Fri Jul 15, 2016 7:56 pm
Started SFD: PreAlpha 1.0.5
Location: Rome, Italy
Gender:
Age: 27

Post by JakSparro98 » Fri Jul 22, 2016 1:52 pm

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).
0 x

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

Post by Gurt » Fri Jul 22, 2016 10:26 pm

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.
2 x
Gurt

Locked