Author Topic: Big list of missing script properties  (Read 5814 times)

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Big list of missing script properties
« on: 18 Jan 2017, 15:10 »
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
BackgroundColorint
BorderColorint
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
« Last Edit: 29 Sep 2017, 14:20 by Crimson Wizard »

Vincent

  • Jump back into the pond
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
Re: Big list of missing script properties
« Reply #1 on: 18 Jan 2017, 15:19 »
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

  • Jump back into the pond
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
Re: Big list of missing script properties
« Reply #2 on: 18 Jan 2017, 15:33 »
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

  • Mittens Baronet
  • AGS Baker
  • Now investigating MonoAGS
    • cat worked on a game that was nominated for an AGS Award!
      cat worked on a game that won an AGS Award!
Re: Big list of missing script properties
« Reply #3 on: 18 Jan 2017, 19:57 »
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

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: Big list of missing script properties
« Reply #4 on: 18 Jan 2017, 20:02 »
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

  • Mittens Baronet
  • AGS Baker
  • Now investigating MonoAGS
    • cat worked on a game that was nominated for an AGS Award!
      cat worked on a game that won an AGS Award!
Re: Big list of missing script properties
« Reply #5 on: 18 Jan 2017, 20:16 »
What is it used for now? I mean, I can edit it in the game's general settings.

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: Big list of missing script properties
« Reply #6 on: 18 Jan 2017, 21:03 »
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

  • Jump back into the pond
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
Re: Big list of missing script properties
« Reply #7 on: 19 Jan 2017, 10:56 »
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

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: Big list of missing script properties
« Reply #8 on: 19 Jan 2017, 11:05 »
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.
« Last Edit: 19 Jan 2017, 11:11 by Crimson Wizard »

Vincent

  • Jump back into the pond
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
Re: Big list of missing script properties
« Reply #9 on: 19 Jan 2017, 11:11 »
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.

From now on I will intentionally ignore anything that does not match the thread's topic.

You will do just the right thing.
« Last Edit: 19 Jan 2017, 11:15 by Vincent »

Gurok

  • Rottwheelers
  • When life hands you lemons, combine them with the mop
    • I can help with AGS tutoring
    •  
    • Best Innovation Award Winner 2016, for improving and extending the AGS scripting language
    •  
    • I can help with proof reading
    •  
    • I can help with scripting
    •  
    • Gurok worked on a game that was nominated for an AGS Award!
      Gurok worked on a game that won an AGS Award!
Re: Big list of missing script properties
« Reply #10 on: 20 Jan 2017, 09:47 »
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
« Last Edit: 20 Jan 2017, 09:51 by Gurok »

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: Big list of missing script properties
« Reply #11 on: 02 Feb 2017, 21:00 »
What if we create new CursorModes (name in plural) static struct and move all Cursor mode setting properties there?

What I mean:
Code: Adventure Game Studio
  1. struct CursorModes
  2. {
  3.   static attribute bool Animated[];
  4.   static attribute bool AnimatedOnlyOnHotspots[];
  5.   static attribute bool AnimatedOnlyWhenMoving[];
  6.   static attribute bool Enabled[];
  7.   static attribute int  View[];
  8.   static attribute int  ModeHotspotX[];
  9.   static attribute int  ModeHotspotY[];
  10.  

Every property here will be array, with existing CursorMode enum used as an index, for example:
Code: Adventure Game Studio
  1. CursorModes[eModeLookat].View = 10;
  2.  

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)
« Last Edit: 02 Feb 2017, 21:03 by Crimson Wizard »

Radiant

  • AGS Baker
  • Mittens Knight
  • Return once more to the Two Kingdoms!
    • I can help with publishing
    •  
    • I can help with story design
    •  
    • Radiant worked on a game that was nominated for an AGS Award!
      Radiant worked on a game that won an AGS Award!
Re: Big list of missing script properties
« Reply #12 on: 02 Feb 2017, 21:12 »
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

  • Cavefish
  • Fleeing the Cylon tyrrany...
    • Cassiebsg worked on a game that was nominated for an AGS Award!
Re: Big list of missing script properties
« Reply #13 on: 02 Feb 2017, 21:26 »
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

  • Jump back into the pond
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
Re: Big list of missing script properties
« Reply #14 on: 03 Feb 2017, 20:41 »
@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

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: Big list of missing script properties
« Reply #15 on: 03 Feb 2017, 21:35 »
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

  • Jump back into the pond
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
Re: Big list of missing script properties
« Reply #16 on: 03 Feb 2017, 22:48 »
I just get a little confuse Crimson Wizard, I am sorry.
But your new method however would avoid to do such a thing..
Code: Adventure Game Studio
  1. bool IsModeEnabled(this Mouse*, CursorMode mode)

In a more elegant way how you have just proposed.

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: Big list of missing script properties
« Reply #17 on: 04 Mar 2017, 20:48 »
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

  • Jump back into the pond
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
Re: Big list of missing script properties
« Reply #18 on: 05 Mar 2017, 11:20 »
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

  • Cavefish
  • Fleeing the Cylon tyrrany...
    • Cassiebsg worked on a game that was nominated for an AGS Award!
Re: Big list of missing script properties
« Reply #19 on: 13 May 2017, 00:19 »
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...

Cassiebsg

  • Cavefish
  • Fleeing the Cylon tyrrany...
    • Cassiebsg worked on a game that was nominated for an AGS Award!
Re: Big list of missing script properties
« Reply #20 on: 26 May 2017, 21:38 »
No way to change the settings of a Text Window GUI... like TextColor. This one seems to be missed often, as there are multiple threads on the forum asking about how to change it.
There are those who believe that life here began out there...

Dave Gilbert

  • Mittens Vassal
  • AGS Baker
  • Hi. Our names are FRIGGING ADORABLE.
    • Lifetime Achievement Award Winner
    •  
    • Dave Gilbert worked on a game that was nominated for an AGS Award!
      Dave Gilbert worked on a game that won an AGS Award!
Re: Big list of missing script properties
« Reply #21 on: 29 May 2017, 13:27 »
Just saw this thread. One property I've always wanted is the ability to do FRAME/LOOP FLIPPING! You can check IF a frame is flipped, but you can't actually SET the frame as flipped.

It would also be useful to flip an entire loop!

I'd also like a pony.

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: Big list of missing script properties
« Reply #22 on: 29 May 2017, 14:49 »
Just saw this thread. One property I've always wanted is the ability to do FRAME/LOOP FLIPPING! You can check IF a frame is flipped, but you can't actually SET the frame as flipped.

It would also be useful to flip an entire loop!

You mean, during the game?
BTW, I think that's possible to do now by replacing frames with DynamicSprites, which you create from original and flip, then assign to the view frame.

Dave Gilbert

  • Mittens Vassal
  • AGS Baker
  • Hi. Our names are FRIGGING ADORABLE.
    • Lifetime Achievement Award Winner
    •  
    • Dave Gilbert worked on a game that was nominated for an AGS Award!
      Dave Gilbert worked on a game that won an AGS Award!
Re: Big list of missing script properties
« Reply #23 on: 30 May 2017, 15:57 »
True! But the advantage of being able to change the property via script is that you can use it to determine IF the frame is already flipped.

Currently you can use: "if (frame.Flipped == true)" to determine if the frame was flipped via the editor, but if you change the frame with a DynamicSprite you won't be able to do that. Ideally, I'd like to be able to do this:

if (frame.Flipped == false)
{
    frame.Flipped=true;
}

Meaning I can check if the frame is already flipped, and if not - flip it!
« Last Edit: 30 May 2017, 16:14 by Dave Gilbert »

Radiant

  • AGS Baker
  • Mittens Knight
  • Return once more to the Two Kingdoms!
    • I can help with publishing
    •  
    • I can help with story design
    •  
    • Radiant worked on a game that was nominated for an AGS Award!
      Radiant worked on a game that won an AGS Award!
Re: Big list of missing script properties
« Reply #24 on: 28 Sep 2017, 07:27 »
Oddly, the baseline of a walkbehind can be written to in script, but not read.

Monsieur OUXX

  • Cavefish
  • Mittens Vassal
  • Mittens Half Initiate
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Re: Big list of missing script properties
« Reply #25 on: 29 Sep 2017, 13:09 »
PropertyTypeCommentStatus
File
f.NameString, readonlyThe name of the file
File.GetFolder(String path)static String, readonly"Renders" a path containing $APPDATADIR$ to its actual value (is there another way?)
AudioClip
ID or Nameint, readonly or String, readonlysome way to identify what AudioClip this is when iterating on AudioClips
AudioChannel
PreferredTypeAudioType, readonlyThe Audiotype it will play in priority, or some way to predict what will play what, in regards to the discussion here
 

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: Big list of missing script properties
« Reply #26 on: 29 Sep 2017, 13:28 »
@Monsieur OUXX, File.GetFolder may be a useful addition, but that's rather not a "missing property" in the sense this thread was created for.

Regarding AudioChannel.PreferredType - frankly I'd rather suggest redesigning of how channels work, because now it looks like you are trying to find a way to "hack the system".

Monsieur OUXX

  • Cavefish
  • Mittens Vassal
  • Mittens Half Initiate
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Re: Big list of missing script properties
« Reply #27 on: 29 Sep 2017, 16:58 »
frankly I'd rather suggest redesigning of how channels work, because now it looks like you are trying to find a way to "hack the system".

Well I was just trying to suggest a property that would be easily read straight out of the engine, with "not too much" additional work. I'm totally in favor of getting rid of those hidden priority rules indeed.
Indeed I misunderstood the thread -- apologies for posting.
 

Dave Gilbert

  • Mittens Vassal
  • AGS Baker
  • Hi. Our names are FRIGGING ADORABLE.
    • Lifetime Achievement Award Winner
    •  
    • Dave Gilbert worked on a game that was nominated for an AGS Award!
      Dave Gilbert worked on a game that won an AGS Award!
Re: Big list of missing script properties
« Reply #28 on: 17 Oct 2017, 03:13 »
The ability to get and set the inventory x & y hotspot via the script would be handy!

Gurok

  • Rottwheelers
  • When life hands you lemons, combine them with the mop
    • I can help with AGS tutoring
    •  
    • Best Innovation Award Winner 2016, for improving and extending the AGS scripting language
    •  
    • I can help with proof reading
    •  
    • I can help with scripting
    •  
    • Gurok worked on a game that was nominated for an AGS Award!
      Gurok worked on a game that won an AGS Award!
Re: Big list of missing script properties
« Reply #29 on: 12 May 2018, 07:08 »
"UseRoomAreaLighting" is settable on an object in the editor, but there is no matching property at runtime.

"UseRoomAreaScaling" has Object.IgnoreScaling at runtime. Not ideal, but it might be an idea to make the new property match this convention.

Re: Big list of missing script properties
« Reply #30 on: 12 May 2018, 12:39 »
PropertyTypeCommentStatus
AudioClip
ID or Nameint, readonly or String, readonlysome way to identify what AudioClip this is when iterating on AudioClips

The missing name and non-visible ID does make it pretty difficult to randomly select an AudioClip. I thought that I could workaround this by checking the hex value that is used as the filename for the audio cache, but it seems this number doesn't match the ID value.

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: Big list of missing script properties
« Reply #31 on: 12 May 2018, 15:25 »
The missing name and non-visible ID does make it pretty difficult to randomly select an AudioClip. I thought that I could workaround this by checking the hex value that is used as the filename for the audio cache, but it seems this number doesn't match the ID value.

True, and as many other object IDs it cannot be set by user. Unreliable AudioClip.ID situation was discussed in another thread, regarding new audio system.

The only solution currently is to create custom arrays of AudioClip pointers in script, fill them in proper order and random pick from them.

Re: Big list of missing script properties
« Reply #32 on: 12 May 2018, 15:33 »
I wasn't sure what the overhead of creating the array was (I was looking to run this entirely in a script module, and so have no state to permanently store an array), so in the end I've defined case statements in a macro (all on one line), where each case returns an AudioClip. This seems to workaround it (when I import another AudioClip, I also add a case that returns it, and I just generate a random number to randomly get one).

Crimson Wizard

  • Local Moderator
  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: Big list of missing script properties
« Reply #33 on: 12 May 2018, 15:36 »
I wasn't sure what the overhead of creating the array was (I was looking to run this entirely in a script module, and so have no state to permanently store an array)

Hmm... imho unless you have an array of many thousands entries, there should not be an overhead. Besides, you can create dynamic array.
But then, maybe I do not understand your case well enough.

Anyway, this does not deny the fact that script API is imperfect.
« Last Edit: 12 May 2018, 15:38 by Crimson Wizard »

Snarky

  • Global Moderator
  • Mittens Earl
  • Private Insultant
    • I can help with proof reading
    •  
    • I can help with translating
    •  
Re: Big list of missing script properties
« Reply #34 on: 21 May 2018, 16:31 »
+AudioType crossfade setting