![](templates/Classic/images/spacer.gif) |
oxseyn Wanderer
![](images/avatars/19047813974f847fabdc25c.jpg)
Joined: 26 Nov 2011 Posts: 71 Location: Colorado Springs
|
Posted: Sat Apr 14, 2012 1:41 pm
Illegal Token in Script, What am I doing wrong? |
This is from another thread, but I kind of buried my own question. I'm trying to have a script in a shared package that sets variables for sessions. The current example is trivial, but it's part of a larger plan. Here's the syntax I'm using:
Code: |
#VAR //%item(%names, 1)/test %item(%names, 1) |
When I paste this into a window, this should effectively reference the Window's Name as the root object and create a variable directly under that window named 'test' that contains the value of the windows name. However, instead I get a syntax error.
Edit:
As I'm reading through the documentation and playing more - I realized this won't do what I want (though I still need to know how to make this syntax work).
%names contains a variable array of all the windows and %item is a function the returns an item from the array specified by the index (which oddly starts at 1 rather than 0).
I need to know specifically how to identify from which window a trigger was fired. I want a trigger in a shared package that knows from what window it was fired. I.E. if it fires from the window "Character1" I want to explicitly set a variable in that window like this:
Code: |
#VAR //Character1/someVariable newValue; |
Edit 2:
In reference to edit 1: %window is the function I need, however I still can't figure out the syntax.
None of the following work:
Code: |
#VAR //%window/test test
#VAR (//%window/test test)
#VAR //(%window)/test test
//%window/test = test
@//%window/test = test |
|
|
|
![](templates/Classic/images/spacer.gif) |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat Apr 14, 2012 4:31 pm |
Did you try curly braces?
#var {//%window/test} test |
|
_________________ EDIT: I didn't like my old signature |
|
|
![](templates/Classic/images/spacer.gif) |
oxseyn Wanderer
![](images/avatars/19047813974f847fabdc25c.jpg)
Joined: 26 Nov 2011 Posts: 71 Location: Colorado Springs
|
Posted: Sat Apr 14, 2012 4:32 pm |
Every possible combination I could think of.
Code: |
#var {//%window/test} test |
Generates a syntax error. Uck, it feels like anytime I try to do anything more than extremely basic in CMUD I run into proprietary code-issue problems (nothing works under the hood the way you would expect). |
|
|
![](templates/Classic/images/spacer.gif) |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sun Apr 15, 2012 4:41 am |
Try adding a local variable to the mix.
$window = %window |
|
_________________ EDIT: I didn't like my old signature |
|
|
![](templates/Classic/images/spacer.gif) |
|
|