Fancy_Fox_Pers Posted February 8, 2017 Share Posted February 8, 2017 (edited) I have basicly Maxwell Puppet clones with a custom skin set up. Everything works, it appears visible with the right animations, it has the same brain attached to it and it gets summoned through a crafting recipe. However, I have no idea how to actually make it follow my character after having crafted it. I looked at Maxwell's lua file (and also tried a couple f things) but I didn't find much either. I don't want to attach the creature to a simpler brain because I want to use the chop/mine/dig/attack(kite) behaviours that already coded in. Thanks in advance! Attached files ("thibaud" is the character AKA "waxwell" equivalent, "guardian_thibaud" is the puppet equivalent) waxwell.lua thibaud.lua guardian_thibaud.lua guardian_thibaudbrain.lua I use this to craft the creature: (in modmain) Spoiler -- Make a Paper Guardian: lumber local Ingredient = GLOBAL.Ingredient local af_rec = AddRecipe("guardianlumber", {Ingredient("papyrus", 4), Ingredient("cutgrass", 4)}, GLOBAL.RECIPETABS.DRAWINGS, GLOBAL.TECH.NONE, nil, nil, nil, nil, "paperdrawing_builder","images/inventoryimages/wurm_thibaud.xml", "wurm_thibaud.tex") GLOBAL.STRINGS.RECIPE_DESC.GUARDIANLUMBER = "Draw a paper lumber guardian!" af_rec.sortkey = -1 Edited February 8, 2017 by Thibooms Link to comment https://forums.kleientertainment.com/forums/topic/73904-question-how-does-maxwells-puppets-follow-him/ Share on other sites More sharing options...
Lumina Posted February 8, 2017 Share Posted February 8, 2017 I guess it's related to the "leader" value, but i don't know how you define who is the leader. Link to comment https://forums.kleientertainment.com/forums/topic/73904-question-how-does-maxwells-puppets-follow-him/#findComment-864837 Share on other sites More sharing options...
Starlogy Posted February 8, 2017 Share Posted February 8, 2017 (edited) Ehh, I'm no expert on this type of thing, although I think I have some sort of idea of what's going on. What I think is happening is that the code is still looking for Maxwell, and can't find him, so they don't do anything. Figure out a way to craft these guardians as Maxwell, and see if they follow him. Might be something involving the brain value, you did say they share the same brain as the shadow puppets. again, I'm no expert, so if what I suggested doesn't work, I can't help you out Edited February 8, 2017 by StarmanNess aaa Link to comment https://forums.kleientertainment.com/forums/topic/73904-question-how-does-maxwells-puppets-follow-him/#findComment-864838 Share on other sites More sharing options...
Fancy_Fox_Pers Posted February 8, 2017 Author Share Posted February 8, 2017 (edited) Thanks, Lumina and StarmanNess for replying. StarmanNess, your reply made me think about the fact that it was the "reader" component you can find in wawell.lua that I was missing (but it clearly wasn't since that only adresses using the codex umbra). It got me thinking about something else. So here's what I did: I put this code (from the guardian_thibaud.lua) Spoiler local function onbuilt(inst, builder) local theta = math.random() * 2 * PI local pt = builder:GetPosition() local radius = math.random(3, 6) local offset = FindWalkableOffset(pt, theta, radius, 12, true) if offset ~= nil then pt.x = pt.x + offset.x pt.z = pt.z + offset.z end builder.components.petleash:SpawnPetAt(pt.x, 0, pt.z, inst.pettype) inst:Remove() end higher up. It clearly was not running before because now when I craft the creature it doesn't appear. This is clearly because of the last line of the function that states to remove the entity. Removing that last line gives the same effect as before: the creature appears, but it doesn't follow. I thought that this would work to start the petleash thingy. Does anyone *now* have a clue on how to continue? Edit: I also replaced things like "shadowlumber" by "guardianlumber" in the brain now (forgot) Edited February 8, 2017 by Thibooms Link to comment https://forums.kleientertainment.com/forums/topic/73904-question-how-does-maxwells-puppets-follow-him/#findComment-864842 Share on other sites More sharing options...
Starlogy Posted February 8, 2017 Share Posted February 8, 2017 1 hour ago, Thibooms said: Does anyone *now* have a clue on how to continue? Did you do this as Maxwell or your mod character? Link to comment https://forums.kleientertainment.com/forums/topic/73904-question-how-does-maxwells-puppets-follow-him/#findComment-864850 Share on other sites More sharing options...
Fancy_Fox_Pers Posted February 8, 2017 Author Share Posted February 8, 2017 1 hour ago, StarmanNess said: Did you do this as Maxwell or your mod character? As the mod character. I don't really get what you want me to do with Maxwell. I did try to summon the creature with Maxwell if that's what you're asking, it's got the same effect so it is definitely not searching for Maxwell. Link to comment https://forums.kleientertainment.com/forums/topic/73904-question-how-does-maxwells-puppets-follow-him/#findComment-864863 Share on other sites More sharing options...
Starlogy Posted February 8, 2017 Share Posted February 8, 2017 17 minutes ago, Thibooms said: it's got the same effect so it is definitely not searching for Maxwell. Gotcha. That's all I needed to know. Unfortunately, I can't tell what other issues there are. If it were the case that they follow Maxwell, that would just be a quick fix. Sorry about that, but I hope I led you in the right direction. Link to comment https://forums.kleientertainment.com/forums/topic/73904-question-how-does-maxwells-puppets-follow-him/#findComment-864868 Share on other sites More sharing options...
Fancy_Fox_Pers Posted February 8, 2017 Author Share Posted February 8, 2017 3 hours ago, StarmanNess said: Gotcha. That's all I needed to know. Unfortunately, I can't tell what other issues there are. If it were the case that they follow Maxwell, that would just be a quick fix. Sorry about that, but I hope I led you in the right direction. Update: got it to follow me. When it comes to recipes, I had to add "_builder" at the end of the prefab name, for it to work with the MakeBuilder thingy. New problem: the creature doesn't just follow me, he will go right next to me. Also, when he is about a meter or two away his animation will go to idle but his body will carry on until he is right next to me. Then, when the leader tries to walk again the creature will be right on the leader's tail. And it's kind of annoying. I think I need someone who knows something about brains for this (setting different minimum follow distance will make the creature run back and forth all the time) guardian_thibaudbrain.lua. Link to comment https://forums.kleientertainment.com/forums/topic/73904-question-how-does-maxwells-puppets-follow-him/#findComment-864900 Share on other sites More sharing options...
Leonardo Cox Posted February 8, 2017 Share Posted February 8, 2017 Have you tried using inst.components.leader:AddFollower(x) ? Where x is the var used to indentify the newly spawned shadowmaxwell. Link to comment https://forums.kleientertainment.com/forums/topic/73904-question-how-does-maxwells-puppets-follow-him/#findComment-864904 Share on other sites More sharing options...
Fancy_Fox_Pers Posted February 8, 2017 Author Share Posted February 8, 2017 1 minute ago, DarkKingBoo said: Have you tried using inst.components.leader:AddFollower(x) ? Where x is the var used to indentify the newly spawned shadowmaxwell. Where would I use this, given the weird way in which shadowmaxwell works? Also, as stated in previous post, it follows me but it now keeps on "kissing my ass" so to speak. Link to comment https://forums.kleientertainment.com/forums/topic/73904-question-how-does-maxwells-puppets-follow-him/#findComment-864905 Share on other sites More sharing options...
Lumina Posted February 8, 2017 Share Posted February 8, 2017 Maybe it's because of the petleash ? I guess petleash is for pet (like the small hound, for example), not for usual followers ? Link to comment https://forums.kleientertainment.com/forums/topic/73904-question-how-does-maxwells-puppets-follow-him/#findComment-864908 Share on other sites More sharing options...
Fancy_Fox_Pers Posted February 8, 2017 Author Share Posted February 8, 2017 12 minutes ago, Lumina said: Maybe it's because of the petleash ? I guess petleash is for pet (like the small hound, for example), not for usual followers ? But that doesn't explain the weird behaviour upon following. Isn't this a brain issue? Link to comment https://forums.kleientertainment.com/forums/topic/73904-question-how-does-maxwells-puppets-follow-him/#findComment-864909 Share on other sites More sharing options...
Leonardo Cox Posted February 8, 2017 Share Posted February 8, 2017 (edited) local function onbuilt(inst, builder) local theta = math.random() * 2 * PI local pt = builder:GetPosition() local radius = math.random(3, 6) local offset = FindWalkableOffset(pt, theta, radius, 12, true) if offset ~= nil then pt.x = pt.x + offset.x pt.z = pt.z + offset.z end inst.Transform:SetPosition(pt.x, 0, pt.z) builder.components.leader:AddFollower(inst) end EDIT: Forgot to add the SetPosition for spawning. Edited February 8, 2017 by DarkKingBoo Link to comment https://forums.kleientertainment.com/forums/topic/73904-question-how-does-maxwells-puppets-follow-him/#findComment-864910 Share on other sites More sharing options...
Lumina Posted February 8, 2017 Share Posted February 8, 2017 30 minutes ago, Thibooms said: But that doesn't explain the weird behaviour upon following. Isn't this a brain issue? It could, i think. petleash is probably for keeping pet close to you and force them to appears close to you if you are too far of them, and i guess it's not really compatible with the active followers (since pets don't really do anything). I'm not sure, i'm not familiar with petleash function... Link to comment https://forums.kleientertainment.com/forums/topic/73904-question-how-does-maxwells-puppets-follow-him/#findComment-864919 Share on other sites More sharing options...
Fancy_Fox_Pers Posted February 8, 2017 Author Share Posted February 8, 2017 Spoiler 44 minutes ago, DarkKingBoo said: local function onbuilt(inst, builder) local theta = math.random() * 2 * PI local pt = builder:GetPosition() local radius = math.random(3, 6) local offset = FindWalkableOffset(pt, theta, radius, 12, true) if offset ~= nil then pt.x = pt.x + offset.x pt.z = pt.z + offset.z end inst.Transform:SetPosition(pt.x, 0, pt.z) builder.components.leader:AddFollower(inst) end EDIT: Forgot to add the SetPosition for spawning. Tried it. Apparently this code creates an issue with the MakeBuilder thingy so I had to make sure the recipe was "guardianlumber" and not "guardianlumber_builder" for the creature to appear. The creature does follow but it still shows the same behaviour. I think there has got to be something going on with the brain/stategraph Link to comment https://forums.kleientertainment.com/forums/topic/73904-question-how-does-maxwells-puppets-follow-him/#findComment-864936 Share on other sites More sharing options...
Fancy_Fox_Pers Posted February 9, 2017 Author Share Posted February 9, 2017 Update: it is now fully functional. It was a stategraph problem that was easily fixed. Thanks for the help, guys! Link to comment https://forums.kleientertainment.com/forums/topic/73904-question-how-does-maxwells-puppets-follow-him/#findComment-865089 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