edited February 2015 in ORK Scripting
im using playmaker as a middle man of sorts on certain things but im having a hard time accessing the combatant component since its not an out side the dll script it dosent allow for me to access it correctly from playmaker. now from what i under stand i need to access the combatant component to access its status values. which i need to access in order to get the health variables and other variables from ork. is there a way to get this information. or do i need to make a script that accesses this information and store it so i can pull the info from that. but since its added at run time i dont see how it will be possible to grab the info in script either so im a little lost . or is it possible to get the combatant component not at run time ?
new website can be found here http://www.fore-loregames.com

Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

or check out the face book page here https://www.facebook.com/ForeLoreGames
  • The components are usually accessible for drag+drop by extending the ORKFramework.dll (the arrow on the left side of the file in Unity).
    Otherwise you'll need to write a wrapper component that gets the component or data from ORK and passes it along to playmaker. This how-to explains how to get the combatant of a game object.
    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!
  • yeah i tried the drag and drop and i can get the component but since it spawns at run time it dosent work correctly. and just adding the component to it dosent work either since ork spawns a 2nd one on to the player just tested this. so im at a loss now as to how im suppose to be able to grab info this info wouldnt even know where to start writing the script for this
    new website can be found here http://www.fore-loregames.com

    Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

    or check out the face book page here https://www.facebook.com/ForeLoreGames
  • What exactly is your scenario and how does playmaker access the component?
    AFAIK you'll need custom playmaker actions for any kind of interaction with ORK - e.g. the CombatantComponent only has a private reference to the actual combatant - accessing the data further is probably not possible with standard actions.
    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!
  • what i do with playmaker is i get the component but from there i cant access anything beyond the default stuff like name ect. so i use the get component action store it in a object var to access the function from there. but that seems not possible. so what im thinking is if i can write a script that access's the component script and can pull the status values from it i can then ref that script in playmaker and store the values it pulls. but the way this works with it not being added on till run time kinds got me stumped on how to go about doing that
    new website can be found here http://www.fore-loregames.com

    Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

    or check out the face book page here https://www.facebook.com/ForeLoreGames
  • to explaina little better playmaker can access alot of orks functions by get component to get the combatant component it references orkframwork.behaviors.combatantcompoent
    new website can be found here http://www.fore-loregames.com

    Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

    or check out the face book page here https://www.facebook.com/ForeLoreGames
  • maybe im wrong on this but i though tthe combatant component was what give you access to the player variables? just looked at the api but that behavior basically does nothing
    new website can be found here http://www.fore-loregames.com

    Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

    or check out the face book page here https://www.facebook.com/ForeLoreGames
  • edited February 2015
    The Combatant Component only gives access to the Combatant object (i.e. it ties the actual combatant's data - like status, abilities, etc. - to the game object).
    The combatant object/class holds all the data of the combatant, which is handled by various sub-classes.

    E.g. this code would give you the current value of the status value at index 0:

    int value = combatant.Status[0].GetValue();
    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!
  • ok yeah thats what im looking to access. whats the best way to go about pulling and storing that info?
    new website can be found here http://www.fore-loregames.com

    Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

    or check out the face book page here https://www.facebook.com/ForeLoreGames
  • If playmaker can use properties as well, you can use a wrapper component that accesses the data using properties, e.g.:

    public int HP
    {
    get{ return combatant.Status[1].GetValue();}
    set{ combatant.Status[1].SetValue(value, true, true, true, false, true, true);}
    ]


    The SetValue function has some flag parameters (e.g. check death, check level up, etc.) - the component would need to access the Combatant Component as shown in the how-to I've linked above.
    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!
  • ok so basically get the combatant using the how to and under that apply sthe get{ return... part of the code with the public int up top . with this i should be able to pull any of the status values i might need ? now my ints have to be the same name as the status value or am im completely wrong here?
    new website can be found here http://www.fore-loregames.com

    Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

    or check out the face book page here https://www.facebook.com/ForeLoreGames
  • No, they don't have to use the same name, you can use whatever name you want :)
    The code is just an example for how properties are implemented.
    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!
  • ok cool ill try that out later and see if i an get it to work :) if all goes well ill be using ork with ufps and playmaker with the project im working on now for my job basically using playmaker as a middleman for photon and a few other things so far i have ufps working up to the point of animations on photon using playmaker as a middleman if i can get this to work right with ork i can do the same and have ork working over photon using playmaker a s middleman its just a matter of pulling the info i need from ork and applying it in playmaker to flow it over the network :) once i get this part working correctly with playmaker all ill need to do is figure out a way to initialize the spawning on the network as of now i use custom spawning but i havent implemented ork yet in to the project. but im also using playmaker an ork in my personal project which allows for alot of testing. so later today ill work with the code you gave me with the code from the how to to see if i can get these vars with playmaker so they can be applied else where like ugui ect .


    one question on this since im not setting the value back into ork all i would need to do is call the get value function int he script to get the values to store in playmaker? or do i still need the set value to store it with in the script?
    new website can be found here http://www.fore-loregames.com

    Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

    or check out the face book page here https://www.facebook.com/ForeLoreGames
  • also to actually store it i woudl need to do something like this

    combatant.Status[1].SetValue(value, true, true, true, false, true, true) = hp;

    ?
    new website can be found here http://www.fore-loregames.com

    Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

    or check out the face book page here https://www.facebook.com/ForeLoreGames
  • If the status value should change through playmaker, you'll need to set the value, my last code example had the set part as well (it's the value parameter - using = hp wont work here).
    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!
  • oh no the = hp was just for the script part to store it int he scripts public int cause thats what ill be pulling from. i dont plan to set anything back to ork at all. i just need the public ints from the wrapper cause i can set them to new vars inside playmaker and use the playmaker vars as needed through out. so it would be more like combatant.Status[1] = hp to set the public int in the script it self? sorry just trying to under stand a bit more so when i go to do this i dont rip my hair out when i fail ^^.
    new website can be found here http://www.fore-loregames.com

    Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

    or check out the face book page here https://www.facebook.com/ForeLoreGames
Sign In or Register to comment.