Page MenuHomeFeedback Tracker

A scripting command to quickly check is there is a non-nil variable in entity, varspace or hashmaps
Closed, ResolvedPublic

Description

I'd like to request a command to quickly check if entity, variable space or hashmap has a variable in its variable space, as a quicker single-command replacement for isNil{ENTITY getVariable STRING} and similar constructs which require a new scripting scope.

Suggested syntax:
BOOL = ENTITY isNil STRING
BOOL = HASHMAP isNil STRING
BOOL = NAMESPACE isNil STRING

Details

Severity
Feature
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
Scripting

Event Timeline

SaMatra created this task.Oct 26 2023, 4:31 PM

Revision: 151113 added support for group too

BIS_fnc_KK removed BIS_fnc_KK as the assignee of this task.Oct 26 2023, 11:06 PM
BIS_fnc_KK changed the task status from New to Feedback.
BIS_fnc_KK added a subscriber: BIS_fnc_KK.

Did some testing, works great!

[
     diag_codePerformance [{player isNil "testnil"}]
    ,diag_codePerformance [{isNil{player getVariable "testnil"}}]
]

>

[[0.000365157,100000],[0.000616879,100000]]

Perfect, pretty much twice as fast!

BIS_fnc_KK closed this task as Resolved.Nov 7 2023, 10:56 AM
dedmen set Ref Ticket to AIII-56054.Dec 7 2023, 6:22 PM