reg = addTagType("active");
po = reg->addParameter();
po->set(0, PARAM_TEXT);
+ po = reg->addParameter();
+ po->set(1, PARAM_VAR, "val");
// event
reg = addTagType("event");
po = reg->addParameter();
po->set(0, PARAM_TEXT);
po = reg->addParameter();
- po->set(1, PARAM_TEXT, "target");
+ po->set(1, PARAM_NUMERIC, "target");
// callEvent
reg = addTagType("callEvent");
po = reg->addParameter();
po->set(0, PARAM_TEXT);
po = reg->addParameter();
- po->set(1, PARAM_TEXT, "target");
+ po->set(1, PARAM_NUMERIC, "target");
// include
reg = addTagType("include");
VAR_SCOPE_GLOBAL,
VAR_SCOPE_MAX
};
-#define VAR_GLOBAL_ID(scope, id) ((0x10000000 << scope) | id)
-#define VAR_LOCAL_ID(id) (0x0FFFFFFF & id)
-#define VAR_SCOPE_TYPE(id) ((0xF0000000 & id) >> 29)
+#define VAR_GLOBAL_ID(scope, id) ((0x00100000 << scope) | id)
+#define VAR_LOCAL_ID(id) (0x000FFFFF & id)
+#define VAR_SCOPE_TYPE(id) ((0x00F00000 & id) >> 21)
template <class T>
class TagContainer : public NameContainer<T>
#ifdef DEBUG
printf("active [%s]\n", param.getText(0));
#endif
- param.runner->addActor(param.getText(0));
+ LMLActorObject *obj = param.runner->addActor(param.getText(0));
+ if (param.has(1))
+ {
+ variable_size id = *(variable_size*)param.get(1);
+ size_t objId = param.runner->getActorObjectId(*obj);
+
+ param.getVariable(id)->setFixedFloat(id, int_to_fixed_float((int)objId));
+ }
return LML_CMDRTN_NEXT;
}
obj->setAction(ap);
}
+ if(obj != param.obj && obj->activeActionStack.has())
+ {
+ LMLParameter p(NULL, param.runner, obj, &obj->activeActionStack);
+ LML_CMDRTN result = param.runner->runAction(p);
+
+ return LML_CMDRTN_NEXT;
+ }
+
return LML_CMDRTN_STOP | LML_CMDRTN_NEXT | LML_CMDRTN_REACTION;
}
obj = param.obj;
}
- if (¶m.obj->activeActionStack == param.actionStack)
+ if (param.obj != obj || ¶m.obj->activeActionStack == param.actionStack)
{
param.runner->callEvent(*obj, param.getText(0));
return LML_CMDRTN_NEXT;
_commandFuncs.resize(parser->countTagType());
_currentActor = NULL;
_currentObject = NULL;
+ variable.numericList.allocator(&_numericVariableAllocator);
_scene.setVariableAllocator(&_numericVariableAllocator);
_scene.setRepeatAllocator(&_repeatAllocator);
rt = tag->param.getTag(0)->type;
func = _commandFuncs[rt->id].closeFunc;
#ifdef DEBUG
- printf("close tag: %s\n", rt->getName().c_str());
+ printf("close tag: %s[%d]\n", rt->getName().c_str(), rt->id);
#endif
}
else
{
+#ifdef DEBUG
+ printf("tag: %s[%d]\n", rt->getName().c_str(), rt->id);
+#endif
func = _commandFuncs[rt->id].func;
}
</event>
<!-- Local Actions -->
<action name="1">
- <active>actor</active>
+ <active val="g.ACTOR">actor</active>
+ <callAction target="$g.ACTOR">action2</callAction>
<callAction>g1</callAction>
</action>
<action name="2">
- <print>call[action 2]</print>
+ <print>call[scene1.action2]</print>
<callAction>g2</callAction>
</action>
</scene>
<action name="action">
<val name="a">10</val>
<repeat count="$a">
- <print>roop[actor]</print>
+ <print>roop[actor.action]</print>
<wait>1</wait>
</repeat>
<callEvent>release</callEvent>
</action>
+ <action name="action2">
+ <print>call[actor.action2]</print>
+ </action>
</actor>
<!--Global Actions -->
<action name="g1">
- <print>call[global action 1]</print>
+ <print>call[global action1]</print>
<callAction>2</callAction>
</action>
<action name="g2">
- <print>call[global action 2]</print>
+ <print>call[global action2]</print>
</action>
</liveml>