public Group backlogTasks;
void Start()
{
backlogTasks = new Group(1); //1 is the enemy faction
}
public void AddTaskById(int taskID)
{
CombatantHandler taskSearch = new CombatantHandler();
Combatant task = taskSearch.Get(taskID);
backlogTasks .Join(task, false, false);
GetTaskList();
}
The thing is that i can't find an error flag in my console and i don't know where the fail is...It looks like you're new here. If you want to get involved, click one of these buttons!
Anyway - do you want to get an existing combatant, or create a new combatant?
The CombatantHandler class manages all existing/spawned combatants, you can access the game's instance via ORK.Game.Combatants and shouldn't create a new one like that (as there'll be nothing in there).
So, if you want to get an existing combatant:
Combatant combatant = ORK.Game.Combatants.Get(index);
index is the ID/index of the combatant in the editor.
You can create a new combatant like this:
Combatant combatant = ORK.Access.Combatant.CreateInstance(index, group, true, true);
index is the ID/index of the combatant in the editor.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I will use both: create combatant and getting existing combatants.
Thanks! I get to do what i was trying! :D
Is it possible, given the real ID of a instanced combatant, assuming the combatant is in a group, destroying the instance associated to that group?
I mean, i've created a combatant A given the RealID Index:
Combatant combatant = ORK.Access.Combatant.CreateInstance(index, group, true, true);
and now, as a parameter, i receive the same RealID for deleting it from the group where it was instanciated and destroying the instance.
How could i do that?
I've tried the following, but it doesn't delete anything:
Combatant combatant = ORK.Game.Combatants.Get(realID);
group.Remove(combatant, true, true, true, true);
Thanks in advance!
https://forum.orkframework.com/discussion/3336/resource-generating-ork-constants-for-scripting/p1
I think would be helpful instead of remembering the Editor Real ID
If you want to remove a combatant from it's group, you can access the group via combatant.Group, e.g. combatant.Group.Remove(combatant, ...)
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I've also read the thread @RustedGames recommended, but sadly i didn't understand how that works...
The method ReturnTaskById is supposed to be the contrary of this one; Could the firs method work? The first surely does
If the combatant is spawned, it'll remain in the game. You have to destroy it's prefab:
GameObject.Destroy(combatant.GameObject);
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!