kogen
01-19-2007, 11:18 AM
Hello everybody,
Although I'm new to CGTalk, I hope there's someone who would help me.
I guess to start the first posting with a question doesn't look very well, but nevertheless, I'd like to know if it's possible to use loval variables such as those I define in structures within PositionController-Skripts. For example: I've got a structure (just an example):
struct Example
(scircn, sdummy,
sdummy = dummy(),
scircn = circle()
)
and I want to assign a PositionController-Skript to this Circle via Max-Skript, saying, that the Position of this circle depends on the Relation to the Position of the dummy. If the circle reaches a maximum Value, th circle should be stopped.
The problem I'm facing at the moment is, that PositionController-Scripts don't work with the local variable "scircn" within the Structure. Like:
struct Example
(--open structure
scircn, sdummy,
sdummy = dummy(),
scircn = circle()
fn MakeLimit =
(
sdummyn.Position.Controller = ps;
ps.script =
"dependsOn scircn
If scircn.pos.x > 5 then scircn.pos.x = 5
[-5, -5, 0]" –- Dummy position obligatory
)
--close structure)
Everything works well with a global variable or an array instead of a structure. But with a local variable I always get an "IscriptControl::SetExpression"-error and after that an "scircn is undefined"-error in the PositionController-Skript-Panel.
Does anybody know this problem and maybe what I should try or change?
Cheers "ko'gen".
Although I'm new to CGTalk, I hope there's someone who would help me.
I guess to start the first posting with a question doesn't look very well, but nevertheless, I'd like to know if it's possible to use loval variables such as those I define in structures within PositionController-Skripts. For example: I've got a structure (just an example):
struct Example
(scircn, sdummy,
sdummy = dummy(),
scircn = circle()
)
and I want to assign a PositionController-Skript to this Circle via Max-Skript, saying, that the Position of this circle depends on the Relation to the Position of the dummy. If the circle reaches a maximum Value, th circle should be stopped.
The problem I'm facing at the moment is, that PositionController-Scripts don't work with the local variable "scircn" within the Structure. Like:
struct Example
(--open structure
scircn, sdummy,
sdummy = dummy(),
scircn = circle()
fn MakeLimit =
(
sdummyn.Position.Controller = ps;
ps.script =
"dependsOn scircn
If scircn.pos.x > 5 then scircn.pos.x = 5
[-5, -5, 0]" –- Dummy position obligatory
)
--close structure)
Everything works well with a global variable or an array instead of a structure. But with a local variable I always get an "IscriptControl::SetExpression"-error and after that an "scircn is undefined"-error in the PositionController-Skript-Panel.
Does anybody know this problem and maybe what I should try or change?
Cheers "ko'gen".
