Puturie Posted December 8, 2015 Share Posted December 8, 2015 Even though I changed inst.components.locomotor.walkspeed and runspeed to 8 and 12, respectively, Ilya's speed didn't chance in-game. It is still the default speed. Can someone look over the mod file and see if I've made any mistakes?illya.lua Link to comment https://forums.kleientertainment.com/forums/topic/60398-problem-with-character-mod-speed-wont-change/ Share on other sites More sharing options...
Developer V2C Posted December 8, 2015 Developer Share Posted December 8, 2015 The recommended way to mod player speed is with this: inst.locomotor:SetExternalSpeedMultiplier(inst, "illya_speed_mod", 2) 2 is the multiplier in this example, so you will move twice as fast."illy_speed_mod" is any unique key you want, in case you need to use it to remove or change the bonus later.(e.g. inst.locomotor:RemoveExternalSpeedMultiplier(inst, "illya_speed_mod") Link to comment https://forums.kleientertainment.com/forums/topic/60398-problem-with-character-mod-speed-wont-change/#findComment-694512 Share on other sites More sharing options...
Silhh Posted December 11, 2015 Share Posted December 11, 2015 But what If I wanted my character to walk slow on roads and fast on turf? Link to comment https://forums.kleientertainment.com/forums/topic/60398-problem-with-character-mod-speed-wont-change/#findComment-696411 Share on other sites More sharing options...
DarkXero Posted December 11, 2015 Share Posted December 11, 2015 But what If I wanted my character to walk slow on roads and fast on turf? The road speed multiplier is 1.3, as stated in the fastmultiplier member of locomotor. First, in order to make your character be faster everywhere, including turf, we doinst.components.locomotor:SetExternalSpeedMultiplier(inst, "turf_speed_mod", 2)in the master_postinit function of the character. Now that the character is faster everywhere, we doAddComponentPostInit("locomotor", function(self) if self.inst.prefab == "wilson" then self.fastmultiplier = 0.7 endend)in the modmain.lua file of your mod, with "wilson" being your character prefab. Notice we replaced 1.3 for 0.7, so roads will reduce your character's speed. Link to comment https://forums.kleientertainment.com/forums/topic/60398-problem-with-character-mod-speed-wont-change/#findComment-696517 Share on other sites More sharing options...
rons0n Posted December 12, 2015 Share Posted December 12, 2015 Hi @DarkXero. I tried applying this to my character but she still is blazing fast on both turf and road. Ideas? Link to comment https://forums.kleientertainment.com/forums/topic/60398-problem-with-character-mod-speed-wont-change/#findComment-696777 Share on other sites More sharing options...
DarkXero Posted December 12, 2015 Share Posted December 12, 2015 I tried applying this to my character but she still is blazing fast on both turf and road. Ideas? Apparently the prefab name isn't setup at the time. Put a tag like roadslow on the common_postinit and then useAddComponentPostInit("locomotor", function(self) if self.inst:HasTag("roadslow") then self.fastmultiplier = 0.7 endend) Link to comment https://forums.kleientertainment.com/forums/topic/60398-problem-with-character-mod-speed-wont-change/#findComment-696834 Share on other sites More sharing options...
rons0n Posted December 12, 2015 Share Posted December 12, 2015 @DarkXero, Thanks! Though I dont quite why we needed to change the speed this way. I was content with just changing the run and walk speed accordingly. Allwell, you learn and adapt I guess. Link to comment https://forums.kleientertainment.com/forums/topic/60398-problem-with-character-mod-speed-wont-change/#findComment-696868 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