MF99K Posted March 7, 2016 Share Posted March 7, 2016 I'm currently working on a mod that basically allows people to create clones of existing characters with a machine. I have a fairly good idea as to what I'm doing with the clones themselves, but other than the animations I have no idea how to work the cloning device's code. Some ideas that I thought might work for the cloner: some function that says that depending on what tags the player using the machine has, a different character clone is spawned. recipes? (recipes usually only prototype objects and not living things.) how to work the cost of making clones Some things that I know I'm going to have trouble with: the cloner's stategraph. clone inventories makeprefab coding for now I'm just looking for advice on how to set up the cloner's prefab file, once I get somewhere with that I'll probably post files that I need help working on. Link to comment Share on other sites More sharing options...
Kzisor Posted March 7, 2016 Share Posted March 7, 2016 7 hours ago, mf99k said: for now I'm just looking for advice on how to set up the cloner's prefab file, once I get somewhere with that I'll probably post files that I need help working on. Use SpawnPrefab("[INSERT PREFAB NAME HERE]") to spawn a direct copy of the character. Then hook up a brain, not a stategraph, to the spawned "clone" which will allow it to do things such as gather, mine, etc. Link to comment Share on other sites More sharing options...
MF99K Posted March 7, 2016 Author Share Posted March 7, 2016 2 hours ago, Kzisor said: Use SpawnPrefab("[INSERT PREFAB NAME HERE]") to spawn a direct copy of the character. Then hook up a brain, not a stategraph, to the spawned "clone" which will allow it to do things such as gather, mine, etc. the stategraph's not for the clone it's for the machine. Link to comment Share on other sites More sharing options...
MF99K Posted March 11, 2016 Author Share Posted March 11, 2016 On 3/7/2016 at 6:59 AM, Kzisor said: Use SpawnPrefab("[INSERT PREFAB NAME HERE]") to spawn a direct copy of the character. Then hook up a brain, not a stategraph, to the spawned "clone" which will allow it to do things such as gather, mine, etc. so basically I just put a brain onto the prefab and done? how do I set up a machine that will allow players to clone themselves like this though? Link to comment Share on other sites More sharing options...
Aquaterion Posted March 11, 2016 Share Posted March 11, 2016 32 minutes ago, mf99k said: so basically I just put a brain onto the prefab and done? how do I set up a machine that will allow players to clone themselves like this though? first thing that comes to mind is making the prefab get the players build and bank, and using those but im a newbie so dont take my word too seriously Link to comment Share on other sites More sharing options...
MF99K Posted March 11, 2016 Author Share Posted March 11, 2016 Just now, Aquaterion said: first thing that comes to mind is making the prefab get the players build and bank, and using those but im a newbie so dont take my word too seriously the main thing I'm asking is whether I need to make new prefabs or add brains to the ones that already exist Link to comment Share on other sites More sharing options...
Kzisor Posted March 11, 2016 Share Posted March 11, 2016 2 minutes ago, mf99k said: the main thing I'm asking is whether I need to make new prefabs or add brains to the ones that already exist You only need to change the brain to the character prefabs. Machines do not use "stategraphs" as far as I am aware. Link to comment Share on other sites More sharing options...
MF99K Posted March 11, 2016 Author Share Posted March 11, 2016 52 minutes ago, Kzisor said: You only need to change the brain to the character prefabs. Machines do not use "stategraphs" as far as I am aware. so instead of a stategraph, should I just look at how the animations are set up for, say, an alchemy engine or something? and I still want to know how to code the machine for cloning. Link to comment Share on other sites More sharing options...
Kzisor Posted March 11, 2016 Share Posted March 11, 2016 53 minutes ago, mf99k said: so instead of a stategraph, should I just look at how the animations are set up for, say, an alchemy engine or something? and I still want to know how to code the machine for cloning. Just set it up exactly like a prototyper and add the "clones" as recipes. Link to comment Share on other sites More sharing options...
MF99K Posted March 11, 2016 Author Share Posted March 11, 2016 13 minutes ago, Kzisor said: Just set it up exactly like a prototyper and add the "clones" as recipes. what about tech trees? Link to comment Share on other sites More sharing options...
Kzisor Posted March 11, 2016 Share Posted March 11, 2016 Just now, mf99k said: what about tech trees? I wouldn't worry about adding a new machine right off the bat, start out by making sure the cloning itself works, then worry about the details. IE: Add recipes to already existing machines in a separate tab then work your way up to making your own machine. Link to comment Share on other sites More sharing options...
MF99K Posted March 11, 2016 Author Share Posted March 11, 2016 11 minutes ago, Kzisor said: I wouldn't worry about adding a new machine right off the bat, start out by making sure the cloning itself works, then worry about the details. IE: Add recipes to already existing machines in a separate tab then work your way up to making your own machine. I attached a brain and the game doesn't crash but the brain doesn't seem to be doing anything. I'm troubleshooting that right now but in the meantime, I have another thing that will need to be changed in order for this mod to work. When characters are spawned via console, they still become ghosts when they die, and the game still treats them as if they're dead players. how would I fix this so that they despawn instead of becoming ghosts. second, how would I make it possible to revive Abigail into one of Wendy's clones? Link to comment Share on other sites More sharing options...
Kzisor Posted March 12, 2016 Share Posted March 12, 2016 22 hours ago, mf99k said: I attached a brain and the game doesn't crash but the brain doesn't seem to be doing anything. I'm troubleshooting that right now but in the meantime, I have another thing that will need to be changed in order for this mod to work. When characters are spawned via console, they still become ghosts when they die, and the game still treats them as if they're dead players. how would I fix this so that they despawn instead of becoming ghosts. second, how would I make it possible to revive Abigail into one of Wendy's clones? 1) That might be as simple as calling inst:Remove() or at least listening for the death event and tossing that clone into oblivion. The question is do the clones count as players? 2) Spawn Abigail and pass the instance of the clone to the LinkToPlayer function on the Abigail instance. Link to comment Share on other sites More sharing options...
MF99K Posted March 12, 2016 Author Share Posted March 12, 2016 18 hours ago, Kzisor said: 1) That might be as simple as calling inst:Remove() or at least listening for the death event and tossing that clone into oblivion. The question is do the clones count as players? 2) Spawn Abigail and pass the instance of the clone to the LinkToPlayer function on the Abigail instance. From how the game has been acting it seems like the clones DO count as players but minus the player controls. I'm thinking I might just have to remove all the player_common related code from clone-specific prefabs and set them up like regular prefabs. (don't worry, I'm not gonna edit the base character files. ) how exactly do I do the thing with abigail? Link to comment Share on other sites More sharing options...
Aquaterion Posted March 12, 2016 Share Posted March 12, 2016 2 hours ago, mf99k said: From how the game has been acting it seems like the clones DO count as players but minus the player controls. I'm thinking I might just have to remove all the player_common related code from clone-specific prefabs and set them up like regular prefabs. (don't worry, I'm not gonna edit the base character files. ) how exactly do I do the thing with abigail? Yea i wanted to say that they are counted as players, but since there's no player behind them, they don't move. Removing playing_common would pretty much make them have no animation or anything I believe, so maybe you could do something similar to player_common for clones to use. Link to comment Share on other sites More sharing options...
Kzisor Posted March 13, 2016 Share Posted March 13, 2016 4 hours ago, mf99k said: how exactly do I do the thing with abigail? I just told you in the previous post. Spawn abigail like you would any other prefab then get the instance of the clone and pass it to the LinktoPlayer function on the abigail instance. Example: Abigail:LinkToPlayer( clone ) Link to comment Share on other sites More sharing options...
MF99K Posted March 16, 2016 Author Share Posted March 16, 2016 this is what I have so far. scripts.zip Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now