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.
Property | Type | Comment | Status |
Button |
Animating | bool, readonly | from Animate() | 3.4.1 |
Frame | int, readonly | from Animate() | 3.4.1 |
Loop | int, readonly | from Animate() | 3.4.1 |
View | int, readonly | from Animate() | 3.4.1 |
Character |
FollowedCharacter | Character*readonly | from FollowCharacter() |
GUI |
BackgroundColor | int | | 3.5.0 |
BorderColor | int | | 3.5.0 |
Mouse (alternatively make new static CursorModes struct) |
Animating[] | bool, readonly |
Frame[] | bool, readonly | current animation frame (if any) |
ModeAnimated[] | bool, readonly? | array property, get/set whether particular cursor is animated |
ModeAnimatedOnlyOnHotspots[] | bool, readonly? |
ModeAnimatedOnlyWhenMoving[] | bool, readonly? |
ModeView[] | intarray property | get/set VIEW for the mode |
ModeHotspotX[] | intarray property | get/set hotspot X for the mode |
ModeHotspotY[] | intarray property | get/set hotspot Y for the mode |
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
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.
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.
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.
What is it used for now? I mean, I can edit it in the game's general settings.
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).
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
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.
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.
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
What if we create new CursorModes (name in plural) static struct and move all Cursor mode setting properties there?
What I mean:
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:
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)
Actually the only one I'm missing on a regular basis is Character.StopAnimating (), or alternately being able to set Character.Animating to false.
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. :-[
@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.
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?
I just get a little confuse Crimson Wizard, I am sorry.
But your new method however would avoid to do such a thing..
bool IsModeEnabled(this Mouse*, CursorMode mode)
In a more elegant way how you have just proposed.
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 ?
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...
Uhm... I just realized there's no way to change the alignment of a GUI label via script, only via Editor. :-\
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.
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.
Quote from: Dave Gilbert on Mon 29/05/2017 13:27:04
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.
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!
Oddly, the baseline of a walkbehind can be written to in script, but not read.
Property | Type | Comment | Status |
File |
f.Name | String, readonly | The 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 Name | int, readonly or String, readonly | some way to identify what AudioClip this is when iterating on AudioClips | |
AudioChannel |
PreferredType | AudioType, readonly | The Audiotype it will play in priority, or some way to predict what will play what, in regards to the discussion here (http://www.adventuregamestudio.co.uk/forums/index.php?topic=54221.msg636549163#msg636549163) | |
@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".
Quote from: Crimson Wizard on Fri 29/09/2017 13:28:51
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.
The ability to get and set the inventory x & y hotspot via the script would be handy!
"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.
Quote from: Monsieur OUXX on Fri 29/09/2017 13:09:18
Property | Type | Comment | Status |
AudioClip |
ID or Name | int, readonly or String, readonly | some 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.
Quote from: morganw on Sat 12/05/2018 12:39:05
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.
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).
Quote from: morganw on Sat 12/05/2018 15:33:25
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.
+AudioType crossfade setting
Object.Scaling
I would just like to say this:
Anything we can change in script that avoids us having to play through the whole game from the start is a big plus from me (nod)
I noticed there is no way to invoke a ListBox.OnSelectionChanged event. Also it appears changing selection of a list box by code doesn't invoke ListBox.OnSelectionChanged.
I also noticed it's not possible to figure out if a Slider is vertical or horizontal. Apparently If Slider.Height < Slider.Width, it's horizontal. Sliders are also missing a way to check if sliderChanged
Quote from: eri0o on Sun 10/03/2019 15:28:19
Object.Scaling
This. Also setting manual scaling for objects would VERY useful.
Quote from: cat on Sun 11/08/2019 11:06:51
Quote from: eri0o on Sun 10/03/2019 15:28:19
Object.Scaling
This. Also setting manual scaling for objects would VERY useful.
Actually WYSIWYG would be positively fantabulosa (laugh)