I'm at a point where I'm ready to start testing my combat formula's, and I'd very much like to have a look see at what I'm up against. I'm using an event similar to my player's character creation formula to randomly alter a placed combatant's stats when I spawn them. I'm hoping I can get this to run when I add a combatant to a placed object through the scene editor. I'm sure there are many things I'll need to figure out, but a few simple questions for starters:

-Firstly, is it even possible to use ORK's event editor to create and assign these stats outside of the game when assigning a combatant to a scene object, or will I need to work out some type of custom script?

-Assuming it's possible, would it be better to assign my combatants to run the event by way of 'Spawn,' or 'Init' Game Event, or will it matter? I recall reading in a post somewhere that only spawn remembers certain types of data.

-Can I view and interact with (tweak) my scene objects' statistics directly outside of the game, i.e. in the scene itself, or by way of a prefab, using the unity editor? I noticed that I can view their variables, and thought about just creating a host of local variables onto the combatant and running a side event to assign whatever their stat values are to said variables, but that's going to be a lot of work just to troubleshoot for whether it will even work to begin with, so I figured it would be logical to ask.

-Will I need to add any sort of object reference to my formula to get the random values to stick? This may seem like a silly question, but seeing as I'm adding them to a combatant rather than any specific object itself and then attaching said combatant to the object, well I didn't bother. Actually, I haven't referenced any combatant in the event, either. I noticed during early testing of my character creation formula that the event intuitively referenced my spawned combatant used to run it as an initial event (or maybe that's confabulation). I assigned a combatant to the scene regardless, but here I'm hoping that I won't need to since that would require a specific reference, and I'd like to use one event to alter a potentially endless list of combatants.
  • You should be able to use Object variables component on gameobject to store custom values and then run event on start that assigns those object variable values to stats.

    Doing this with custom script would be much easier though. You would have cleaner inspector for assigning values.
    These should help
    http://orkframework.com/tutorial/howto/accessing-a-game-objects-combatant/
    http://orkframework.com/tutorial/howto/creating-a-combatant-via-script/
    http://orkframework.com/tutorial/howto/scripting-where-is-what/
  • Events only run in the game, i.e. you can't use it to do that while building your scene. Also, there's no combatant at that point anyway, as it will only be instantiated in the running game. You can use the events to change/set stats of the combatant in-game.
    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!
  • Thanks for the responses guys, and thanks hellwalker for the scripting links. At this stage, I'm attempting the variables route because I'll only need to manage about twelve of them independently, or at least that's the case for monsters which have no skills. Specific NPC instances will likely prove a stumbling block, but that's to figure out later.

    It seems however that I can't create my object variables in my combatants list and apply them to an object through the scene editor. I guess that's your point, GIL, about a disconnect between game and scene: spawning or initializing a combatant onto a scene object merely prepares that object to become a combatant once the game is run. So, assuming I've figured this correctly, I'm guessing that I'll need to bypass creating my new variables on a combatant in the framework editor, opting instead to add an object variables component to the object with the combatant assigned, then make sure it's using the right combatant and create its list of variables all before making it a prefab, so that I can later repeat this process with a different object/combatant. Does that sound right?
  • Well ... it depends, e.g. an Add Combatant component would just use the game object as the newly instantiated combatant's game object, and should use an object variable component previously attached to the game object.

    Using the Combatant Spawner component however will spawn a completely new game object (using the combatant's prefab).
    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!
Sign In or Register to comment.