Page 1 of 1

[Discontinued] ScriptAPI Suggestions

Posted: Sun Feb 11, 2018 3:15 am
by JakSparro98
This thread was discontinued due to the opening of an official dedicated section for posting ScriptAPI related suggestions, you can post your ideas here, as a brand new thread for each of them.

This topic is used to collect small ScriptAPI suggestions that, like his map editor counterpart, won't take an entire thread to explain how they works.

You can suggest things like:
  • Attributes and methods / overloads additions for existing classes.
  • missing trigger functions that are already covered in the ScritpAPI but are not covered by triggers.

Re: ScriptAPI Suggestions

Posted: Sun Feb 11, 2018 11:37 am
by Gurt
I'm editing your topic here.
Let's just keep small suggestions like attributes, methods and overload functions to existing classes here.
You might also suggest missing triggers to functions that already existing in the ScritpAPI but is not covered by triggers.

Any other suggestions should be in it's own topic (new classes and brand new features - that's usually NOT small suggestions).

Re: ScriptAPI Suggestions

Posted: Sun Feb 11, 2018 3:17 pm
by JakSparro98
I took the trouble to modify again the previous post by even adding the trigger example you made, just to avoid misunderstanding.
Gurt wrote:
Sun Feb 11, 2018 11:37 am
[..]Let's just keep small suggestions like attributes, methods and overload functions to existing classes here.[..]Any other suggestions should be in it's own topic (new classes and brand new features - that's usually NOT small suggestions).
Good, now I know I can open a brand new thread to talk about classes addition without worries of a warning or something. :)

I take this opportunity also to say that IProfile.Accessory is misspelled.

Re: ScriptAPI Suggestions

Posted: Fri Feb 16, 2018 2:31 am
by JakSparro98
I was thinking about the possibility to get all objects inside a GroupMarker, a method addition like GetObjectsInGroup() that returns IObject[].
But how they will be handled when groups are not active? because they could return null if the marker is not triggered, but it's also true that those objects exist even if they are never spawned. I don't know how groups are internally handled but maybe accessing that informations before the effective spawn is not possible.

You can also spawn multiple objects from the same group, so which "generation" will be listed by the method? I was thinking about something similar to the CreatedObject from CreateTriggerArgs class, where only the last spawned object is kept.

EDIT: Another idea came but since writing a third post in a row seems a bit exaggerated I will limit to only edit this:

An overload of CreateObject that takes the same use to this suggestion I posted some time ago, simply the possibility to spawn an object deciding what side will the object face.

The overload should be something like this:
CreateObject (string objectID, Vector2 worldPosition, int FacingDirection);

Re: ScriptAPI Suggestions

Posted: Wed Feb 21, 2018 9:49 pm
by Motto73
I'd like to flip some objects through the scripts, like in the way you can do it in the map editor (shift+h and shift+v). I've been asked a lot about this.

Re: ScriptAPI Suggestions

Posted: Thu Feb 22, 2018 2:59 am
by Danger Ross
At the very least we need an option to change a bg object's color :x . everything else can be worked around either way.

Re: ScriptAPI Suggestions

Posted: Thu Feb 22, 2018 3:03 am
by JakSparro98
Danger Ross wrote:
Thu Feb 22, 2018 2:59 am
At the very least we need an option to change a bg object's color :x . everything else can be worked around either way.
Don't know what "everything else" is referring to but for tile color change, it's already planned here.

Re: ScriptAPI Suggestions

Posted: Thu Feb 22, 2018 9:58 pm
by Gurt
I thought the ScriptAPI had the face direction property available already. CreateObject now has an overload with a face direction parameter and added functions to get and set the face direction for any object. I'm already sensing a "Don't look back" kind of map - but should be possible to do already by tracking the player's position updates.

Don't know when/where you asked about the flip tile feature in the ScriptAPI Motto73 but as it's nicely presented here so I noticed it now. Might have slipped my mind if it's an old suggestion.

Re: ScriptAPI Suggestions

Posted: Sun Feb 25, 2018 2:07 am
by JakSparro98
Since we are talking about old suggestions I would like to bring up this other that basically consists of a boolean for the IPlayer class that can read for a player in a kneeling-like state when landing on ground.
Image

Re: ScriptAPI Suggestions

Posted: Thu Mar 01, 2018 7:45 am
by Motto73
IsShooting for IPlayer, that covers both hipfiring and firing while aiming. It would be logical addition, because I didn't find any method to see if the player is aiming and shooting. Only IsHipFiring.

Re: ScriptAPI Suggestions

Posted: Thu Mar 01, 2018 10:11 pm
by Gurt
Motto73 wrote:
Thu Mar 01, 2018 7:45 am
IsShooting for IPlayer, that covers both hipfiring and firing while aiming. It would be logical addition, because I didn't find any method to see if the player is aiming and shooting. Only IsHipFiring.
We don't have anything like an "IsShooting" state internally in SFD. All you do is using your weapon which may or may not be automatic or single-shots. How do you imagine the "IsShooting" property would work? Only true at the frame where you actually fire the weapon (if you have ammo left?) or do you imagine something else?

Re: ScriptAPI Suggestions

Posted: Fri Mar 02, 2018 5:51 pm
by Gurt
JakSparro98 wrote:
Sun Feb 25, 2018 2:07 am
Since we are talking about old suggestions I would like to bring up this other that basically consists of a boolean for the IPlayer class that can read for a player in a kneeling-like state when landing on ground.
Image
Adding IPlayer.IsRecoveryKneeling and IPlayer.IsRecoveryRolling to read. IPlayer.IsRecoveryKneeling is used to track that high drop forced kneel/crouch state.

Re: ScriptAPI Suggestions

Posted: Sun Mar 04, 2018 5:08 pm
by Motto73
Gurt wrote:
Thu Mar 01, 2018 10:11 pm
Motto73 wrote:
Thu Mar 01, 2018 7:45 am
IsShooting for IPlayer, that covers both hipfiring and firing while aiming. It would be logical addition, because I didn't find any method to see if the player is aiming and shooting. Only IsHipFiring.
We don't have anything like an "IsShooting" state internally in SFD. All you do is using your weapon which may or may not be automatic or single-shots. How do you imagine the "IsShooting" property would work? Only true at the frame where you actually fire the weapon (if you have ammo left?) or do you imagine something else?
I thought of the time fro when the muzzlefalsh shows up to the time recoil animation ends.

Re: ScriptAPI Suggestions

Posted: Sun Mar 04, 2018 8:31 pm
by Gurt
Motto73 wrote:
Sun Mar 04, 2018 5:08 pm
Gurt wrote:
Thu Mar 01, 2018 10:11 pm
Motto73 wrote:
Thu Mar 01, 2018 7:45 am
IsShooting for IPlayer, that covers both hipfiring and firing while aiming. It would be logical addition, because I didn't find any method to see if the player is aiming and shooting. Only IsHipFiring.
We don't have anything like an "IsShooting" state internally in SFD. All you do is using your weapon which may or may not be automatic or single-shots. How do you imagine the "IsShooting" property would work? Only true at the frame where you actually fire the weapon (if you have ammo left?) or do you imagine something else?
I thought of the time fro when the muzzlefalsh shows up to the time recoil animation ends.
We won't be adding such a property as the recoil varies between weapons and some might not have any (it's only visual). I suggest you track the shooting state to your liking by using the IPlayer.Statistics.TotalShotsFired / TotalEmptyGunsFireAttempts variables. Track these variables in your code after changes and you will know when a player has fired a weapon - and track your shooting state for however long you want.

Re: ScriptAPI Suggestions

Posted: Wed Mar 07, 2018 7:22 pm
by JakSparro98
I was noticing that there are trigger that can create explosions and fire nodes but there isn't a way to spawn projectile without using scripts.

I would suggest a SpawnProjectileTrigger with that properties:
  • Inheritance from IObjectTrigger.
  • A drop-down menu to select the type of projectile.
  • A projectile target object or (like for the SpawnFireNodeTrigger) a tile angle-based for the projectile direction.

Re: ScriptAPI Suggestions

Posted: Wed Mar 07, 2018 7:58 pm
by Gurt
JakSparro98 wrote:
Wed Mar 07, 2018 7:22 pm
I was noticing that there are trigger that can create explosions and fire nodes but there isn't a way to spawn projectile without using scripts.

I would suggest a SpawnProjectileTrigger with that properties:
  • Inheritance from IObjectTrigger.
  • A drop-down menu to select the type of projectile.
  • A projectile target object or (like for the SpawnFireNodeTrigger) a tile angle-based for the projectile direction.
I just created a new forum for ScriptAPI suggestions. Keep each suggestion (big or small) in individual topics. Please place this suggestion in such a topic :)

I have some backlog to go through to sort existing topics into the right categories.

Re: ScriptAPI Suggestions

Posted: Wed Mar 07, 2018 8:56 pm
by JakSparro98
Gurt wrote:
Wed Mar 07, 2018 7:58 pm

I just created a new forum for ScriptAPI suggestions. Keep each suggestion (big or small) in individual topics. Please place this suggestion in such a topic :)

I have some backlog to go through to sort existing topics into the right categories.
I will discontinue the use of this thread and leave a note to invite people to post their new suggestions on the new section instead, anyway this topic needs to be moved back to "Ideas and Suggestions" section.