#143

Discarded

Feature requests and bug in game def scripting

Reported by Quimbly on OCTGN · 03/11/2009 14:53:22

Assigned to:
jods
Priority:
Normal
Status:
Discarded
Category:
None
Version:
None
Issue type:
Bug

1. BUG

This groupaction throws an exception:

<groupaction menu=“TEST” shortcut="ctrl+Y"> <mute /> <dec var=“$n” amount=“1” /> <print text=“{me} says {$n}” /> </groupaction>

But this one doesn’t:

<groupaction menu=“TEST” shortcut="ctrl+Y"> <mute /> <rnd var=“$n” min=“1” max=“20” /> <set var=“$n” value=“0” /> <dec var=“$n” amount=“1” /> <print text=“{me} says {$n}” /> </groupaction>

It seems like using the <rnd> element properly declares or initializes the script variable. Otherwise, variables do not appear to be properly initialized or declared.

The exception is key-not-found-in-dictionary, so I suspect the <rnd> element adds the variable to a dictionary where the other elements don’t.

I recommend either (1) automatically initializing/declaring the variables the first time they are used (any variable-specific element), or (2) add an element to the scripting language to declare/initialize a variable.

2. REQUEST

The biggest limitation I see with the script variables are that they are non-persistent and non-shareable. As jods put it, they are “scoped to the action”.

The scripting language would be much more powerful if state information could be stored and retrieved between subsequent action invocations (i.e. key-presses) and between different groupactions. In other words, it would be great to expand the scripting variables to be “global” (i.e. any groupaction could access them) and “persistent” (i.e. the values of the variables weren’t lost after each groupaction invocation).

You could either make all variables global, or expand the facility to allow the declaration of either a local or global variable.

That would be awesome!

Attachments

No attachment has been uploaded, yet.


Loading comments...