# FMOD\_STUDIO\_PARAMETER\_FLAGS confusing response

**URL:** <https://qa.fmod.com/t/fmod-studio-parameter-flags-confusing-response/19847>\
**Category:** FMOD Engine\
**Tags:** javascript\
**Created:** [February 7, 2023, 8:54am UTC](https://qa.fmod.com/t/fmod-studio-parameter-flags-confusing-response/19847 "2023-02-07T08:54:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dwtc](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@dwtc](https://qa.fmod.com/u/dwtc)\
**Post date:** [February 7, 2023, 8:54am UTC](https://qa.fmod.com/t/fmod-studio-parameter-flags-confusing-response/19847/1 "2023-02-07T08:54:13Z")

</div>

When I use:

FMOD\_STUDIO\_PARAMETER\_DESCRIPTION  
{  
name,  
id,  
minimum,  
maximum,  
defaultvalue,  
type,  
flags,  
guid  
};

The “flags” return a number “5”. It’s not clear to me whether this is the total number of flags possible, or number of flags assigned, or THE flag assigned. There are five flags listed. My Studio setting should have this parameter set as GLOBALS

STUDIO\_PARAMETER\_READONLY 0x00000001  
STUDIO\_PARAMETER\_AUTOMATIC 0x00000002  
STUDIO\_PARAMETER\_GLOBALS 0x00000004  
STUDIO\_PARAMETER\_DISCRETE 0x00000008  
STUDIO\_PARAMETER\_LABELED 0x00000010

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/e/e3b2fb09b33013c04d6fdebb5c2d271b0b5b0288.png)

This code:

var paramDesc = {};  
CHECK\_RESULT(eventDescription.val.getParameterDescriptionByName(“Synths”, paramDesc));  
gSurfaceID = paramDesc.id;  
gSurfaceType = paramDesc.type;  
console.log(gSurfaceType);  
gSurfaceMin = paramDesc.minimum;  
console.log(gSurfaceMin);  
gSurfaceMax = paramDesc.maximum;  
console.log(gSurfaceMax);  
gSurfaceDefault = paramDesc.defaultvalue;  
console.log(gSurfaceDefault);  
gSurfaceFlags = paramDesc.flags;  
console.log(gSurfaceFlags);

Retuens:

0  
0  
1  
0.5  
5

All but the “5” makes sense to me.

The problem I’m trying to solve is that when I try to change this parameter, I’m told the parameter is invalid, so I’m trying to debug that by checking the parameter description. I’m using the “event parameter” example as a place to learn how to do this.

“event\_parameter.js:35 Uncaught Error!!! ‘An invalid parameter was passed to this function.’”

---

<div class="post-metadata">

**Author:** ![dwtc](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@dwtc](https://qa.fmod.com/u/dwtc)\
**Post date:** [February 7, 2023, 10:08am UTC](https://qa.fmod.com/t/fmod-studio-parameter-flags-confusing-response/19847/2 "2023-02-07T10:08:56Z")

</div>

Ok, I haven’t answered the Flag number question but have solved my issue,

I was trying to change a global parameter at the instance level, rather than system level. My bad.

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [February 8, 2023, 5:00am UTC](https://qa.fmod.com/t/fmod-studio-parameter-flags-confusing-response/19847/3 "2023-02-08T05:00:16Z")

</div>

Hi,

Good to hear the issue is solved, to answer your question about the flags would it be possible to get the full script that you used? I am not sure how you got those values.

---

<div class="post-metadata">

**Author:** ![dwtc](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@dwtc](https://qa.fmod.com/u/dwtc)\
**Post date:** [February 11, 2023, 7:06am UTC](https://qa.fmod.com/t/fmod-studio-parameter-flags-confusing-response/19847/4 "2023-02-11T07:06:12Z")

</div>

I had deleted from my project but I just downloaded the HTML5 example again to test:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/7/7b67fc20ac673e5620b89e9edde38b35db75cae3.png)

I printed paramterDesc.flags to the console log using the below, starting line 158, I added lines 164 and 165:

```
// Find the parameter once and then set by ID
// Or we can just find by name every time but by ID is more efficient if we are setting lots of parameters
var paramDesc = {};
CHECK_RESULT( eventDescription.val.getParameterDescriptionByName("Surface", paramDesc) );
gSurfaceID = paramDesc.id;
//trying to discover what flag is assigned to the parameter
gSurfaceFlags = paramDesc.flags;
console.log("flags", gSurfaceFlags);

```

I get this response in the console:

flags 24

I’m not sure how this corresponds to the flag type assigned. Is this maybe the number of flags? I was trying to verify that assigned flags to a particular parameter was global to aid in it’s value manipulation

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [February 14, 2023, 11:00pm UTC](https://qa.fmod.com/t/fmod-studio-parameter-flags-confusing-response/19847/5 "2023-02-14T23:00:23Z")

</div>

Hi,

This has been a bit of a learning experience for me as well.  
The `flags` can be a combination of more than 1, so when getting the result of `24` and looking at the list of possible flags

```auto
public enum PARAMETER_FLAGS : uint
{
    READONLY = 0x00000001,
    AUTOMATIC = 0x00000002,
    GLOBAL = 0x00000004,
    DISCRETE = 0x00000008,
    LABELED = 0x00000010,
}

```

We can determine which flags are being used

```auto
ATUOMATIC + GLOBAL + DISCRETE + LABELED

```

This way we can list multiple `flags` in one variable without corrupting the information. Hope this helps!
