Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: joduffy on October 05, 2013, 05:14:43 AM
-
Hi guys,
I am trying to create an action for Rain AI. What I would like to do is write get / set AI property actions.
So What I would like to do is display a drop down list of variables for the user to pick. They then enter in the name of the variable and can also select a playmaker variable to store the result in (assuming we are talking about the get action).
I have create an enum with a switch statement but I was wondering if there was a better way.
public enum VariableType
{
FLOAT,
INT,
BOOL,
STRING,
VECTOR2,
VECTOR3,
VECTOR4,
GAMEOBJECT
}
-
Hi,
Use FsmVar and then do a check using ErrorCheck and when the user selected a fsm type not supported you throw an error:
// Perform custom error checking here.
public override string ErrorCheck()
{
// Return an error string or null if no error.
return null;
}
bye,
Jean
-
Thanks Jean.
Is it possible to store a vector4 inside of a quaternion in playmaker.
I noticed there is not a FSMVector4.
I was thinking of using FsmQuaternion to bounce back and forth between quaternion and vector4.
-
This does not seem to work and I dont know why not:
FsmQuaternion storeValue
Vector4 vec4Value
storeValue.Value.Set(vec4Value.x, vec4Value.y, vec4Value.z, vec4Value.w);
or even
storeValue.Value.Set(10.0f, 10.0f, 10.0f, 10.0f);
-
This is the error when i do:
storeValue.Value.x = vec4Value.x;
error CS1612: Cannot modify a value type return value of `HutongGames.PlayMaker.FsmQuaternion.Value'. Consider storing the value in a temporary variable
-
Sorry for the spam guys.
figured it out:
FsmQuaternion storeValue;
Vector4 vec4Value;
storeValue.Value = new Quaternion(vec4Value.x,vec4Value.y, vec4Value.z, vec4Value.w);
-
Sorry for the spam guys.
I dont think I can use the FSMQuaternion as it just displays x y z values in the editor and changes them.
So values of 10 in each become 0.09xxx 0.07xxx 0.07xx 0.9xx
Do I need to create a FSMVector4?
-
Hi,
CS1612 only means that you need to create a variable in between. like:
Quaternion _temp = storeValue.Value;
_temp.x = vec4Value.x;
storeValue.Value = _temp;
Try this.
Bye,
Jean
-
Thanks Jean,
I solved this problem but am facing a different one which is basically using the existing FSM variables with another plugin for Vector4 data.
I have replied in the topic:
FSMVector4