edited January 2016 in Makinom Support
Trying to run a specific method in a different framework, this one specifically:

http://jnamobile.com/API/v1.0.0/class_platformer_pro_1_1_character.html#a1fe2a74e87cf1675b8da0f9aa158fd7e

I want to input IDLE as the animationstate, and 3 seconds as the float, but I can't seem to be able to reach this function using Makinom (or ORK!) for some reason. I only get 'Method not found', 'Property not found' and 'Field not Found' errors in all of my attempts.

I'm guessing there's something unique about this that I'm missing, but I'm not quite sure how I'm supposed to set it up.

Post edited by Kirb on
Tactics RPG Grid Battle System for ORK
---------------------------------------
Personal Twitter: https://twitter.com/AMO_Crate
I make RFI! https://twitter.com/NootboxGames
  • That'd be a Call Function node, but since Makinom doesn't now/supports the enum AnimationState, it can't find the method.

    I'll look into it if it's possible to somehow get the method and just using an int instead of the enum. Otherwise you'd need to write a custom node.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • I attempted to write a custom node here, but I'm pretty unfamiliar with enum in general, and my code is dreadful. :P

    http://pastebin.com/0EgUL4ct

    No compiler errors, but no effect either when I use the custom node in a makinom machine. To be fair, I have no idea if the lines I used are the proper ones for accessing the function.
    Tactics RPG Grid Battle System for ORK
    ---------------------------------------
    Personal Twitter: https://twitter.com/AMO_Crate
    I make RFI! https://twitter.com/NootboxGames
  • edited January 2016
    Here, I fixed and extended it for better use :)
    You should be now able to change the state, time and used object in the node.

    using UnityEngine;
    using Makinom;
    using System.Collections.Generic;

    namespace Makinom.Schematics.Nodes
    {
    [EditorHelp("Change Animation State", "Changes the animation state.", "")]
    [NodeInfo("Custom/Platformer Pro")]
    public class ChangeAnimationStateNode : BaseSchematicNode
    {
    public PlatformerPro.AnimationState state = PlatformerPro.AnimationState.None;

    public float time = 3;

    [EditorInfo(separator=true, titleLabel="Object")]
    public SchematicObjectSelection onObject = new SchematicObjectSelection();

    public ChangeAnimationStateNode()
    {

    }

    public override void Execute(Schematic schematic)
    {
    List<GameObject> list = this.onObject.GetObjects(schematic);

    for(int i = 0; i < list.Count; i++)
    {
    if(list[i] != null)
    {
    PlatformerPro.Character comp = list[i].GetComponent<PlatformerPro.Character>();
    if(comp != null)
    {
    comp.ForceAnimation(this.state, this.time);
    }
    }
    }
    Maki.Pooling.GameObjectLists.Add(list);

    schematic.NodeFinished(this.next);
    }


    public override string GetNodeDetails()
    {
    return "Node info text";
    }

    public override Color EditorColor
    {
    get{ return Maki.EditorSettings.baseNodeColor;}
    }
    }
    }


    Also, support for enum values is coming in the next Makinom update.
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited January 2016
    Thanks a ton, GiL! :D

    I do get an error though:

    Assets/Makinom_Events/Custom_Nodes/ChangeAnimationStateNode.cs(31,72): error CS0103: The name `targetObject' does not exist in the current context
    So I changed targetObject to onObject, but now I'm running into:
    Assets/Makinom_Events/Custom_Nodes/ChangeAnimationStateNode.cs(31,81): error CS1061: Type `Makinom.Schematics.SchematicObjectSelection' does not contain a definition for `GetComponent' and no extension method `GetComponent' of type `Makinom.Schematics.SchematicObjectSelection' could be found (are you missing a using directive or an assembly reference?)
    Post edited by Kirb on
    Tactics RPG Grid Battle System for ORK
    ---------------------------------------
    Personal Twitter: https://twitter.com/AMO_Crate
    I make RFI! https://twitter.com/NootboxGames
  • Yep, that's what I get for copy-pasting stuff :)
    I've edited the code, should work now.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited January 2016
    Works like a charm! Thanks as always, and also for adding enum support. :D
    Post edited by Kirb on
    Tactics RPG Grid Battle System for ORK
    ---------------------------------------
    Personal Twitter: https://twitter.com/AMO_Crate
    I make RFI! https://twitter.com/NootboxGames
Sign In or Register to comment.