thezotikrus Posted June 14, 2017 Share Posted June 14, 2017 (edited) Hello everyone, Im making character mod and my character has a small head (almost 2 times smaller). And there is a problem - standarts hats too big and this looks oddly. I have only 1 idea: make little models of standart hats and use them. When my character is getting hat in inventory he will use small hats but replace with standart hats then character drops hat from inventory. Im not sure about how to code it. If someone can help me with it or has another idea please tell me. Oh and i forgot. The 2nd problem is hats "fly" above head, maybe I should decrease dimensions of head symbols? Spoiler Edited June 15, 2017 by TheZotikRus Link to comment Share on other sites More sharing options...
BigMommaWolf Posted June 14, 2017 Share Posted June 14, 2017 If you feel like showing some concept art of the character, I wouldn't mind trying to help you come up with solutions that don't involve you having to edit the animations any. Link to comment Share on other sites More sharing options...
thezotikrus Posted June 14, 2017 Author Share Posted June 14, 2017 21 minutes ago, BigMommaWolf said: If you feel like showing some concept art of the character, I wouldn't mind trying to help you come up with solutions that don't involve you having to edit the animations any. I do not want to change concept if you mean that. This char should have small head. I can post some concept later, gimme some time. Link to comment Share on other sites More sharing options...
thezotikrus Posted June 14, 2017 Author Share Posted June 14, 2017 Ok, I edited topic, so you can see what I meant. I dont want to show character but i can give you concept and show on example. Link to comment Share on other sites More sharing options...
alainmcd Posted June 14, 2017 Share Posted June 14, 2017 Couldn't you roughly match Wilson's dimensions and then call ApplyScale, similar to how Wolfgang does? Link to comment Share on other sites More sharing options...
thezotikrus Posted June 15, 2017 Author Share Posted June 15, 2017 (edited) 19 hours ago, alainmcd said: Couldn't you roughly match Wilson's dimensions and then call ApplyScale, similar to how Wolfgang does? Sounds smart! I will try! In game files i did find this: self.inst.Transform:SetScale(self.scale,self.scale,self.scale) It will change x, y and z scale right? Then i can make standart character and decrease dimensions. Edited June 15, 2017 by TheZotikRus Link to comment Share on other sites More sharing options...
alainmcd Posted June 15, 2017 Share Posted June 15, 2017 Player characters have an ApplyScale member function defined in player_common.lua, use it instead of the scaler component, which is what I think you found. Just add inst:ApplyScale("sizecorrection", .5) to your master_postinit. (And hope that it works!) Link to comment Share on other sites More sharing options...
thezotikrus Posted June 15, 2017 Author Share Posted June 15, 2017 Oh, ok! Just for reference. I used this "component" inst.Transform:SetScale(1,.5,1) and ThePlayer.Transform:SetScale(1,.5,1) And it works! But with first case character moves slowly (only with 1 coordinate that i changed). Can you tell me why? Now I will try you method. Link to comment Share on other sites More sharing options...
thezotikrus Posted June 15, 2017 Author Share Posted June 15, 2017 I did as you tell me and it works pretty good! But speed still decrease. I think i can add inst.components.locomotor:SetExternalSpeedMultiplier So if i decrease scale by .5 should i increase speed by .5? I hope I will find answers later. But now I'm ready to start making my character. With much thanks for you! Link to comment Share on other sites More sharing options...
alainmcd Posted June 15, 2017 Share Posted June 15, 2017 (edited) Errr, nope, sorry, I'm not sure why it does that. Either I can't find the definition for Transform:SetScale or it isn't exposed in the Lua code. But it seems like it does affect speed, I'm looking at wolfgang.lua and player_common.lua, and I can't see any explicit change to his speed when changing sizes. You might need to correct it, try this: local scale = .5 inst:ApplyScale("sizecorrection", scale) inst.components.locomotor:SetExternalSpeedMultiplier("sizecorrection", 1/scale) This way, if you need to adjust the scale, just change the value assigned to the variable. Spoiler Btw, Transform isn't a component. Components are common actions or interactions that can be applied to different entities, for example, locomotor in the code above is a component, it allows entities that possess this component to move around the world. Components are usually added via inst:AddComponent("somecomponent") and manipulated with inst.components.somecomponent - in this case we don't need to add the component since it is inherited from MakePlayerCharacter. Here's a little more info on what "prefab", "component" and related terms actually mean, if you're interested. On the other hand, Transform... well, it just is. It's a basic set of properties that applies to almost all entities just because they exist, and it handles size, location and orientation of an entity. Edit: If I didn't write so much, you'd have answers even before you asked! Edited June 15, 2017 by alainmcd I sometimes go on and on and on. Oops. Link to comment Share on other sites More sharing options...
thezotikrus Posted June 15, 2017 Author Share Posted June 15, 2017 (edited) Oh and again thank you! You helped me explore this game from inside! Its very interesting! But your last code does not affect on speed. Seems like "1/scale" is not enough (or this just does not work). Yeah! I got it! Update #2 local scale = .5 local function onbecamehuman(inst) inst.components.locomotor:SetExternalSpeedMultiplier(inst, "sizecorrection", 1/scale) end local master_postinit = function(inst) inst:ApplyScale("sizecorrection", scale) Finally! Edited June 15, 2017 by TheZotikRus fixed! Link to comment Share on other sites More sharing options...
alainmcd Posted June 15, 2017 Share Posted June 15, 2017 Yeap, that first argument inst was missing, so this should finally work: local scale = .5 inst:ApplyScale("sizecorrection", scale) inst.components.locomotor:SetExternalSpeedMultiplier(inst, "sizecorrection", 1/scale) Great job! 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