Tayburro Posted September 29, 2013 Share Posted September 29, 2013 I don't know how to word this but I can't seem to find where the effects for turfs are in the game code.I'm trying to make turfs acctually have effects but i cant find the location of where i would mod and i just need to know where the cobblestone speed coding is. (Sorry if this is hard to read, I am a very stupid person.) Link to comment https://forums.kleientertainment.com/forums/topic/28325-help-finding-ground-effects/ Share on other sites More sharing options...
TheDanaAddams Posted September 29, 2013 Share Posted September 29, 2013 If you want to alter the speed a character moves while on cobblestone turf, or roads, you just need to change their Run speed. inst.components.locomotor.runspeed = X Where X is the speed value. Wilson's default walk speed is 4, and run speed is 6, if I recall correctly. Link to comment https://forums.kleientertainment.com/forums/topic/28325-help-finding-ground-effects/#findComment-332618 Share on other sites More sharing options...
Tayburro Posted September 30, 2013 Author Share Posted September 30, 2013 (edited) If you want to alter the speed a character moves while on cobblestone turf, or roads, you just need to change their Run speed.inst.components.locomotor.runspeed = XWhere X is the speed value. Wilson's default walk speed is 4, and run speed is 6, if I recall correctly.It is 5 Thanks for the help my mod is sadly not working due to my idiocy but whatever... God I suck at everything. Edited September 30, 2013 by Tayburro Link to comment https://forums.kleientertainment.com/forums/topic/28325-help-finding-ground-effects/#findComment-332679 Share on other sites More sharing options...
Malacath Posted September 30, 2013 Share Posted September 30, 2013 Dude, that "I suck at everything."-attitude doesn't help you. Neither the "I am a very stupid person." Do me a favor and don't talk of yourself like this, not doing it on this forum is the first step to not doing it everywhere else. (If you didn't mean it then I'm sorry for that instruction on how to treat yourself)On-Topic: If I understand you correctly then I think I can point you in the right direction when I'm home. Do you want to add effects to all of the turf? i.e. grassy turf makes you get more sanity, forest turf makes you burn... Do I understand correctly? Link to comment https://forums.kleientertainment.com/forums/topic/28325-help-finding-ground-effects/#findComment-332835 Share on other sites More sharing options...
Tayburro Posted September 30, 2013 Author Share Posted September 30, 2013 Dude, that "I suck at everything."-attitude doesn't help you. Neither the "I am a very stupid person." Do me a favor and don't talk of yourself like this, not doing it on this forum is the first step to not doing it everywhere else. (If you didn't mean it then I'm sorry for that instruction on how to treat yourself)On-Topic: If I understand you correctly then I think I can point you in the right direction when I'm home. Do you want to add effects to all of the turf? i.e. grassy turf makes you get more sanity, forest turf makes you burn... Do I understand correctly? Just to the man-made turfs and perhaps to marsh turf. Link to comment https://forums.kleientertainment.com/forums/topic/28325-help-finding-ground-effects/#findComment-332841 Share on other sites More sharing options...
Malacath Posted September 30, 2013 Share Posted September 30, 2013 Just to the man-made turfs and perhaps to marsh turf.And it shall only affect the player? Cause in that case I'm quite sure I know a solution but I'll not be home for another 5 hours probably, so just be patient ; ) Link to comment https://forums.kleientertainment.com/forums/topic/28325-help-finding-ground-effects/#findComment-332879 Share on other sites More sharing options...
Malacath Posted September 30, 2013 Share Posted September 30, 2013 (edited) Just to the man-made turfs and perhaps to marsh turf.So this might or might not be complicated depending on your knowledge modding. If you feel like I'm telling you totally strange things then you should probably start with something simpler ; ) In "terrain.lua", which is in your maps folder, you have the list of all grounds that exist in the game. You'll need this just for reference. Now the useful function for what you want to do is GetTileAtPoint(x, y, z), which you can use like thislocal ground = GetWorld()if ground.Map then local tile = ground.Map:GetTileAtPoint(x, y, z) if tile and tile == GROUND.MARSH then --Do something endendNow you'll want your character to check every second on which tile he is (how often to check is your choice, but one second is probably a good start), which you can do like thisinst:DoPeriodicTask(1, function() local x,y,z = inst.Transform:GetWorldPosition() local ground = GetWorld() if ground.Map then local tile = ground.Map:GetTileAtPoint(x, y, z) if tile and tile == GROUND.MARSH then --Do something end endend)If that seems above your head then start by looking at some samplemods or tutorials which were kindly gathered here. Good luck ^^ Edited September 30, 2013 by Malacath Link to comment https://forums.kleientertainment.com/forums/topic/28325-help-finding-ground-effects/#findComment-333084 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