Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.

New to the forum? Say hello in this topic! Also make sure to read the rules.

Small Script API things we are still waiting

Give us your input on how we may improve the ScriptAPI in the game in future versions.
Forum rules
By using the forum you agree to the following rules.
Post Reply
chelog
Fighter
Fighter
Posts: 10
Joined: Sun Mar 20, 2016 10:45 am
Title: 0110111101101011
SFD Alias: chelog
Started SFD: The first public version
Location: Saint-Petersburg, Russia
Gender:
Age: 21
Contact:

Small Script API things we are still waiting

Post by chelog » Sun Mar 20, 2016 11:18 am

Hello there!

As far I couldn't find a topic for API suggestions, I'll create this one.
I've been asking this many times but I'll just remind you if you did forget these:
  • OnTextChat( IUser user, string text ) - event to receive chat texts through script, so it's called by the game. Maybe this could also have a map editor trigger, but I think it's almost useless. It gives very wide possibilities to create mods from admin plug-ins to completely different gamemodes. We could make people choose options, for example class they want to use in game. Maybe return string in this method to display something instead of what player wrote. So return ""; will prevent the message from being displayed.
  • Game.SendChatText( IUser user, string text[, Color color] ) - a method to send text message to certain player ONLY. +Maybe some optional method like Game.SendChatTextToAll( string text[, Color color]). Would be awesome to use with previous one.
  • OnDamaged( IObject obj, float damage[, BaseObject attacker] ) - event to process received damage to any game object. (Some interesting feature may be that if this function returns some value (true for example), it disables default behavior of processing damage - so no damage dealt to the object, or even just return float here to apply damage). This way we can handle how damage is received and make different pseudo-"health levels" or even some counters and all that stuff.
The first two are very awaited by me and that would inspire me to make a whole bunch of new mods :) I know they are done not really hard.
Third one is very optional (as I know how hard it's to implement at current stage).

That's all for the moment. I'll update the topic if I remember anything else.
Last edited by chelog on Sun Mar 20, 2016 2:59 pm, edited 1 time in total.
0 x

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

Post by Gurt » Sun Mar 20, 2016 3:51 pm

I updated the planned ScriptAPI changes.

So in short you will be able to read user's chat message (restrictions apply) and you will be able to send individual chat messages or global messages similar to /msg (restrictions apply). I do not know when I will do this. Maybe I will go through the planned ScriptAPI changes shortly after the dedicated server software is done - that's the best estimate I can give you.

You will not be able to override the damage taken on objects though. It's not possible for me to do that without possible "buggy behavior" on the client-side because how the SFD's engine is designed today (and no, I won't rewrite it).
0 x
Gurt

chelog
Fighter
Fighter
Posts: 10
Joined: Sun Mar 20, 2016 10:45 am
Title: 0110111101101011
SFD Alias: chelog
Started SFD: The first public version
Location: Saint-Petersburg, Russia
Gender:
Age: 21
Contact:

Post by chelog » Sun Mar 20, 2016 8:18 pm

Gurt wrote:I updated the planned ScriptAPI changes.

So in short you will be able to read user's chat message (restrictions apply) and you will be able to send individual chat messages or global messages similar to /msg (restrictions apply). I do not know when I will do this. Maybe I will go through the planned ScriptAPI changes shortly after the dedicated server software is done - that's the best estimate I can give you.

You will not be able to override the damage taken on objects though. It's not possible for me to do that without possible "buggy behavior" on the client-side because how the SFD's engine is designed today (and no, I won't rewrite it).
Okay, good to know that. I'm really very interested in chat thingies, it's №1 priority for me :) . Will be patiently waiting for these.
0 x

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest