Page MenuHomeFeedback Tracker

[Feature Request] command - getVariable [name, defaultValue, setDefault, (public?)]
Closed, DuplicatePublic

Description

https://community.bistudio.com/wiki/getVariable
varspace getVariable [name, defaultValue]

https://community.bistudio.com/wiki/getOrDefault
hashMap getOrDefault [key, defaultValue, setDefault]

getVariable and getOrDefault are very similiar in Function, but getVariable is lacking a "setDefault" Parameter, which would be very nice to have.

setDefault: Boolean - (Optional, default false) if set to true and value does not exist in provided hash map, defaultValue will be added to the hash map

Details

Severity
Feature
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
General
Additional Information

when getVariable would recieve the additional pramater of setDefault, it might be worthwhile adding a 4th parameter that is equal to
setVariable's "public" parameter.

varspace setVariable [name, value, public]

public - (Optional, default false) can be one of:

    Boolean - if set to true, the variable is broadcast globally and is persistent (JIP compatible) GEGlobal
    Number - the variable is only set on the client with the given Machine network ID. If the number is negative, the variable is set on every client except for the one with the given ID.
    Array of Numbers - array of Machine network IDs

This parameter is only available if the varspace parameter is a Namespace, Object or Group. Furthermore, only the following Data Types can be broadcast: [...]

Event Timeline

mrzorn created this task.Mar 28 2024, 1:55 PM
mrzorn updated the task description. (Show Details)
mrzorn renamed this task from Feature Request - getVariable [name, defaultValue, setDefault] to Feature Request - getVariable [name, defaultValue, setDefault, (public?)].Mar 28 2024, 2:01 PM
This comment was removed by kju-PvPscene.

same as T170228 pretty much

mrzorn renamed this task from Feature Request - getVariable [name, defaultValue, setDefault, (public?)] to [Feature Request] command - getVariable [name, defaultValue, setDefault, (public?)].