Page 1 of 1

Small Script API things we are still waiting

Posted: Sun Mar 20, 2016 11:18 am
by chelog
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.

Re: Small Script API things we are still waiting

Posted: Sun Mar 20, 2016 3:51 pm
by Gurt
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).

Re: Small Script API things we are still waiting

Posted: Sun Mar 20, 2016 8:18 pm
by chelog
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.