@Per: JS API functions not configurable

For AI and campaign script related discussions and questions
Post Reply
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

@Per: JS API functions not configurable

Post by aubergine »

QScriptValue::ReadOnly makes all the JS API functions exposed to the scripting environment non-configurable (in addition to being read-only), which means that I can't overwrite them with my own functions.

If the functions were configurable, I could backport some bug fixes and new features that are available in master in to public releases such as betas.

There are two reasons I want to do that:

1. Make my scripts ready for future versions and get them out in the wild sooner for people to test

2. Allow my scripts to run on more than just the latest release of WZ.

Specifically, I want to retain the existing function names so that the functions my script is calling match up with the JS API docs. I'd like to try creating a "backport.js" that could be include()'d in scripts to help make them work on a wider range of public releases. This will allow script devs to start using newer features sooner, overcome (some) bugs in current releases whilst keeping their code closely matched to master.

Could the QScriptValue::ReadOnly flag be removed? (leaving just the QScriptValue::Undeletable flag)
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: @Per: JS API functions not configurable

Post by aubergine »

This topic can be nuked/closed - I've found out how to overwrite the non-configurable JS API properties/functions :)
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Post Reply