Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Lab Assistant
Original Poster
#1 Old 11th May 2017 at 5:41 PM
Default Help with XMLs and Vampire Age?
Hi! I've done a bit of tweaking to XMLs before, and was hoping to create a mod that not only allows Vampires to age, but makes their age length different from regular Sims. I don't know how to do programming/scripting, so if that's what it's going to take for this mod then I'll just have to wait for someone else to do it. I'm already aware of this mod, which enables aging for Vampires. However, it doesn't display how many days they have until aging up, and their lifespan will be the same as a human Sim.

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.
Advertisement
Test Subject
#2 Old 17th May 2017 at 9:10 PM
Quote: Originally posted by SnowieSimmer
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...
Lab Assistant
Original Poster
#3 Old 18th May 2017 at 5:49 PM
Quote: Originally posted by bamrd

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!
Scholar
#4 Old 18th May 2017 at 7:06 PM
In case you were still having problems this mod works with age of Vampires so check it out maybe
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
Test Subject
#5 Old 19th May 2017 at 2:03 AM
Quote: Originally posted by SnowieSimmer
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
Lab Assistant
Original Poster
#6 Old 19th May 2017 at 3:14 AM
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...
Scholar
#7 Old 20th May 2017 at 1:50 PM
Quote: Originally posted by SnowieSimmer
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.
Test Subject
#8 Old 21st May 2017 at 2:23 AM
Quote: Originally posted by SnowieSimmer
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.
Lab Assistant
Original Poster
#9 Old 21st May 2017 at 6:38 PM
Quote: Originally posted by bamrd
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;


I think the issue is that Vampires don't have an age or lifespan, they're coded to just never age up at all.
Test Subject
#10 Old 21st May 2017 at 7:12 PM
My bad. I assumed there had to be a file *somewhere* (most likely in XML) that tunes the vampire aging (or tells the game that they don't age the same as non-vampires). I wouldn't know where it is or what it's under (and as you said, the game *might* be hard coded to disallow vampire aging) but *somewhere* it is mentioned in at least one line of code that vampires age/don't age like they do (and I just assumed it had to be in XML). Sometimes when searching files (at least on my computer) my computer doesn't register certain things as able to be listed under certain keywords (as an example: I can't search "aging" to get the updated aging file for toddlers - then again, I'm just now realizing I didn't update my XML files for the Toddler patch so make sure you have XML files updated for the Vampire patch). 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'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.
Test Subject
#11 Old 21st May 2017 at 8:58 PM
Vampires cannot age past YA:
Code:
  <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:
Quote: Originally posted by bamrd
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.
Test Subject
#12 Old 22nd May 2017 at 2:33 AM
Quote: Originally posted by Hadron1776
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?)
Test Subject
#13 Old 22nd May 2017 at 3:24 AM Last edited by Hadron1776 : 22nd May 2017 at 3:35 AM.
It's not strictly coded - just remove the 'disable_aging' block. Although you'll need to pull up siminfosummarypanel.gfx because of these:
Code:
         var _loc5_:Boolean = GameplayStateData.SimOccultType.Type == OccultTypes.OCCULT_VAMPIRE && SimAgeTypes.IsYoungAdultOrOlder(param1.age);
         this.mcNextAgeImage.visible = !(SimAgeTypes.IsElder(param1.age) || _loc5_);

and
Code:
         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?
Code:
         var _loc5_:Boolean = GameplayStateData.SimOccultType.Type == OccultTypes.OCCULT_VAMPIRE && SimAgeTypes.IsYoungAdultOrOlder(param1.age);
         this.mcNextAgeImage.visible = !(SimAgeTypes.IsElder(param1.age));

Code:
         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]);
         }
Test Subject
#14 Old 22nd May 2017 at 3:48 AM
Update: I got it.

I've got a package file ready now
Lab Assistant
Original Poster
#15 Old 22nd May 2017 at 4:10 AM
Quote: Originally posted by bamrd
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".

Quote: Originally posted by Hadron1776
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.
Lab Assistant
Original Poster
#16 Old 22nd May 2017 at 4:16 AM
Quote: Originally posted by Hadron1776
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?
Test Subject
#17 Old 22nd May 2017 at 4:33 AM
Quote: Originally posted by SnowieSimmer
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:
Code:
  <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>
Test Subject
#18 Old 22nd May 2017 at 4:38 AM
Quote: Originally posted by SnowieSimmer
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:
Code:
    <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.
Lab Assistant
Original Poster
#19 Old 22nd May 2017 at 4:43 AM
Quote: Originally posted by Hadron1776
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
Test Subject
#20 Old 22nd May 2017 at 4:46 AM
That's what I was saying about it not going so smoothly.
Test Subject
#21 Old 22nd May 2017 at 4:48 AM
Quote: Originally posted by SnowieSimmer
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
Lab Assistant
Original Poster
#22 Old 22nd May 2017 at 4:55 AM
Quote: Originally posted by Hadron1776
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?
Test Subject
#23 Old 22nd May 2017 at 5:08 AM
No. Well, depends. Can you script mod? Here's the relevant function:
Code:
    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
Code:
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
Test Subject
#24 Old 22nd May 2017 at 5:12 AM
Now that I think about it, you could test for an arbitrary trait in that function (in this case, it would be 149527) (remember, it needs to be <trait_name>.guid64)
Lab Assistant
Original Poster
#25 Old 22nd May 2017 at 5:12 AM
Quote: Originally posted by Hadron1776
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.
Page 1 of 2
Back to top