- Site Map >
- Modding and Creation >
- Sims 4 Creation >
- Modding Discussion >
- Maximum and minimum fat range obtainable halved mod ( Solved and download Available)
- Site Map >
- Modding and Creation >
- Sims 4 Creation >
- Modding Discussion >
- Maximum and minimum fat range obtainable halved mod ( Solved and download Available)
#1
18th Apr 2015 at 3:02 AM
Last edited by qazxc : 19th Apr 2015 at 4:21 PM.
Reason: It's done now :D
Posts: 8
Maximum and minimum fat range obtainable halved mod ( Solved and download Available)
So I got the Mod working now, thanks a bunch to scumbumbo and Scripthoge.The mod I uploaded halves the maximum and minimum fatness gainable.
Check out the file at the first page last post.
I increase it beyond the original max and min fat, and I can try and do it for fitness.
Do tell if anyone wants it specifically set.
-------Original----------
Hi. I'm kinda a noob at programming, and I have very little knowledge of the python language...
I could understand a few parts, but not entirely. (And I hope it is allowed to ask about someone else's mod work X/)
I'd like to know what Scripthoge's injector specifically does. Does it allow you to create a new function to be executed in place of the targeted one, or does it simply inject a new function before it executes the targeted one?
I'd like to be sure with it, since I couldn't get my mod working. ><
Thank you for the time )
Advertisement
#2
18th Apr 2015 at 7:06 AM
Posts: 2,671
Thanks: 62709 in 190 Posts
It is intended more for the latter as it saves a "pointer" to the old function (original) that you can then use to call the original function, either before or after you do other things.
For instance, in one place in door locks I want to get notified whenever a role gets added to a sim. I call the original function in my injected function and then follow that with the logic I need to add...
But in auto-pause pregnancy, I do things the other way around, first checking on whether we even want to call the original function to process the pregnancy, or just return...
So it's not even necessary to call the original code, you could use it to completely replace the original by not calling it. But, why use all the overhead of the injection if you're not going to call the original at all? I suppose it might view better as far as being a bit more "self-commenting", so it's a trade-off of speed vs. readability.
So for instance, in the variable default relationships mod, I'm completely changing the logic of the original function, not just tacking on code before or after it, so I override the original function completely, like so...
It would have been equally effective to use the injector instead, completely rewriting the function as I did and just never calling the original.
And yes, it's perfectly valid to ask questions about other's mods. The majority of us are more than happy to discuss why we do things the way we do. Usually it's just because we're lazy, but sometimes we have reasons
For instance, in one place in door locks I want to get notified whenever a role gets added to a sim. I call the original function in my injected function and then follow that with the logic I need to add...
Code:
@injector.inject_to(role.role_tracker.RoleStateTracker, 'add_role') def door_locks_role_added(original, self, new_role_state, role_affordance_target=None): original(self, new_role_state, role_affordance_target) if new_role_state.guid64 in ROLES_TO_TRACK: door_locks_sim_tracker.update_roles(self)
But in auto-pause pregnancy, I do things the other way around, first checking on whether we even want to call the original function to process the pregnancy, or just return...
Code:
@injector.inject_to(interactions.utils.pregnancy.PregnancyTracker, 'update_pregnancy') def MTS_Scumbumbo_update_pregnancy(original, self): aging_service = services.get_age_service() played_household_aging_option = aging_service._played_household_aging_option if played_household_aging_option != PlayedHouseholdSimAgingOptions.ALL_PLAYED: <SNIP> return original(self)
So it's not even necessary to call the original code, you could use it to completely replace the original by not calling it. But, why use all the overhead of the injection if you're not going to call the original at all? I suppose it might view better as far as being a bit more "self-commenting", so it's a trade-off of speed vs. readability.
So for instance, in the variable default relationships mod, I'm completely changing the logic of the original function, not just tacking on code before or after it, so I override the original function completely, like so...
Code:
# Replacement for the apply() function of the relationship tracker tuning def VDR_apply(self, relationship_tracker, target_sim): sim_to_target_tracker = relationship_tracker.get_relationship_track_tracker(target_sim.sim_id, add=True) <SNIP> # Replace the apply() function of the relationship tracker tuning relationships.relationship_tracker_tuning.DefaultRelationship.apply = VDR_apply
It would have been equally effective to use the injector instead, completely rewriting the function as I did and just never calling the original.
And yes, it's perfectly valid to ask questions about other's mods. The majority of us are more than happy to discuss why we do things the way we do. Usually it's just because we're lazy, but sometimes we have reasons
#3
18th Apr 2015 at 7:43 AM
Posts: 8
Oh, I get it now... It seems pretty nifty. And since, I don't know much, I'll just go with the injector.
But what about other pieces of codes that call for the original function?
I'm planning to use the injector without calling forth the original. And if I have to avoid the original being called, should I inject another piece of script for those parts?
Or does it directly go to my code?
Thank you very much for explaining to me about the injector.
But what about other pieces of codes that call for the original function?
I'm planning to use the injector without calling forth the original. And if I have to avoid the original being called, should I inject another piece of script for those parts?
Or does it directly go to my code?
Thank you very much for explaining to me about the injector.
#4
18th Apr 2015 at 5:48 PM
Posts: 8
Sorry for the double post.... and being way too offtopic ><
After days on an attempt on it, switching from xml tuning to python scripting, I made an attempt on using the injector again, and now it seems as if i'm just toying with the previous mod.
I tried doing your suggested latter part, the one with not using the injector.
The attempt doesn't seem to work at all....
(well, It would have been more accurate to detect if the game crashes with wrong python script mod coding)
and then I got back to using the injector. (Utter failure)
What you'll find here is an attempt to decrease the maximum fat physique possible to gain in the game (or at least, the body blend value... And I didn't use subtract, could lead to a negative value X/ )
import sims.sim_info
import injector
@injector.inject_to(sims.sim_info.SimInfo, "_set_fit_fat")
def my_set_fit_fat(original, self):
physique = [x for x in self.physique.split(',')]
# call original
original(self)
# rollback fit
physique_range = 1000
physique = [x for x in self.physique.split(',')]
physique[sims.sim_info.SimInfo.BodyBlendTypes.BODYBLENDTYPE_HEAVY] = (str(math.trunc(fit*physique_range)/physique_range))/2
physique[sims.sim_info.SimInfo.BodyBlendTypes.BODYBLENDTYPE_LEAN] = str(math.trunc(lean*physique_range)/physique_range)/2
physique = ','.join([x for x in physique])
self.physique = physique
I had let the original function be called so it processes the script, then I had set physique values to change.
I kept going around in circles. I've bumped on to some things from time-to-time, and yet no luck at all.
Is there another file ingame that wouldn't allow the script to do so? or is it just how badly-written my edit is?
I would definitely be grateful for your help in this.
Oh and
While going through xml files and all, I found lots of nifty stuff.
Like a cheat to change your sims to the maximum/minimum fit or fat physique.
they can be triggered by typing one of these in the console.
sims.add_buff buff_maxfat
sims.add_buff buff_minfat
sims.add_buff buff_maxfit
sims.add_buff buff_minfit
the maxfat minfat/ maxfit minfit buffs i found in the xml don't seem to contain much info other than being a buff, being invisible, having an audio file and icon.
There's another set of files I found such as the effects of using the workout machine, or the threadmill, or the zero gravity workout from the rocket.
I have made an attempt to change the fat or fit gain/loss rate when using such normally, or doing it in a different mode like dont break a sweat interaction, and it works, unlike the mod i'm currently trying to work on for days.(driving me insane with all the time spent)
I'll upload it when someone requests for a faster gain or a slower gain on either fat or fit.
After days on an attempt on it, switching from xml tuning to python scripting, I made an attempt on using the injector again, and now it seems as if i'm just toying with the previous mod.
I tried doing your suggested latter part, the one with not using the injector.
The attempt doesn't seem to work at all....
(well, It would have been more accurate to detect if the game crashes with wrong python script mod coding)
and then I got back to using the injector. (Utter failure)
What you'll find here is an attempt to decrease the maximum fat physique possible to gain in the game (or at least, the body blend value... And I didn't use subtract, could lead to a negative value X/ )
import sims.sim_info
import injector
@injector.inject_to(sims.sim_info.SimInfo, "_set_fit_fat")
def my_set_fit_fat(original, self):
physique = [x for x in self.physique.split(',')]
# call original
original(self)
# rollback fit
physique_range = 1000
physique = [x for x in self.physique.split(',')]
physique[sims.sim_info.SimInfo.BodyBlendTypes.BODYBLENDTYPE_HEAVY] = (str(math.trunc(fit*physique_range)/physique_range))/2
physique[sims.sim_info.SimInfo.BodyBlendTypes.BODYBLENDTYPE_LEAN] = str(math.trunc(lean*physique_range)/physique_range)/2
physique = ','.join([x for x in physique])
self.physique = physique
I had let the original function be called so it processes the script, then I had set physique values to change.
I kept going around in circles. I've bumped on to some things from time-to-time, and yet no luck at all.
Is there another file ingame that wouldn't allow the script to do so? or is it just how badly-written my edit is?
I would definitely be grateful for your help in this.
Oh and
While going through xml files and all, I found lots of nifty stuff.
Like a cheat to change your sims to the maximum/minimum fit or fat physique.
they can be triggered by typing one of these in the console.
sims.add_buff buff_maxfat
sims.add_buff buff_minfat
sims.add_buff buff_maxfit
sims.add_buff buff_minfit
the maxfat minfat/ maxfit minfit buffs i found in the xml don't seem to contain much info other than being a buff, being invisible, having an audio file and icon.
There's another set of files I found such as the effects of using the workout machine, or the threadmill, or the zero gravity workout from the rocket.
I have made an attempt to change the fat or fit gain/loss rate when using such normally, or doing it in a different mode like dont break a sweat interaction, and it works, unlike the mod i'm currently trying to work on for days.(driving me insane with all the time spent)
I'll upload it when someone requests for a faster gain or a slower gain on either fat or fit.
#5
19th Apr 2015 at 6:13 AM
Posts: 2,671
Thanks: 62709 in 190 Posts
Well, I'm working on trying to figure out a bug with door locks that never shows up when I'm actually logging what's happening (aint' that always the way), but one problem with the Python injection jumped out at me. You can't access the locals from the original function like you're trying to do in the two lines...
I haven't really analyzed what you're trying to do, so there may be other problems but that should at least help get back on track. Putting in some lines to log variable contents and progress can really be helpful in this kind of situation, I find myself constantly putting in log lines, "Got here!" and "x = {}".format(x) and such when I'm stuck like that. I do most of my script work in a folder called "Script Testing\Scripts\" in the mods folder, and keep a copy of injector, reload and my logger script in there. If you don't want to write your own logger function, you can use my ScumLog (silly name, I know!) that I posted in an earlier thread: http://modthesims.info/showthread.p...461#post4679461
Code:
fit and lean are locals to the original function, so once it returns they are gone.physique[sims.sim_info.SimInfo.BodyBlendTypes.BODYBLENDTYPE_HEAVY] = (str(math.trunc(fit*physique_range)/physique_range))/2 physique[sims.sim_info.SimInfo.BodyBlendTypes.BODYBLENDTYPE_LEAN] = str(math.trunc(lean*physique_range)/physique_range)/2
I haven't really analyzed what you're trying to do, so there may be other problems but that should at least help get back on track. Putting in some lines to log variable contents and progress can really be helpful in this kind of situation, I find myself constantly putting in log lines, "Got here!" and "x = {}".format(x) and such when I'm stuck like that. I do most of my script work in a folder called "Script Testing\Scripts\" in the mods folder, and keep a copy of injector, reload and my logger script in there. If you don't want to write your own logger function, you can use my ScumLog (silly name, I know!) that I posted in an earlier thread: http://modthesims.info/showthread.p...461#post4679461
#6
19th Apr 2015 at 11:32 AM
Posts: 8
I really appreciate how you're still sticking with me through this >< You're really awesome and generous to find the time
Oh, that explains stuff XD.... Thanks for clearing that part up
Oh, my bad, I messed up on some parts of the script which didn't seem logical at all. If it helps, I'm trying to set a smaller range of fat achievable in the game. I couldn't get it right due to my lack of knowledge in programming...
Sorry, I know I'm a real noob at these, but I'm guessing what ScumLog does is get a certain value of the variable being sought for and write it on a log file, right? so i could determine what the value of the variable is?
But where does it place the log file??? (>< I didn't understand the os.path part, but I'll do try to make sense of it so I would know where.)
Oh and I'm kinda cool with the name. I don't find it silly ><
Meanwhile, I found out that the game actually inputs what went wrong with the mod in a file, when the mod is supposed to be triggered in the game. You guys might've known this before, but it's giving me a whole lot more understanding on my stupidity towards typing crappy edits on the mod. The log where the game stores it is somewhere in the sims 4 folder found in my documents (inside electronic arts folder of course). The file's called, "lastException.txt"....
I managed to make some tinkering hither and tither while being guided by the lastException file and got far with this code:
import sims.sim_info
import injector
import ScumLog
import itertools
import math
import weakref
@injector.inject_to(sims.sim_info.SimInfo, "_set_fit_fat")
def my_set_fit_fat(original, self):
physique = [x for x in self.physique.split(',')]
fat = physique[sims.sim_info.SimInfo.BodyBlendTypes.BODYBLENDTYPE_FAT]
lean = physique[sims.sim_info.SimInfo.BodyBlendTypes.BODYBLENDTYPE_LEAN]
# call original
original(self)
# change fat range
physique_range = 1000
physique = [x for x in self.physique.split(',')]
physique[sims.sim_info.SimInfo.BodyBlendTypes.BODYBLENDTYPE_FAT] = str(math.trunc(fat*physique_range)/(physique_range*2))
physique[sims.sim_info.SimInfo.BodyBlendTypes.BODYBLENDTYPE_LEAN] = str(math.trunc(lean*physique_range)/(physique_range*2))
physique = ','.join([x for x in physique])
self.physique = physique
I may consider editing the physique range value (the game's default is really 1000), though that isn't what seems to be the big problem just yet...
The error i'm getting with the code seems to be about str with respect to ____trunc____... I don't really get what "str doesn't define ___trunc___" means >< but it seems
that the script won't make an effect unless this matter is fixed... Any Ideas about it???
Oh yeah, this might help, so, here's the content of the Lastexception file, as I set my sim to max fat:
Again, I'm really thankful for helping me out. Your help means a lot.
Quote:
You can't access the locals from the original function like you're trying to do in the two lines. fit and lean are locals to the original function, so once it returns they are gone. |
Oh, that explains stuff XD.... Thanks for clearing that part up
Quote:
I haven't really analyzed what you're trying to do, |
Oh, my bad, I messed up on some parts of the script which didn't seem logical at all. If it helps, I'm trying to set a smaller range of fat achievable in the game. I couldn't get it right due to my lack of knowledge in programming...
Quote:
Putting in some lines to log variable contents and progress can really be helpful in this kind of situation, I find myself constantly putting in log lines, "Got here!" and "x = {}".format(x) and such when I'm stuck like that. I do most of my script work in a folder called "Script Testing\Scripts\" in the mods folder, and keep a copy of injector, reload and my logger script in there. If you don't want to write your own logger function, you can use my ScumLog (silly name, I know!) that I posted in an earlier thread: http://modthesims.info/showthread.p...461#post4679461 |
Sorry, I know I'm a real noob at these, but I'm guessing what ScumLog does is get a certain value of the variable being sought for and write it on a log file, right? so i could determine what the value of the variable is?
But where does it place the log file??? (>< I didn't understand the os.path part, but I'll do try to make sense of it so I would know where.)
Oh and I'm kinda cool with the name. I don't find it silly ><
Meanwhile, I found out that the game actually inputs what went wrong with the mod in a file, when the mod is supposed to be triggered in the game. You guys might've known this before, but it's giving me a whole lot more understanding on my stupidity towards typing crappy edits on the mod. The log where the game stores it is somewhere in the sims 4 folder found in my documents (inside electronic arts folder of course). The file's called, "lastException.txt"....
I managed to make some tinkering hither and tither while being guided by the lastException file and got far with this code:
import sims.sim_info
import injector
import ScumLog
import itertools
import math
import weakref
@injector.inject_to(sims.sim_info.SimInfo, "_set_fit_fat")
def my_set_fit_fat(original, self):
physique = [x for x in self.physique.split(',')]
fat = physique[sims.sim_info.SimInfo.BodyBlendTypes.BODYBLENDTYPE_FAT]
lean = physique[sims.sim_info.SimInfo.BodyBlendTypes.BODYBLENDTYPE_LEAN]
# call original
original(self)
# change fat range
physique_range = 1000
physique = [x for x in self.physique.split(',')]
physique[sims.sim_info.SimInfo.BodyBlendTypes.BODYBLENDTYPE_FAT] = str(math.trunc(fat*physique_range)/(physique_range*2))
physique[sims.sim_info.SimInfo.BodyBlendTypes.BODYBLENDTYPE_LEAN] = str(math.trunc(lean*physique_range)/(physique_range*2))
physique = ','.join([x for x in physique])
self.physique = physique
I may consider editing the physique range value (the game's default is really 1000), though that isn't what seems to be the big problem just yet...
The error i'm getting with the code seems to be about str with respect to ____trunc____... I don't really get what "str doesn't define ___trunc___" means >< but it seems
that the script won't make an effect unless this matter is fixed... Any Ideas about it???
Oh yeah, this might help, so, here's the content of the Lastexception file, as I set my sim to max fat:
Quote:
<report><version>2</version><sessionid>2c187300ed625c2055337517</sessionid><type>desync</type><sku>ea.maxis.sims4.13.pc</sku><createtime>2015-04-19 17:29:30</createtime><buildsignature>Local.Unknown.Unknown.1.5.139.1020-1.200.000.101.Release</buildsignature><categoryid>mightbeit.py:91</categoryid><desyncid>2c187300ed625c2055337517</desyncid><systemconfig/><screenshot/><desyncdata> File "T:\InGame\Gameplay\Scripts\Server\scheduling.py", line 212, in simulate
File "T:\InGame\Gameplay\Scripts\Server\elements.py", line 332, in _run
File "T:\InGame\Gameplay\Scripts\Server\interactions\utils\interaction_elements.py", line 153, in _behavior_element
File "T:\InGame\Gameplay\Scripts\Server\interactions\utils\interaction_elements.py", line 485, in _do_behavior
File "T:\InGame\Gameplay\Scripts\Server\sims\sim_info.py", line 441, in update_fitness_state
File "C:\Users\-------\Documents\Electronic Arts\The Sims 4\Mods\dddd\Scripts\injector.py", line 8, in _inject
return new_function(target_function, *args, **kwargs)
File "C:\Users\-------\Documents\Electronic Arts\The Sims 4\Mods\dddd\Scripts\mightbeit.py", line 91, in my_set_fit_fat
physique[sims.sim_info.SimInfo.BodyBlendTypes.BODYBLENDTYPE_FAT] = str(math.trunc(fat*physique_range)/(physique_range*2))
TypeError: type str doesn't define __trunc__ method
</desyncdata></report> </root> |
Again, I'm really thankful for helping me out. Your help means a lot.
#7
19th Apr 2015 at 4:15 PM
Posts: 8
Whoa If I can't thank you and ScriptHoge enuf!
LOL sorry again for doublepostingYou know, disregard what I said above, cause I got it to work! ><
Took me weeks to study a bit, but, I'm really thanking you for sticking through with me.
What seemed to cause the problem was the math.trunc operation. I know it's for simplifying a value, but as soon as I eliminated it, the mod worked with no error.
My programming skills are weak, and yet all this time X/, it was as simple as that.
I added the local variables from the sim_info which lead to calling the consumable component. (variables called maxfat, maxfit, minfat, minfit called for the commodities in consumable component)
I also made new variables so that I could perform division without making many parentheses which seemed to confuse the system....
And, yeah it seems so that it needs some tweaking for simplification and smoothness' sake, but, well, it works anyway.
Thank you very much. If it weren't for you I wouldn't really have done it.
And, is it necessary to convert it to .pyo? I think I'm doing it wrong.
I did what was written in the pdf file on how to do it,
run python.exe -O, import the file, and get it from ___pycache___
right??
I'll have to look in to it.
So anyways, here's the mod in case you want to have a look in to it. Suggestions on how to simplify it?
They're just .py files, since I dunno how to do them to pyo, though the injector has a pyo.
So what it does is to halve the maximum and minimum gainable fat ingame. And as expected when editing the physique in cas mode, traveling to other places snaps the sim's physique to the maximum fat halved.
I can do the increased fat range as well, and same goes for fit range. This should be very compatible with the cas physique range by (evol_evolved?)
So yeah.
Attached files:
fatrangedecreaseringame.rar (1.2 KB, 747 downloads) - View custom content | ||
Size Packed Ratio Date Time Attr CRC Meth Ver ------------------------------------------------------------------------------- fatrangedecreaseringame/Scripts/fatrangedecreaseringame(qazxc).py 2042 652 31% 19-04-15 22:20 .....A. 31DAB9B8 m3b 2.9 fatrangedecreaseringame/Scripts/injector.py 826 287 34% 10-09-14 13:55 .....A. B266D2DB m3b 2.9 fatrangedecreaseringame/Scripts 0 0 0% 19-04-15 22:07 .D..... 00000000 m0 2.0 fatrangedecreaseringame 0 0 0% 19-04-15 23:12 .D..... 00000000 m0 2.0 ------------------------------------------------------------------------------- 4 2868 939 32% |
||
Description: it halves the standard maximum fat and lean limit... thought it is possible to multiply the values for increase. I'll work on that. And it's not zipped so extract it so it would work |
#8
19th Apr 2015 at 7:14 PM
Posts: 2,671
Thanks: 62709 in 190 Posts
OK, glad you've had some success, let me explain what is going on...
What the _set_fit_fat function is doing is converting the fat (and fit, but we don't care about that for this) commodity from the range defined in the XML (-100 to 100) to two percentages, heavy and lean, which are the percentage above or below the midpoint. So if the fatness commodity is -48.9248528324, the code will set heavy to 0.0 (since it's below the fat base), and lean to 48.9248528324. If someone changed the commodity to make fatness range from -50 to 50, it wouldn't change the actual displayed fatness/leanness, it would just double the rate at which visible changes occur, as if eating some food added 1 to the fatness commodity it would actually add 2 percent to the visible physique.
The physique_range value (1000) doesn't really control the total range, but how many decimal points are stored into the physique. It takes the 48.9248528324 and multiples by the range to get 48924.8528324, truncates it to 48924, and then divides by the range again to give 48.924. The reason trunc() wasn't working for you is that you set it at the beginning to the value from the physique, which is a string type and you can't trunc() a string.
So you're affecting what the sim looks like, but not changing the tuning for min and max physique, so the buffs for reaching the max and so forth don't require any modification. The true range is still -100 to 100, but you make the physical appearance go from -50 to 50. Seems like a good approach, you just should probably make sure that trunc() works properly to truncate to three decimal places. It probably doesn't make a difference, but the C code may be expecting that to only have three decimals and something may go screwy if it has more than three.
And yes, as you noted in the comment, you probably don't even need to call the original as long as you duplicate everything else it does. Otherwise you're just having to redo the fatness physique after it's already done it once.
What the _set_fit_fat function is doing is converting the fat (and fit, but we don't care about that for this) commodity from the range defined in the XML (-100 to 100) to two percentages, heavy and lean, which are the percentage above or below the midpoint. So if the fatness commodity is -48.9248528324, the code will set heavy to 0.0 (since it's below the fat base), and lean to 48.9248528324. If someone changed the commodity to make fatness range from -50 to 50, it wouldn't change the actual displayed fatness/leanness, it would just double the rate at which visible changes occur, as if eating some food added 1 to the fatness commodity it would actually add 2 percent to the visible physique.
The physique_range value (1000) doesn't really control the total range, but how many decimal points are stored into the physique. It takes the 48.9248528324 and multiples by the range to get 48924.8528324, truncates it to 48924, and then divides by the range again to give 48.924. The reason trunc() wasn't working for you is that you set it at the beginning to the value from the physique, which is a string type and you can't trunc() a string.
So you're affecting what the sim looks like, but not changing the tuning for min and max physique, so the buffs for reaching the max and so forth don't require any modification. The true range is still -100 to 100, but you make the physical appearance go from -50 to 50. Seems like a good approach, you just should probably make sure that trunc() works properly to truncate to three decimal places. It probably doesn't make a difference, but the C code may be expecting that to only have three decimals and something may go screwy if it has more than three.
And yes, as you noted in the comment, you probably don't even need to call the original as long as you duplicate everything else it does. Otherwise you're just having to redo the fatness physique after it's already done it once.
#9
25th Apr 2015 at 10:58 PM
Posts: 159
Thanks: 555 in 1 Posts
Quote: Originally posted by qazxc
I can do the increased fat range as well, and same goes for fit range. This should be very compatible with the cas physique range by (evol_evolved?) So yeah. |
That would be really awesome and useful!
Cheers! =D
lkandak
Test Subject
#10
21st Jul 2015 at 5:28 AM
Posts: 5
I'm interested in making this mod apply to increased ranges to go with Evol_Evolved's extended slider mod, but I have zero coding experience. How difficult is this to adjust? Would it be worth my time to try to learn all the stuff necessary to attempt this, or would it be like a "You need months of training, stay away n00b" kind of situation?
#11
28th Jul 2015 at 9:21 PM
Posts: 159
Thanks: 555 in 1 Posts
Quote: Originally posted by fudgex02
I'm interested in making this mod apply to increased ranges to go with Evol_Evolved's extended slider mod, but I have zero coding experience. How difficult is this to adjust? Would it be worth my time to try to learn all the stuff necessary to attempt this, or would it be like a "You need months of training, stay away n00b" kind of situation? |
Yeah that's what I was thinking would be awesome but I too don't have much experience at modding.
Cheers! =D
lkandak
Test Subject
#12
5th Sep 2015 at 1:43 AM
Posts: 10
Thanks: 121 in 3 Posts
Quote: Originally posted by qazxc
I can do the increased fat range as well, and same goes for fit range. This should be very compatible with the cas physique range by (evol_evolved?) So yeah. |
Is there any progress on this? I'm very curious to see this happen. Somewhat like that mod made by Consort in the sims 3.
#13
22nd Sep 2015 at 3:40 PM
Posts: 159
Thanks: 555 in 1 Posts
Quote: Originally posted by mrccl98
Is there any progress on this? I'm very curious to see this happen. Somewhat like that mod made by Consort in the sims 3. |
Yeah, me too! That would be awesome. Been waiting to find something like this but no luck so far, hopefully someday!
Cheers! =D
lkandak
Test Subject
#14
18th Jan 2016 at 4:30 AM
Posts: 4
Quote: Originally posted by fudgex02
I'm interested in making this mod apply to increased ranges to go with Evol_Evolved's extended slider mod, but I have zero coding experience. How difficult is this to adjust? Would it be worth my time to try to learn all the stuff necessary to attempt this, or would it be like a "You need months of training, stay away n00b" kind of situation? |
Yeah that would be awesome!!! :D
Test Subject
#15
19th Jan 2016 at 8:44 AM
Posts: 7
Thanks: 241 in 5 Posts
Physique Range Increaser - Just a test, many oddities!
First, let me say I am by no means an expert at this, and beyond modifying a few lines, my troubleshooting abilities are limited.Still, I can see use in developing such a script as what qazxc has painstakingly wrought into something to complement EVOL_EVOLVED's "Expanded Physique Range (Heavy, Lean, Fit, Bony)" mod.
I have below a zip package that you simply drop in your mods folder that will visibly increase the how big (Fit/Fat) or small (Lean/Bony) Sims can be without "snapping" back to default maximums and minimums. I set it to x1.5 or 50% over default on all categories.
Please be aware there are issues with this:
What I have noticed are when you save or otherwise travel with your Sim, NPC/townie physiques are baselined (reset?, English is not my first language) at their increased ranges and then increased again, meaning that even slightly fit/fat sims will grow to their maximums after a few travels/saves, and thin/bony sims will do the opposite and shrink. This applies to your played household as well: you can test this upon boot of the game by immediately saving. Neutrally balanced Sims will remain the same, while the big get bigger and small get smaller. Probably a deal breaker until fixed, just be aware there are known issues with this as it sits.
I have also noticed that NPCs will "snap back" to the range set in this mod if you save when entering a public lot. Most of them either become tiny or huge eventually. Even outside the range this script defines oddly.
I am guessing that this behavior can be combated by digging into how and where the new physique specified here:
Code:
physique[sims.sim_info.SimInfo.BodyBlendTypes.BODYBLENDTYPE_HEAVY] = str((newheavy*1.5)/physique_range) physique[sims.sim_info.SimInfo.BodyBlendTypes.BODYBLENDTYPE_LEAN] = str((newlean*1.5)/physique_range) physique[sims.sim_info.SimInfo.BodyBlendTypes.BODYBLENDTYPE_FIT] = str((newfit*1.5)/physique_range) physique[sims.sim_info.SimInfo.BodyBlendTypes.BODYBLENDTYPE_BONY] = str((newbony*1.5)/physique_range)
is equated to the actual fit/bony fat/lean set point the Sim is sitting at. In theory this script would just be a flat visible modification only. I'm looking into it currently, but as I've said, my skills are lacking.
The screenshots are to demonstrate the issues you will face using this script.
Step 1: Set Bob Pancakes to two notches above normal fitness and fatness. Set Eliza Pancakes to two notches below normal fitness and fatness.
Step 2: Immediately Save when out of CAS, notice changes?
Step 3: Restart game/travel etc. and immediately save. Notice changes?
Step 4: Restart game/travel etc. and immediately save. Notice changes?
Step 5: ""
Step 6: ""
Step 7: ""
Step 8: "" They are at their minimums and maximums now.
Attached files:
PhysiqueRangeIncrease50Percent.zip (3.1 KB, 677 downloads) - View custom content | ||
826 2014-09-10 13:55 injector.py 1545 2014-09-29 20:31 injector.pyo 2440 2016-01-19 02:00 PhysiqueRangeIncrease50Percent.py 2455 2016-01-19 02:02 PhysiqueRangeIncrease50Percent.pyo --------- ------- 7266 4 files |
||
Description: Please be Aware: Many Issues, please read post above! |
#16
22nd Jan 2016 at 1:46 AM
Posts: 159
Thanks: 555 in 1 Posts
Quote: Originally posted by df1112
First, let me say I am by no means an expert at this, and beyond modifying a few lines, my troubleshooting abilities are limited.... |
Whoa, this is awesome! I would definitely try this but I'm guessing from the issues listed it'd probably really mess with all my sims' weight/fitness levels. Are you looking for testers, or are you gonna be updating this mod to not have the saving/traveling issues? I wish I could advise something but I'm a noob at modding :3 Thanks so much for making it though, awesome work!
Cheers! =D
lkandak
Test Subject
#17
22nd Jan 2016 at 8:22 PM
Posts: 4
Oooh cool! Fantastic to see someone's working on something like this, really need it in my game!
#18
21st Feb 2016 at 10:36 PM
Posts: 159
Thanks: 555 in 1 Posts
Wondering if anyone's had any luck with something like this...
Cheers! =D
lkandak
Cheers! =D
lkandak
Test Subject
#19
8th Mar 2016 at 12:25 PM
Posts: 2
Quote: Originally posted by lkandak
Wondering if anyone's had any luck with something like this... |
I haven't worked on the fat slider at all but I did increase pretty much everything around it. Bigger Hips and Butt along with more natural breasts. Never could get the legs quite right, but I've given up on that small tweak.
I haven't messed with the fat slider yet, but know to change it using Bone Deltas it's Region 0x0000001C in the CNTX's, but I found with the increases I did to the hips and butt there's not much need for it for my game because they get pretty big anyways.
Attached files:
More Female Ranges.zip (1.3 KB, 917 downloads) - View custom content | ||||||||||||||||||
355 2016-03-08 06:39 Breasts.package 349 2016-03-08 06:59 Butt.package 354 2016-03-08 07:03 Hips.package --------- ------- 1058 3 files |
Test Subject
#20
22nd Mar 2016 at 3:54 AM
Posts: 7
Thanks: 241 in 5 Posts
New Updates
Quote: Originally posted by lkandak
Wondering if anyone's had any luck with something like this... |
Well I came back to this and I found another function in the extracted sim_info.pyo just above the _set_fit_fat(self) function named: "_get_fit_fat(self):"
It seems just multiplying back through the inversion of the multiple applied in _set_fit_fat(self) fixes the issues I saw before. So the game must call a _get_fit_fat(self), and receives a high (or low) number from the modified physique set in _set_fit_fat(self), then resets the physique at that higher (or lower) number. So including both functions and returning the correct values in _get_fit_fat(self) with the inversion multiple makes sense.
I've tested this a bit on with the latest expansion (Get Together), and it does seem to work without issue.
I would create a new game and test it out yourself or back up your existing game save(s) before you try it out.
I have included 25%, 50%, 75%, 100%, and 200% increase versions of "PhysiqueRangeIncrease," "FitnessRangeIncrease, and "FatnessRangeIncrease." "Physique" includes both Fitness and Fatness range increases, where "Fitness" and "Fatness" are increased alone.
200% is a bit ridiculous and not recommended. Somewhere between 50% and 75% seems to be about maximum for EA's mesh in both fitness and fatness before Sims look especially odd.
If this works for others, I might release it as a mod, and make separate versions for reducing the ranges too. It is pretty simple to change to any value you want. Next step is to at least use variables for the multiples in the code. Meh, it is all in beta for now.
Thank you to qzaxc for doing the bulk of the research, scumbumbo for his support, and Scripthoge for the injector!
Attached files:
PhysiqueRangeIncrease25Percent.zip (3.4 KB, 209 downloads) - View custom content | ||
826 2014-09-10 14:55 injector.py 1545 2014-09-29 21:31 injector.pyo 3477 2016-03-21 17:14 PhysiqueRangeIncrease25Percent.py 3665 2016-03-21 17:14 PhysiqueRangeIncrease25Percent.pyo --------- ------- 9513 4 files |
||
PhysiqueRangeIncrease50Percent.zip (3.4 KB, 364 downloads) - View custom content | ||
826 2014-09-10 14:55 injector.py 1545 2014-09-29 21:31 injector.pyo 3481 2016-03-21 17:18 PhysiqueRangeIncrease50Percent.py 3702 2016-03-21 17:18 PhysiqueRangeIncrease50Percent.pyo --------- ------- 9554 4 files |
||
PhysiqueRangeIncrease75Percent.zip (3.4 KB, 573 downloads) - View custom content | ||
826 2014-09-10 14:55 injector.py 1545 2014-09-29 21:31 injector.pyo 3497 2016-03-21 17:41 PhysiqueRangeIncrease75Percent.py 3701 2016-03-21 17:42 PhysiqueRangeIncrease75Percent.pyo --------- ------- 9569 4 files |
||
PhysiqueRangeIncrease100Percent.zip (3.4 KB, 560 downloads) - View custom content | ||
826 2014-09-10 14:55 injector.py 1545 2014-09-29 21:31 injector.pyo 3465 2016-03-21 17:41 PhysiqueRangeIncrease100Percent.py 3663 2016-03-21 17:42 PhysiqueRangeIncrease100Percent.pyo --------- ------- 9499 4 files |
||
PhysiqueRangeIncrease200Percent.zip (3.4 KB, 910 downloads) - View custom content | ||
826 2014-09-10 14:55 injector.py 1545 2014-09-29 21:31 injector.pyo 3473 2016-03-21 17:41 PhysiqueRangeIncrease200Percent.py 3700 2016-03-21 17:43 PhysiqueRangeIncrease200Percent.pyo --------- ------- 9544 4 files |
||
FitnessRangeIncrease25Percent.zip (3.4 KB, 130 downloads) - View custom content | ||
3459 2016-03-21 19:51 FitnessRangeIncrease25Percent.py 3642 2016-03-21 19:51 FitnessRangeIncrease25Percent.pyo 826 2014-09-10 14:55 injector.py 1545 2014-09-29 21:31 injector.pyo --------- ------- 9472 4 files |
||
FitnessRangeIncrease50Percent.zip (3.4 KB, 217 downloads) - View custom content | ||
3461 2016-03-21 19:53 FitnessRangeIncrease50Percent.py 3661 2016-03-21 19:53 FitnessRangeIncrease50Percent.pyo 826 2014-09-10 14:55 injector.py 1545 2014-09-29 21:31 injector.pyo --------- ------- 9493 4 files |
||
FitnessRangeIncrease75Percent.zip (3.4 KB, 327 downloads) - View custom content | ||
3469 2016-03-21 19:54 FitnessRangeIncrease75Percent.py 3660 2016-03-21 19:54 FitnessRangeIncrease75Percent.pyo 826 2014-09-10 14:55 injector.py 1545 2014-09-29 21:31 injector.pyo --------- ------- 9500 4 files |
||
FitnessRangeIncrease100Percent.zip (3.4 KB, 327 downloads) - View custom content | ||
3453 2016-03-21 19:56 FitnessRangeIncrease100Percent.py 3640 2016-03-21 19:56 FitnessRangeIncrease100Percent.pyo 826 2014-09-10 14:55 injector.py 1545 2014-09-29 21:31 injector.pyo --------- ------- 9464 4 files |
||
FitnessRangeIncrease200Percent.zip (3.4 KB, 486 downloads) - View custom content | ||
3457 2016-03-21 19:57 FitnessRangeIncrease200Percent.py 3659 2016-03-21 19:57 FitnessRangeIncrease200Percent.pyo 826 2014-09-10 14:55 injector.py 1545 2014-09-29 21:31 injector.pyo --------- ------- 9487 4 files |
||
FatnessRangeIncrease25Percent.zip (3.4 KB, 159 downloads) - View custom content | ||
3459 2016-03-21 19:43 FatnessRangeIncrease25Percent.py 3642 2016-03-21 19:43 FatnessRangeIncrease25Percent.pyo 826 2014-09-10 14:55 injector.py 1545 2014-09-29 21:31 injector.pyo --------- ------- 9472 4 files |
||
FatnessRangeIncrease50Percent.zip (3.4 KB, 302 downloads) - View custom content | ||
3461 2016-03-21 19:45 FatnessRangeIncrease50Percent.py 3661 2016-03-21 19:45 FatnessRangeIncrease50Percent.pyo 826 2014-09-10 14:55 injector.py 1545 2014-09-29 21:31 injector.pyo --------- ------- 9493 4 files |
||
FatnessRangeIncrease75Percent.zip (3.4 KB, 521 downloads) - View custom content | ||
3469 2016-03-21 19:46 FatnessRangeIncrease75Percent.py 3660 2016-03-21 19:46 FatnessRangeIncrease75Percent.pyo 826 2014-09-10 14:55 injector.py 1545 2014-09-29 21:31 injector.pyo --------- ------- 9500 4 files |
||
FatnessRangeIncrease100Percent.zip (3.4 KB, 504 downloads) - View custom content | ||
3453 2016-03-21 19:48 FatnessRangeIncrease100Percent.py 3640 2016-03-21 19:49 FatnessRangeIncrease100Percent.pyo 826 2014-09-10 14:55 injector.py 1545 2014-09-29 21:31 injector.pyo --------- ------- 9464 4 files |
||
FatnessRangeIncrease200Percent.zip (3.4 KB, 1111 downloads) - View custom content | ||
3457 2016-03-21 19:50 FatnessRangeIncrease200Percent.py 3659 2016-03-21 19:50 FatnessRangeIncrease200Percent.pyo 826 2014-09-10 14:55 injector.py 1545 2014-09-29 21:31 injector.pyo --------- ------- 9487 4 files |
#21
23rd Mar 2016 at 2:42 AM
Posts: 159
Thanks: 555 in 1 Posts
Quote: Originally posted by df1112
Well I came back to this and I found another function in the extracted sim_info.pyo just above the _set_fit_fat(self) function named: "_get_fit_fat(self):"... |
Thank you both! Will test this and see how it goes!
Cheers! =D
lkandak
Test Subject
#22
1st Oct 2016 at 9:35 PM
Posts: 4
Has anyone had any luck testing the mod above? And would it be compatible with the current patch/EP too?
Test Subject
#23
11th Dec 2016 at 7:41 AM
Posts: 2
The mod doesn't show up in the mods/script box that pops up when you start the game.
Test Subject
#24
8th Jan 2017 at 10:28 AM
Posts: 2
Quote: Originally posted by lekiscool
The mod doesn't show up in the mods/script box that pops up when you start the game. |
For me it did, you have to put the zipped folder in your mod folder and then it should work, given that you have script mods enabled.
Test Subject
#25
8th Jan 2017 at 10:30 AM
Posts: 2
Quote: Originally posted by TheGreenMachine
Has anyone had any luck testing the mod above? And would it be compatible with the current patch/EP too? |
I found some issues with the monster under the bed. When I had the mod enabled, the monster appeared and didn't go away even if I had the special light that should prevent the monster from appearing in the first place. You couldn't see it, but it was there since the child sim couldn't go to bed anymore.
Who Posted
|