I have a script which uses the above AC special function but I would like to pass a parameter with it such as:
AdvGame.RunActionListAsset(toDoOnEnter,myTransform);
where myTransform is the Game object where my script is attached to but I have not found in AC ActionList any way to recover that parameter.
Is this possible?
Comments
I think this is what you are looking for: http://www.adventurecreator.org/forum/discussion/4782/runtimeactionlist-runactionlistasset-parameters
Here is a tutorial to use the parameters on custom action http://adventurecreator.org/tutorials/getting-custom-action-work-parameters
AdvGame.RunActionListAsset(toDoOnEnter,myTransform);
I pass an ActionList in the inspector called toDoOnEnter but how do I see the parameter myTransform in the ActionAsset? (I used the CustomTrigger sample shown in AC Wiky)
AdvGame.RunActionListAsset(toDoOnEnter,int Code);
then I configure my 'toDoOnEnter' actionAsset with 'has parameter'
Now in toDoOnEnter I want to compare the parameter passed with a variable an did this:
Variable:Check
Variable : codeNumber
Compare with
Equal to : (0)Parameter 1
etc
But the compare fails even thou both the parameter I pass and the variable are indeed the same.
Passing a GameObject alone affects the first parameter defined in the ActionList. See the scripting guide description of:
AC.AdvGame.RunActionListAsset (ActionListAsset actionListAsset, GameObject parameterValue);
When passing an integer to this function, you're actually setting the parameter's ID. The parameter's value is set after that. Again, see the scripting guide:
AC.AdvGame.RunActionListAsset (ActionListAsset actionListAsset, int parameterID = -1, int parameterValue = 0);
To set the parameter value of your 1st parameter (presumable ID = 0), you want:
AC.AdvGame.RunActionListAsset (myActionList, 0, myNewParameterValue);
These descriptions also appear in MonoBehaviour when you write the function names.