- Site Map >
- Modding and Creation >
- Sims 4 Creation >
- Modding Discussion >
- Help with XMLs and Vampire Age?
- Site Map >
- Modding and Creation >
- Sims 4 Creation >
- Modding Discussion >
- Help with XMLs and Vampire Age?
Posts: 116
Thanks: 731 in 24 Posts
I had the idea of creating another aging tuning XML, which has the line: "<E n="OccultType">VAMPIRE</E>". Would this work to make a custom aging tuner for Vampires? If so, where in the new aging tuning file would I put this line, and how do I create a NEW xml, that doesn't technically override anything? Any help is appreciated, I'm sure most of the modders here are more capable than I am but I would rather be self sufficient than moan about how the mod I want doesn't exist.
Posts: 57
I had the idea of creating another aging tuning XML, which has the line: "<E n="OccultType">VAMPIRE</E>". Would this work to make a custom aging tuner for Vampires? If so, where in the new aging tuning file would I put this line, and how do I create a NEW xml, that doesn't technically override anything? |
Have you tried including the Occult line in the original Age XML file? That might be the simplest option, though it would most likely conflict with just about any mod that edits aging (including MCCommand). I would assume that by creating an XML file and adding it to your Mods folder you would, potentially, add the interaction to the game, especially if it called upon other in-game interactions, but that might be my Optimistic Thinking interfering again.... I would also assume that by calling the Occult Type in the beginning that the code would then apply to that occult type without issue. So:
<E n="OccultType">VAMPIRE</E>
<E n="Age">ADULT</E>
.
.
.
.
You'd also want to call the Aging Script that is included in most of the aging files but I can't decide if that's better before the Vampire line or after it - possibly before it (and I don't know the aging call script off the top of my head, you'd have to look that up in the XML files, sorry). Honestly, you'll most likely be copying and modifying most of those files anyway. Do vampires have an aging XML script that's already separate? If so you'd just be modifying that file instead of having to make your own. Easiest way to know without searching the code itself is to open up the Vampire aging mod you mentioned and seeing what is edited and how.
The UI is incredibly painful to edit most of the time so it's possible with that other mod the creator didn't know how to make the UI read the age days so it stayed blank even though the sim is/was aging (and this could be a known issue for creating aging mods for occult types and therefore no one actually knows how to fix it yet).
Does the Succubus Occult Mod here on MTS change aging days? If so, that might be a mod to check out for help/inspiration. And, there are lot of Need Change mods that edit the UI directly. They might help you figure out how to add aging days to the UI of aging vampires.
You probably already know this, but.... Don't forget your ages! (Just take out the ones you don't want to use):
<E n="Age">INFANT</E>
<E n="Age">TODDLER</E>
<E n="Age">CHILD</E>
<E n="Age">TEEN</E>
<E n="Age:">YOUNGADULT</E>
<E n="Age">ADULT</E>
<E n="Age">ELDER</E>
This is all assuming that your Vampire code line will work and the only way to really know for sure is to try it. I hope most of this was helpful, even if I couldn't solve all your problems...
Posts: 116
Thanks: 731 in 24 Posts
Have you tried including the Occult line in the original Age XML file? That might be the simplest option, though it would most likely conflict with just about any mod that edits aging (including MCCommand). I would assume that by creating an XML file and adding it to your Mods folder you would, potentially, add the interaction to the game, especially if it called upon other in-game interactions, but that might be my Optimistic Thinking interfering again.... I would also assume that by calling the Occult Type in the beginning that the code would then apply to that occult type without issue. So:
<E n="OccultType">VAMPIRE</E> <E n="Age">ADULT</E> . . . . You'd also want to call the Aging Script that is included in most of the aging files but I can't decide if that's better before the Vampire line or after it - possibly before it (and I don't know the aging call script off the top of my head, you'd have to look that up in the XML files, sorry). Honestly, you'll most likely be copying and modifying most of those files anyway. Do vampires have an aging XML script that's already separate? If so you'd just be modifying that file instead of having to make your own. Easiest way to know without searching the code itself is to open up the Vampire aging mod you mentioned and seeing what is edited and how. The UI is incredibly painful to edit most of the time so it's possible with that other mod the creator didn't know how to make the UI read the age days so it stayed blank even though the sim is/was aging (and this could be a known issue for creating aging mods for occult types and therefore no one actually knows how to fix it yet). Does the Succubus Occult Mod here on MTS change aging days? If so, that might be a mod to check out for help/inspiration. And, there are lot of Need Change mods that edit the UI directly. They might help you figure out how to add aging days to the UI of aging vampires. You probably already know this, but.... Don't forget your ages! (Just take out the ones you don't want to use): <E n="Age">INFANT</E> <E n="Age">TODDLER</E> <E n="Age">CHILD</E> <E n="Age">TEEN</E> <E n="Age:">YOUNGADULT</E> <E n="Age">ADULT</E> <E n="Age">ELDER</E> This is all assuming that your Vampire code line will work and the only way to really know for sure is to try it. I hope most of this was helpful, even if I couldn't solve all your problems... |
Thanks for your reply, this worked! I copied the aging info in the aging_tuning xml and pasted it below the last age (young adult), then added the vampire line above each of the new ages. Set young adult to 1 day to test, and my vampire was aging up a day later! The UI still says "Days Lived" instead of how long they have to age up, but this is probably hard coded for vampires. In any case, thanks for your help!
Posts: 1,500
Thanks: 4283 in 41 Posts
http://modthesims.info/download.php?t=518248
There's also this mod
http://modthesims.info/download.php?t=541800
If you study how these mods work you'll figure it out how to do it for yourself.
Hope I helped. Happy Simming
Posts: 53
Thanks: 300 in 12 Posts
Thanks for your reply, this worked! I copied the aging info in the aging_tuning xml and pasted it below the last age (young adult), then added the vampire line above each of the new ages. Set young adult to 1 day to test, and my vampire was aging up a day later! The UI still says "Days Lived" instead of how long they have to age up, but this is probably hard coded for vampires. In any case, thanks for your help! |
The "days till age up" is actually defined in the GFX files; specifically 'siminfosummarypanel.gfx'. FYI
Posts: 116
Thanks: 731 in 24 Posts
Posts: 1,500
Thanks: 4283 in 41 Posts
Hmm, seems I got a bit ahead of myself. What I did ended up changing the age settings for all Sims, not just vampires. Back to square one, I guess. @skydome Thanks for the links, I'll look into those. Not sure how closely TS3 relates to TS4 though... |
Oh I'm so sorry i thought I was in the Sims 3 modding discussion. :facepalm
Still I hope it helps you and that you figure it out.
Posts: 57
Hmm, seems I got a bit ahead of myself. What I did ended up changing the age settings for all Sims, not just vampires. Back to square one, I guess. |
Have you tried modifying the occult aging for all sim ages? So, under each age include code that references that Vampires have such long lifespans? Also, have you searched for an actual vampire aging XML? I'm positive that there's a file that directly forces the game to make vampires have such ling lifespans and if that file exists, you can modify it to indicate that vampires age "normally" or change the initial duration.
Posts: 116
Thanks: 731 in 24 Posts
Have you tried modifying the occult aging for all sim ages? So, under each age include code that references that Vampires have such long lifespans? Also, have you searched for an actual vampire aging XML? I'm positive that there's a file that directly forces the game to make vampires have such ling lifespans and if that file exists, you can modify it to indicate that vampires age "normally" or change the initial duration. |
I'm not sure what you mean by the occult aging file, as far as I've found there isn't such a thing. I've searched every file flagged with the word vampire though, and there's definitely no aging.Tuning file. The only one that mentions ages in a vampire file is this one:
Which has this as its code;
<L n="ages">
<E>TEEN</E>
<E>ADULT</E>
<E>BABY</E>
<E>CHILD</E>
<E>TODDLER</E>
<E>ELDER</E>
<E>YOUNGADULT</E>
</L>
<L n="buffs">
<U>
<T n="buff_type">154179<!--buff_Vampire_Hidden_FavorVampireSocials--></T>
</U>
</L>
<T n="buffs_add_on_spawn_only">False</T>
<V n="disable_aging" t="disabled">
<U n="enabled">
<L n="allowed_ages">
<E>BABY</E>
<E>TEEN</E>
<E>CHILD</E>
<E>TODDLER</E>
</L>
</U>
</V>
<T n="display_name">0xBFCEA8AF<!--Vampire--></T>
<T n="display_name_gender_neutral">0xAA29BB2D<!--Vampire--></T>
<T p="InGP04\UI\Icons\Clubs\Rules\clubs_rules_Vampire.png" n="icon">2f7d0004:00000000:bfa6b19a7785731b</T>
<U n="trait_asm_overrides">
<T n="trait_asm_param">isBecomingVampire</T>
</U>
<E n="trait_type">HIDDEN</E>
</I>
I think the issue is that Vampires don't have an age or lifespan, they're coded to just never age up at all.
Posts: 57
You mentioned another Vampire Aging Mod somewhere. Have you opened it up in S4PE and a text editor to see what files it modifies for reference? That may give you some clues as to what file to look for.
I'm honestly just attempting to take you through some troubleshooting steps before sending you off in an opposite direction (I'm a queen at troubleshooting and spend most of my coding time doing so anyway because that's why I LOVE coding as much as I do). I also haven't looked directly at the code since somewhere around the Toddler/Vampire patches so I'm a little out of the know-how with what works and what doesn't and what has been added in and where. But the game code hasn't changed since then, so most of what I'm saying will take you in the right direction.
Posts: 53
Thanks: 300 in 12 Posts
<V n="disable_aging" t="enabled"> <U n="enabled"> <L n="allowed_ages"> <E>BABY</E> <E>TEEN</E> <E>CHILD</E> <E>TODDLER</E> </L> </U> </V>
Also:
But the game code hasn't changed since then, so most of what I'm saying will take you in the right direction. |
...there HAS been some syntax changes under the hood: "disable_aging" for one is a new thing.
Posts: 57
Vampires cannot age past YA. Also: ...there HAS been some syntax changes under the hood: "disable_aging" for one is a new thing. |
Thank you for letting me know about this! Is there a way to add in a line of code to indicate that vampires WILL/CAN age past YA, or is it strictly coded so that that is an impossibility? (Such as adding a line about "Adult Sims" in that file you mentioned?)
Posts: 53
Thanks: 300 in 12 Posts
var _loc5_:Boolean = GameplayStateData.SimOccultType.Type == OccultTypes.OCCULT_VAMPIRE && SimAgeTypes.IsYoungAdultOrOlder(param1.age); this.mcNextAgeImage.visible = !(SimAgeTypes.IsElder(param1.age) || _loc5_);
and
var _loc3_:uint = GameplayStateData.SimAge.age; var _loc4_:Boolean = GameplayStateData.SimOccultType.Type == OccultTypes.OCCULT_VAMPIRE && SimAgeTypes.IsYoungAdultOrOlder(_loc3_); if(SimAgeTypes.IsElder(_loc3_) || _loc4_) { _loc2_ = KeysGP.SUMMARY_PANEL_DAYS_LIVED.Clone([param1.days_alive]); } else { _loc2_ = KeysGP.SUMMARY_PANEL_DAYS_LEFT.Clone([param1.ready_to_age_day - param1.current_day]); }
and get rid of the references to OCCULT_VAMPIRE if you want vampire aging to show up right.
EDIT: I think the file is 62ECC59A_00000000_DA7597EAEB9BA388.gfx; I'm not sure though. I only tried modifying GFX files once, and that ended up glitching my game >.>
...maybe try this?
var _loc5_:Boolean = GameplayStateData.SimOccultType.Type == OccultTypes.OCCULT_VAMPIRE && SimAgeTypes.IsYoungAdultOrOlder(param1.age); this.mcNextAgeImage.visible = !(SimAgeTypes.IsElder(param1.age));
var _loc3_:uint = GameplayStateData.SimAge.age; var _loc4_:Boolean = GameplayStateData.SimOccultType.Type == OccultTypes.OCCULT_VAMPIRE && SimAgeTypes.IsYoungAdultOrOlder(_loc3_); if(SimAgeTypes.IsElder(_loc3_)) { _loc2_ = KeysGP.SUMMARY_PANEL_DAYS_LIVED.Clone([param1.days_alive]); } else { _loc2_ = KeysGP.SUMMARY_PANEL_DAYS_LEFT.Clone([param1.ready_to_age_day - param1.current_day]); }
Posts: 53
Thanks: 300 in 12 Posts
I've got a package file ready now
Posts: 116
Thanks: 731 in 24 Posts
Have you tried searching for "occult" instead of "vampire"? I know you'll end up with PlantSim and Alien files, too, but you might get some new Vampire files as well? You mentioned another Vampire Aging Mod somewhere. Have you opened it up in S4PE and a text editor to see what files it modifies for reference? That may give you some clues as to what file to look for. |
I have looked through under the "occult" search, but didn't get through everything before my brain became mush. I can check again, though. The other vampire aging mod edits the same file I referenced earlier--if you look at it, you'll see the line that disables aging for Vampires. That mod (and MCCC) work by changing that line from "enabled" to "disabled".
Vampires cannot age past YA: |
Ok, I'm not sure I understand your interpretation of the code. I know that in game, your Vampire Sim will only naturally age past baby, toddler, and child. Vampires who become teenagers are then immortal and get their vampire needs/powers. If you want them to become young adults, you have to use a cake to age them up. In the same way, you can use the cake to age up a young adult vampire into an adult, or create a vampire in CAS who is an adult.
Posts: 116
Thanks: 731 in 24 Posts
Update: I got it. I've got a package file ready now |
Can you set custom ages for the vampires, though? So they live 2x longer than normal Sims or something like that?
Posts: 53
Thanks: 300 in 12 Posts
I have looked through under the "occult" search, but didn't get through everything before my brain became mush. I can check again, though. The other vampire aging mod edits the same file I referenced earlier--if you look at it, you'll see the line that disables aging for Vampires. That mod (and MCCC) work by changing that line from "enabled" to "disabled". Ok, I'm not sure I understand your interpretation of the code. I know that in game, your Vampire Sim will only naturally age past baby, toddler, and child. Vampires who become teenagers are then immortal and get their vampire needs/powers. If you want them to become young adults, you have to use a cake to age them up. In the same way, you can use the cake to age up a young adult vampire into an adult, or create a vampire in CAS who is an adult. |
Ok. I actually looked at the tuning script-side as well: allowed_ages lists the ages they can age out of. CAS can be used to create a vampire of any age, but anyone YA and above will not be able to age up, even with a birthday cake. Yes, they manifest as teens, but they can still age to young adult. Then they stop aging. There's no actual occult reference yet, though I suspect there will be once more occult types get patched in. That, or some kind of 'aging_speed_multiplier' mapping that would probably be a lot more flexible for that purpose (And wouldn't be impossible to script in). Actually, the mod you referenced does not remove the disable_aging block: it just adds the rest of the age groups:
<V n="disable_aging" t="enabled"> <U n="enabled"> <L n="allowed_ages"> <E>TEEN</E> <E>ADULT</E> <E>BABY</E> <E>CHILD</E> <E>TODDLER</E> <E>ELDER</E> <E>YOUNGADULT</E> </L> </U> </V>
Posts: 53
Thanks: 300 in 12 Posts
Can you set custom ages for the vampires, though? So they live 2x longer than normal Sims or something like that? |
Perhaps, though it won't go as smoothly as you might think. You'd basically do it by pulling up sims.aging.aging_tuning.xml and adding this:
<L n="BONUS_TRAIT_DAYS"> <U> <T n="percent_days_award">0.25</T> <T n="tuned_trait">27081<!--Trait: trait_Longevity--></T> </U> <U> <T n="percent_days_award">0.1</T> <T n="tuned_trait">27419<!--Trait: trait_active--></T> </U> <U> <T n="percent_days_award">(some high number)</T> <T n="tuned_trait">149527<!--Trait: trait_OccultVampire--></T> </U> </L>
For the past couple days, though, I've been wanting to see if I could implement an 'aging_speed_multiplier' mapping that would help this go more fluidly.
Posts: 116
Thanks: 731 in 24 Posts
Ok. I actually looked at the tuning script-side as well: allowed_ages lists the ages they can age out of. CAS can be used to create a vampire of any age, but anyone YA and above will not be able to age up, even with a birthday cake. Yes, they manifest as teens, but they can still age to young adult. Then they stop aging. There's no actual occult reference yet, though I suspect there will be once more occult types get patched in. That, or some kind of 'aging_speed_multiplier' mapping that would probably be a lot more flexible for that purpose (And wouldn't be impossible to script in). Actually, the mod you referenced does not remove the disable_aging block: it just adds the rest of the age groups |
Ah ok I didn't know it added the other age groups, just knew it changed "enabled" to "disabled" on the "disable_aging" line (not remove it). I've never actually figured out how to open up someone else's mod and see what changes they made to the xml files.
Edit: I looked at bonus days once upon a time, and the issue with them is that they just tack those days on at the elder stage. I don't know about you, but I want my vampires forever young--not forever old and cranky
Posts: 53
Thanks: 300 in 12 Posts
Posts: 53
Thanks: 300 in 12 Posts
I've never actually figured out how to open up someone else's mod and see what changes they made to the xml files. |
You can do this if you have S4PE
Posts: 116
Thanks: 731 in 24 Posts
That's what I was saying about it not going so smoothly. |
What if we used bonus days, but made (or kept) it so that they couldn't age further than adult? They just die of old age once their bonus days as an adult are up. Is that possible?
Posts: 53
Thanks: 300 in 12 Posts
def advance_age_phase(self): if self.age == Age.ELDER: bonus_days = self._get_bonus_days() else: bonus_days = 0 age_time = AgeTransitions.get_duration(self.age) warn_time = age_time - AgeTransitions.get_warning(self.age) auto_age_time = age_time + AgeTransitions.get_delay(self.age) + bonus_days age_progress = self._age_progress.get_value() if age_progress <= warn_time: age_progress = warn_time elif age_progress <= age_time: age_progress = age_time else: age_progress = auto_age_time self._age_progress.set_value(age_progress - 0.0001) self.update_age_callbacks()
Though I guess you could do
if self.age == Age.ELDER or (self.age == Age.ADULT and self.occult_type <or whatever the function is> == OccultType.VAMPIRE) bonus_days = self._get_bonus_days
Posts: 53
Thanks: 300 in 12 Posts
Posts: 116
Thanks: 731 in 24 Posts
No. Well, depends. Can you script mod? |
Hah, I can barely edit XML's correctly. And if we're going to script mod it then we might as well just script them to have custom age lengths. But I mean, there's no line of code that sets the occult_vampire trait as a requirement? My original idea was to take that requirement line of code and create a second aging.tuning xml that only affects vampires. Use that in addition to enabling aging in the first place, and now your tweaks to make the age bar actually show how long they have, and that's what I had in mind for a complete project.
Who Posted
|