There was a link hidden on API, taking you to the page for the Group class :) ORK.Game.ActiveGroup.Remove(int id, bool setGroup, bool destroyPrefab) ORK.Game.ActiveGroup.Remove(Combatant c, bool setGroup, bool destroyPrefab)
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!
I am Sorry. I don't only want change name, I want use gameobject that spawned by NetworkManager component as player combatant. Or my really means is I want use a exist gameobject as player combatant.
Step by your advice, I meet these question,
First spawn empty gameobject0 by ORK, Spawn playerObject1 by NetworkManager component , then 1. Amount the playerObject1 to gameobject0, The gameobject0 will cann't move, It just is parent of gameobject1. 2. Amount the playerObject0 to gameobject1, The gameobject0 will move by gameobject1, But it is empty mesh, can 't see it is move.
Yes, and replace the other 2 parameters with true :)
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!
You are truly true. : ) Thanks very much. Some day I hope to really learn how to code in C# but that isn't why I use ORK. ORK takes care of that for me but this is a special situation. : ) Never thought I'd have to even touch coding. : ) Although it's very satisfying when it works. And so far so good. : )
Can not the NetworkManager just spawn the Player prefab? You can put an Interaction Controller on it and any scripts you need. Then if you add that Player to your active group by script, it will be able to use the ORK capabilities?
My player which is First Person moves by script in the Game Manager.
I'll have to instantiate objects for it to interact with by script but I think that will not be too hard. At least I hope not. : ) Not an ORK problem but one I have to work out in the Game Manager script I'm working with.
@Catacomber Now unity have component "Sync the Transform" , Other ORK capabilitiesSync , Such as "Sync combatant component ", "Sync ORK Handler " maybe implement by self class. Thanks for your help. I don't sure this is good solution for MetWork. :)
Trying to help someone who is using a special script to make a game and set up ORK within that.
Don't worry about it. It's just a side quest for me right now when I have some free time.
It has absolutely nothing to do with our current game. It's just to help someone who wants to use the ORK Framework to make a procedurally generated game.
It's interesting to me because I never did that and have gotten it a little bit farther than I thought I could. So keeping fingers crossed.
But it has nothing to do with Nine Dragons--it's just something someone asked me to help out with if I could.
And they bought the ORK Framework based on my saying it might work--so I have to try to help. : )
However there could be some ways to do this without custom scripting: - spawn a prefab in the procedural process with attached an auto-start event that spawn the player - use global event as scene event (with check scene name if it has more than one scene) and spawn the player through that in a random / fixed position. Maybe one of these could work. ^^
Old thread, I know, but can't seem to get this working the way i want:
I'm creating a character generator in script, and the first thing i want to do is show a player whose stats will then be altered.
According to GiL's instructions, I use this code: ORK.Game.ActiveGroup.Join(0); ORK.Game.PlayerHandler.SpawnPlayer(0); player = ORK.Game.ActiveGroup.GetMember(0);
But the first line spawns a player, and the second line spawns a player, giving me two combatants, but the third line doesn't seem to work at all.
What am i doing wrong? Why do i have two combatants and cannot access any member of the group?
-- EDIT -- Alright, correction, the combination of having a spawn point, and a game starter that had "Start Game" clicked is what spawned 2 combatants.
ORK.Game.ActiveGroup.Remove(int id, bool setGroup, bool destroyPrefab)
ORK.Game.ActiveGroup.Remove(Combatant c, bool setGroup, bool destroyPrefab)
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
So this
ORK.Game.ActiveGroup.Remove(int id, bool setGroup, bool destroyPrefab);
Becomes for me
ORK.Game.ActiveGroup.Remove(0, bool setGroup, bool destroyPrefab);
where 0 is my player?
and
ORK.Game.ActiveGroup.Remove(Combatant c, bool setGroup, bool destroyPrefab);
becomes for me
ORK.Game.ActiveGroup.Remove(Combatant 0, bool setGroup, bool destroyPrefab);
?
I don't only want change name, I want use gameobject that spawned by NetworkManager component as player combatant.
Or my really means is I want use a exist gameobject as player combatant.
Step by your advice, I meet these question,
First spawn empty gameobject0 by ORK, Spawn playerObject1 by NetworkManager component , then
1. Amount the playerObject1 to gameobject0, The gameobject0 will cann't move, It just is parent of gameobject1.
2. Amount the playerObject0 to gameobject1, The gameobject0 will move by gameobject1, But it is empty mesh, can 't see it is move.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Can not the NetworkManager just spawn the Player prefab? You can put an Interaction Controller on it and any scripts you need. Then if you add that Player to your active group by script, it will be able to use the ORK capabilities?
My player which is First Person moves by script in the Game Manager.
I'll have to instantiate objects for it to interact with by script but I think that will not be too hard. At least I hope not. : ) Not an ORK problem but one I have to work out in the Game Manager script I'm working with.
I don't know if this helps you. Trying. : )
Now unity have component "Sync the Transform" , Other ORK capabilitiesSync , Such as "Sync combatant component ", "Sync ORK Handler " maybe implement by self class.
Thanks for your help. I don't sure this is good solution for MetWork. :)
What you're doing is a lot beyond me but he probably can help you. : )
I never used C# before. Just learning.
My old entry for Indie Game Making Contest 2015
Trying to help someone who is using a special script to make a game and set up ORK within that.
Don't worry about it. It's just a side quest for me right now when I have some free time.
It has absolutely nothing to do with our current game. It's just to help someone who wants to use the ORK Framework to make a procedurally generated game.
It's interesting to me because I never did that and have gotten it a little bit farther than I thought I could. So keeping fingers crossed.
But it has nothing to do with Nine Dragons--it's just something someone asked me to help out with if I could.
And they bought the ORK Framework based on my saying it might work--so I have to try to help. : )
And so far so good. : )
However there could be some ways to do this without custom scripting:
- spawn a prefab in the procedural process with attached an auto-start event that spawn the player
- use global event as scene event (with check scene name if it has more than one scene) and spawn the player through that in a random / fixed position.
Maybe one of these could work. ^^
My old entry for Indie Game Making Contest 2015
Just want to make sure I can destroy the player safely when the game is over.
Don't worry about this. This is my side quest. : ) So far it's working fine.
I like scripting and never really have had a chance to do it for a long while. : )
There are no scenes except the one that is procedurally generated. : ) Just one scene.
Like Five Nights at Freddies. : )
My old entry for Indie Game Making Contest 2015
Anyway it's interesting and ORK seems to work with it via script which is a new thing for me and I'm always happy learning new things. : )
I'm creating a character generator in script, and the first thing i want to do is show a player whose stats will then be altered.
According to GiL's instructions, I use this code:
ORK.Game.ActiveGroup.Join(0);
ORK.Game.PlayerHandler.SpawnPlayer(0);
player = ORK.Game.ActiveGroup.GetMember(0);
But the first line spawns a player, and the second line spawns a player, giving me two combatants, but the third line doesn't seem to work at all.
What am i doing wrong? Why do i have two combatants and cannot access any member of the group?
-- EDIT --
Alright, correction, the combination of having a spawn point, and a game starter that had "Start Game" clicked is what spawned 2 combatants.