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

ScriptAPI changes

Share questions, scripts and tutorials related to the ScriptAPI in SFD.
Forum rules
By using the forum you agree to the following rules.
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

Re: Planned ScriptAPI changes

Post by JakSparro98 » Sun Feb 12, 2017 4:46 pm

With my last script request I notice that we would need of a command that prevent an object from being destroyed next tick, for instance if I catch with "DestructionInitiated" a true response then I can cancel object destruction with an ipotetic "CancelDestructionInitiated" and reset his health.
3 x

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 » Mon Mar 06, 2017 10:49 pm

I have other three entries for the IPlayer class:

IsBazookaRiding: boolean, true if a player is riding a bazooka rocket, false if not

GetManualAimAngle: float, gets the angle in degreer/radiants of half circle (0 to 180 because with FacingDirection
we can check the side the aiming is)

IsChatTyping: boolean, true if a player have opened the chat, false if not.
3 x

Armadyl5
Superfighter
Superfighter
Posts: 119
Joined: Sun Mar 20, 2016 9:50 am
Started SFD: 1.2.1
Gender:
Age: 27

Post by Armadyl5 » Sat Mar 11, 2017 12:39 am

I want to suggest adding an "infinite block" as a command
1 x
Never Surrender !

Always Fight For Your Rights , and Don't Let Your Friends Down .

User avatar
RickAvory
Superfighter
Superfighter
Posts: 787
Joined: Wed Oct 12, 2016 11:27 pm
Title: Sunny City Nationalist
SFD Account: Rick Avory
SFD Alias: (EA) Rick Avory
Started SFD: Sep 2016
Location: United States
Gender:
Age: 25
Contact:

Post by RickAvory » Mon Mar 13, 2017 12:09 am

I am have no clue how to download scripts now since the script folder is now gone. Could someone guide me how to add them. Also, i am looking for the team script but i cant seem to find it anywhere so a link to it would be very helpful. Thanks.
0 x
We must root out the impurities in our midst

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 Mar 31, 2017 12:31 am

As a result of a topic about colors handling for the IObject class we realized that there isn't a way to change a tile color through scripts.

I suggest two new entries, one in the IGame, adding a new parameter in the "CreateObject" method, something like "ColorPalette TileColor" and if the tile doesn't permit coloration this parameter won't affect the tile rather than make the script to crash.

The other in the same IObject, a SetColor method with a palette as only parameter, after all, currently we can already get the color palette but without change it in game, it's only needed the reverse operation.
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 Mar 31, 2017 9:13 pm

JakSparro98 wrote:As a result of a topic about colors handling for the IObject class we realized that there isn't a way to change a tile color through scripts.
Nope, but it's already part of the planned ScriptAPI changes. No need to suggest it when it's already planned. ;)
0 x
Gurt

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 Mar 31, 2017 9:24 pm

Gurt wrote:
JakSparro98 wrote:As a result of a topic about colors handling for the IObject class we realized that there isn't a way to change a tile color through scripts.
Nope, but it's already part of the planned ScriptAPI changes. No need to suggest it when it's already planned. ;)
Sorry, I could've sworn to have not seen this point in the planned list. :oops:
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 » Sun Jan 27, 2019 2:52 pm

JakSparro98 wrote:
Fri Mar 31, 2017 9:24 pm
Gurt wrote:
JakSparro98 wrote:As a result of a topic about colors handling for the IObject class we realized that there isn't a way to change a tile color through scripts.
Nope, but it's already part of the planned ScriptAPI changes. No need to suggest it when it's already planned. ;)
Sorry, I could've sworn to have not seen this point in the planned list. :oops:
Able to change color on objects will come in the v.1.1.0 update, as long as the color is available in the color palette.
2 x
Gurt

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 » Wed Jan 30, 2019 10:38 pm

Able to send chat messages to everyone or individual users will come in the v.1.1.0 update.

Code: Select all

        /// <summary>
        /// Shows a chat message to all users. 
        /// </summary>
        /// <param name="message">Message to show. Max 400 characters.</param>
        public abstract void ShowChatMessage(string message);

        /// <summary>
        /// Shows a chat message to all users.
        /// </summary>
        /// <param name="message">Message to show. Max 400 characters.</param>
        /// <param name="color">Color</param>
        public abstract void ShowChatMessage(string message, Color color);

        /// <summary>
        /// Shows a chat message to a specific user.
        /// </summary>
        /// <param name="message">Message to show. Max 400 characters.</param>
        /// <param name="userIdentifier">User to show message to. This is the IUser.UserIdentifier/IPlayer.UserIdentifier. If the user doesn't exist no chat message is sent.</param>
        public abstract void ShowChatMessage(string message, int userIdentifier);
        
        /// <summary>
        /// Shows a chat message to a specific user.
        /// </summary>
        /// <param name="message">Message to show. Max 400 characters.</param>
        /// <param name="color">Color</param>
        /// <param name="userIdentifier">User to show message to. This is the IUser.UserIdentifier/IPlayer.UserIdentifier. If the user doesn't exist no chat message is sent.</param>
        public abstract void ShowChatMessage(string message, Color color, int userIdentifier);
2 x
Gurt

Locked