edited November 22 in ORK Support
Hello
I'm trying to make a battle game with combatant (player) vs combatant
(other user using that user's saveData i,e not controlled by human).

So, the key is to create a combatant appropriately by using the save data of other users.

In this case, what should I do?

1. Create a combatant by passing the player's save data as an argument (Is this method available?)

2. By reading the save data properly (equipment, ability, etc.)
After creating a combatant, initialize it through a variable
(ex) combatant.equiment = savedata["equipment"][index]
If I code like this, it will get too complicated.

That is, the scenario is
There is a player combatant (myself), and I want to summon that user's combatant to my game by using the save data of the opponent playing the game.
(For example, a puppet combatant that is not actually manipulated, but is made of data using load data)

It is a rpg pk system, but ai controls it. However, for equipment level, etc., I want to create a combatant based on data that other users have played on other devices.

Any advice available?
Post edited by KESHYAS on
  • Loading a combatant is pretty simple:
    Combatant combatant = new Combatant(data, loadPosition, group);
    data is a DataObject containing the combatant's save data (pretty much the same thing you get when using combatant.SaveGame()).
    loadPosition is a bool value, pass on true if you want to load the position data, otherwise false.
    group is the Group the combatant should be part of, you can e.g. create a new group from scratch:
    Group group = new Group(factionID);
    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 answer!
    I think this is what I want.

    I haven't tested it yet, but I have a question.

    new Combatant(data, loadPosition, group);
    Can I pass the entire DataObject when I save/load the entire game as the data parameter dataObject??

    So, in this case, if I want to create an index 0 combatant of other users' save/load data, how will the code recognize it?

    The scenario I want is to receive the entire Ork's save/load string of another user from the server, deserialize it to a dataObject, and pass that dataObject as an argument.
    And I want to spawn Combatant by reading the "index 0 combatant" from the dataObject. (Other users' abilities, equipment, status, etc... have been initialized completely)
  • Since this'd involve custom scripting in any case, you could just save the individual combatant data for exchanges and pass them on instead of the whole save game.

    When using the whole save game, you'll have to traverse the save data to reach the player group's combatants - best check out the SaveGameHandler class in the gameplay source code.
    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.