Big list of missing script properties

Started by Crimson Wizard, Wed 18/01/2017 15:10:00

Previous topic - Next topic

Crimson Wizard

MISSING SCRIPT PROPERTIES - these are properties that set or get something that is already implemented in the engine, but just does not have means to know its value or change it in script.

Please help gather a list of such properties, grouped by object type. In many cases that would be super-simple to add readonly properties (ones that can tell you certain value). Changeable properties are less easy, because they often require to add values to savegame, but they are also should be mentioned.

NOTE: this relates to only things that are already in AGS, not completely new features.
For example:
* you can set a property in the Editor, but cannot read or set it in script;
* there is a script function that changes object's state, but no way to get what current state is.

Such list will be very useful, because engine contributors get reminded about them only once in a while, and these requests got forgotten in the presence of more critical tasks.
I would like to make a table in the first post, which lists the required properties, and status of their implementation.

PropertyTypeCommentStatus
Button
Animatingbool, readonlyfrom Animate()3.4.1
Frameint, readonlyfrom Animate()3.4.1
Loopint, readonlyfrom Animate()3.4.1
Viewint, readonlyfrom Animate()3.4.1
Character
FollowedCharacterCharacter*readonlyfrom FollowCharacter()
GUI
BackgroundColorint3.5.0
BorderColorint3.5.0
Mouse (alternatively make new static CursorModes struct)
Animating[]bool, readonly
Frame[]bool, readonlycurrent animation frame (if any)
ModeAnimated[]bool, readonly?array property, get/set whether particular cursor is animated
ModeAnimatedOnlyOnHotspots[]bool, readonly?
ModeAnimatedOnlyWhenMoving[]bool, readonly?
ModeView[]intarray propertyget/set VIEW for the mode
ModeHotspotX[]intarray propertyget/set hotspot X for the mode
ModeHotspotY[]intarray propertyget/set hotspot Y for the mode

Vincent

I'm very much happy to see the emergence of this topic.
To bless this newest thread I have a report to do just now.

Currently the buttons lack about these essential properties :

A) readonly bool Button.Animating
B) int Button.Frame
C) int Button.Loop

Vincent

This is another report to do so far.
I suppose that if the object's property is available in the editor, it should be available in script too.

Actually, you can change the border color of a list box only inside the editor.
You can change the background color of a GUI only inside the editor.

cat

The game version number. Would be useful to show on a title screen etc. so it's easy to figure out what version of the game a player has when analysing bugs.

Crimson Wizard

Quote from: cat on Wed 18/01/2017 19:57:35
The game version number. Would be useful to show on a title screen etc. so it's easy to figure out what version of the game a player has when analysing bugs.
Hmm unfortunately it's not saved into the compiled game, but I guess it may be worth adding.

cat

What is it used for now? I mean, I can edit it in the game's general settings.

Crimson Wizard

Quote from: cat on Wed 18/01/2017 20:16:45
What is it used for now? I mean, I can edit it in the game's general settings.
It is used to create Windows Game Explorer data, which is embedded into game exe (Windows only).

Vincent

I know that this is against the rule of this topic, however, I am going to say that the same...
It would be very nice if we could have buttons to be able to have their own transparency as well.
Most of the time I need to implement another gui with a single button to do that and play with ZOrder property anytime...

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Via script we can't get anymore those property so far from the editor.

readonly String Button.Name
readonly String Label.Name
readonly String ListBox.Name
readonly String TextBox.Name
readonly String Slider.Name
readonly String InventoryWindow.Name

bool TextBox.HideBorder


// And it would be very nice to have those property so far :)

int Button.Transparency
int Label.Transparency
int ListBox.Transparency
int TextBox.Transparency
int Slider.Transparency
int InventoryWindow.Transparency

Crimson Wizard

#8
Quote from: Vincent on Thu 19/01/2017 10:56:00
I know that this is against the rule of this topic, however, I am going to say that the same...
It would be very nice if we could have buttons to be able to have their own transparency as well.
Most of the time I need to implement another gui with a single button to do that and play with ZOrder property anytime...
Please, add feature requests to the Bug & Suggestion tracker, or they may get lost and forgotten (happens most of the time):
http://www.adventuregamestudio.co.uk/forums/index.php?project=3

Also, there are serious reasons why I asked to restrict this thread to the "missing" properties: firstly, there is a big difference between making them work in script, and creating completely new behavior. Secondly it is easier to work with the limited task.
From now on I will intentionally ignore anything that does not match the thread's topic.

Vincent

#9
Thank you very much Crimson Wizard, I have just add a new topic in the "Bug & Suggestion tracker" as well.

:EDIT: I am sorry if I break the rules, my mistake.

Quote from: Crimson Wizard on Thu 19/01/2017 11:05:23
From now on I will intentionally ignore anything that does not match the thread's topic.

You will do just the right thing.

Gurok

#10
Array.Length (pseudo-property)
Character.FollowedCharacter (you can set it with Character::FollowCharacter, but not get it)

Mouse:
GetModeView() to match ChangeModeView()
Animated, AnimatedOnlyOnHotspots and AnimatedOnlyWhileMoving boolean properties
[img]http://7d4iqnx.gif;rWRLUuw.gi

Crimson Wizard

#11
What if we create new CursorModes (name in plural) static struct and move all Cursor mode setting properties there?

What I mean:
Code: ags

struct CursorModes
{
  static attribute bool Animated[];
  static attribute bool AnimatedOnlyOnHotspots[];
  static attribute bool AnimatedOnlyWhenMoving[];
  static attribute bool Enabled[];
  static attribute int  View[];
  static attribute int  ModeHotspotX[];
  static attribute int  ModeHotspotY[];


Every property here will be array, with existing CursorMode enum used as an index, for example:
Code: ags

CursorModes[eModeLookat].View = 10;


There is a possibly better variant to make an actual "CursorMode" object passed as a pointer, but that will be more complicated, requiring to create whole new managed object type. Also, logically next step is to replace CursorMode enumeration completely and declare game objects like cmModeTalkTo, or something like that. I am not ready to go that far at the moment.
With the static struct most of those properties could use existing code related Mouse struct.

Mouse struct may have functions such as ChangeModeGraphic stripped (deprecated, hidden under compatibility switch), and only have 1) items actually related to mouse control itself and 2) active mode specifics (Mode, SaveCursorUntilItLeaves, etc)

Radiant

Actually the only one I'm missing on a regular basis is Character.StopAnimating (), or alternately being able to set Character.Animating to false.

Cassiebsg

It's not possible to set frame delay to idle view via script (the settings for idle view only allow to set the delay of when the idle view should animate). So you need to manually change the delay off each frame in the editor.

This is assuming I didn't missed something, of course. :-[
There are those who believe that life here began out there...

Vincent

@Crimson wizard@

I like the idea that you have got, although using arrays do not have a "quick easy" access to enumerations.
But it does not matter much because this idea would solve some issues actually.

Crimson Wizard

Quote from: Vincent on Fri 03/02/2017 20:41:08
I like the idea that you have got, although using arrays do not have a "quick easy" access to enumerations.
What do you mean?

Vincent

I just get a little confuse Crimson Wizard, I am sorry.
But your new method however would avoid to do such a thing..
Code: ags

bool IsModeEnabled(this Mouse*, CursorMode mode)


In a more elegant way how you have just proposed.

Crimson Wizard

We also need a counter-list of properties that are valid to be set in the Editor (as default values), but do not exist on property pane:

Object.Solid.
Hotspot, Region, Walkable area.Enabled ?

Vincent

Quote from: Crimson Wizard on Sat 04/03/2017 20:48:18
We also need a counter-list of properties that are valid to be set in the Editor (as default values), but do not exist on property pane:

Object.Solid.
Hotspot, Region, Walkable area.Enabled ?

Crimson Wizard, I think this would be a fantastic idea to add indeed.
So you can set a certain Walkable area to be disable as its default property as well as for Hotspot and Region too.
I think that since Objects can make use of the property 'View' maybe there could be something similar as for the character pane as you can set the 'NormalView' property. But that would mean to add a default property for the 'View' also for the button pane. (Since it has only the 'Image' property)


@Off topic:
Last night I was trying to change via script the SelectedBackground color, SelectedText color and TextColor from a List Box and I could not do it. (Also to check in case if the "TextAlignment" was set to the 'Left' side so maybe you can place it further as well as on the 'Right' or 'Centre' side... Although this would mean creating a new behavior on the source code)
Later I think I could add this to the 'Bug & Suggestion tracker' in case...
 

Cassiebsg

Uhm... I just realized there's no way to change the alignment of a GUI label via script, only via Editor.  :-\
There are those who believe that life here began out there...

SMF spam blocked by CleanTalk