Wondering if it's possible to create new "ev" values (referred to in the custom content guide as: “ev” an enum value)
An example I pulled at random out of the tag file is:
<T ev="67">Theme</T>
I can't figure out what naming conventions one would follow in adding a custom value to avoid conflicts with Maxis naming, or if it's something that's supported in modding.
Mods moved from MTS, now hosted at:
https://triplis.github.io
Comments
An enum is just a named number so as long as the number and the name of it are unique there won't be any conflicts. You can just add anything to it as long as it's unique. The number being much higher than the rest of the existing values is the best way to avoid conflicts.
Following the example:
[code]<T ev="1000123">MyNewTag</T>[/code]
1000123 is really high so there is a low chance of a conflict but it doesn't have to be that big. Unless tags are saved somewhere it doesn't matter what their number is because they are just used as identification with their name instead of the number. Both still have to be kept unique.
Still, what's the purpose of this? For example, overriding the tags file will cause a lot of issues when something will be missing because of future updates and most of the tuning tests can be done with raw instance ids of objects rather than referring to them with tags.
If you're looking into extending tags for CAS then it might not be possible since outfit generation is not fully done on the scripting side which the tags tuning file is used on.
Extending enums with scripts is a pretty safe way of doing it because you can automatically avoid conflicts but it's pretty pointless because enums are just numbers so you can use raw digits.
I may be able to help more if you can explain the reason behind your interest in enums.
It was something like this: http://i.imgur.com/5ezaLph.png
There's a couple reasons why I was looking into this (both related to my Sorcerer mod):
One is, I wanted to use the Notebook. Adding my own kind of entries for usability, such that you can see what spells you have by name in the notebook, with a description of how it works. That kind of thing. So I was running into an issue where if I added to the notebook tuning file, I needed an "ev" value at some point in there for the new notebook categories and subcategories. Even with a made-up high number (I tried last night after reading your post), I'm getting an error like this:
So I'm not sure what I'm flubbing up with the notebook tuning, but anyway, that's one way in which I was wanting to use "ev" values.
The other is part of a black hole of unknowns and probably a pipe dream, from the exploration I've done into it. As an alternative method for usability, I wanted to use a version of the Vampire Powers UI (where you press the button and brings up your powers) for Sorcerer, so people can just click a button and see what Spells they have and how they work. That sort of thing.
So in that black hole process, there are files like TagOccultTypeMapping and here's some code from it: The last one is something I added.
And there are files like "sims.occult.occult_tracker" - here's its entry for Vampires:
So at first, I was thinking, maybe if I make a new occult type in such files, I can get the menu to appear, customize it in my own way. Well that has so far been a colossal no-go. I was looking into tagging for it because I noticed that the main "Tag" file has the tag "Occult_Vampire" in it, so I figured maybe that's important somehow to the overall process of adding something new under TagOccultTypeMapping and sims.occult.occult_tracker.
I also discovered, through the use of JPEXS, and opening a bunch of GFX files until I found the right one, that pretty much everything to do with the special Vampire UI is tied to at least one "Occult_Vampire" check; meaning, it won't trigger unless the sim has that tag, I presume.
So I tried making the entry in TagOccultTypeMapping be: Just to see if I could get the UI to appear. Still no-go.
I also tried editing the GFX file, which uses "case" code, changing the following:
Adding in another case:
But I don't think JPEXS can edit stuff without errors; it gave me a warning about possible errors when I went to edit and upon opening the edited part of the file today to explain what I'm doing, I noticed a big chunk of code straight up missing in that part.
So if I can figure out a reliable way to edit that part of the code without catastrophic errors, adding a case like OCCULT_SORCERER might work. Might not even need to add a Tag to the master list (that was just a guess as to something that needs to happen, but I'm not sure if it's strictly necessary).
Oh and yeah, there are posting restrictions on new accounts. I think it's once you get enough "points" from posting or receiving things like thanks/insightful/etc., the restrictions go away.
So you're trying to refer to the 'Pack' enum? From what I can see in the code it's pretty restrictive with its content. Most of the existing enums don't seem to be like that. But nevermind, that doesn't seem to be your issue.
About editing the TagOccultTypeMapping file.
I am not sure if the 'TagOccultTypeMapping' is used for anything. It's just sort of there and it already refers to existing occults with the tag 'OccultType' so that's not the place to add them. I don't think it's even possible to add occults since they are hard-coded to the client. Occult names are only used in CAS parts and any in-game tests for occults are done with traits. I don't think you can add a new occult to the game.
Your use of JPEXS is really cool and I have no idea what is this, but this proofs that it's a client only check with 'OccultTypes' (which is not present in the scripting). I don't see a way you would fool the client to use a new occult.
I can only assume that there is an internal client enum for all of the occults and there is no way for you to edit it. Your custom menu might not be possible without tricking the game to think sorcerers are vampires. Sorcerers & Vampires.. sounds like a game.
So far I have not seen anybody do custom interfaces, this looks really interesting, I have to investigate this JPEXS thing, thanks for showing that!
Good Luck with figuring some other way to do this! :smile:
Oh, haha, I didn't realize the occult types are hard-coded to the client. Never would have guessed that. Thanks for sharing your knowledge about things! I appreciate it.
And yeah, I got the idea of using JPEXS from Neia related to another idea I had. If you're curious about checking out GFX files with JPEXS, I do have a few IDs written down, from looking through them (the only other method I know for looking through is opening them all, one at a time, trying to find what you're looking for... I'm guessing that GFX files can't be manually set as a file that should be indexed for searches like .py files, so I haven't even tried).
One of the ones I've written down is the one that has a bunch of Vampire-related UI references in it, like the special ui_render_style and the components for the Vampire Powers/Weaknesses UI that I was trying to access. Its ID is: S4_62ECC59A_00000000_093958A845E285BA
Then there's: S4_62ECC59A_00000000_5FFB8AE26BC11E96 (which has a lot of references to the Motives UI)
And then: S4_62ECC59A_00000000_63DDA367DE3564AB (which, if I recall correctly, has a lot of the Clubs UI in it)
I don't know if making custom UI changes or additions is feasible with modding, but I figure I might as well share the little I do know; make it a bit easier for those who might be curious, like yourself.
And yeah, you bet. Happy to show what I know.
I did think of an alternative approach last night, for showing people information about spells beyond temporary notifications. Haven't had time to test it yet, but we'll see how this one pans out. I'm hopeful about it.
Brought up the Vampire UI. But, uh... it's empty... lol. And the purple bar on the side just continuously fills up to the top and then starts over.
This shows:
- Don't strictly speaking need access to the normal UI button to open the Powers Panel.
- Need just about everything else probably, so it's probably a crapshoot anyway to use the Vamp UI for anything.
Don't take my word for it but I am pretty sure occults are hard-coded. I think there was a topic here somewhere in which SimGuruModSquad confirms that. And where they didn't have to, they hard-coded it to easily detect Sims with different interface buttons and needs to display them quick.
I can only add that there is no way to manipulate the vampire powers interface via scripts either. If that is an option you were considering.
With scripts, you can only display (and customize) notifications, recipes menu, careers menu, outfits menu, purchase menu, some lot menu, some club menu, a generic list and some semi-custom input field dialog with text inputs and buttons. Maybe something else that I am missing, but not much of specific things like a vampire powers menu.
There are some bugs with few of these interfaces that I might be able to figure out by using JPEXS. I will have to check it out.
I hope you figure out some way to display the spells. :)
@Triplis:
Hardcoded to the client, yes. However, the occult type enums are assigned their own values there as well:
That's from the "shared" section of siminfosummarypanel.gfx.
I'm guessing that if you do something like this: everywhere that references what you're trying to do, you might be able to get your new enum to work
EDIT: And JPEXS does work for this kind of stuff; I used it for my "Vampire Aging Enabled - With Life Extension", in which I removed the OCCULT_VAMPIRE check from where it decides which aging format to use
GFX instance DA7597EAEB9BA388: I removed the "|| _loc4_" check without issue. You have to click "save changes" on the actionscript, THEN you have to save the actual GFX file.
If it says "Cannot save file" then yeah, your function will get deleted. Try "Save As".
Why do that, when you can do this? The case instances fall through by default; that's why the "break" statements exist.
As for the switch statement, to be honest, I've never seen a switch statement done like that. Is there documentation somewhere you could link me to on that practice?
I found this in trait.IsValidForDisplay: I think this might be applicable:
http://en.cppreference.com/w/cpp/language/switch
...as for saving the file, I made that OCCULT_SORCERER addition and reloaded it several times. It seems to be holding.
One huge difference between the GFX files and the examples in the documentation is that I don't think TS4 gfx files use the std namespace. But the principle is the same.
I just noticed that the GFX says "edit actionscript" meaning that's the language. But the code above was not modified before it was pasted, which confirms that sort of thing does work.
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/statements.html#switch
I think I know what the problem with that bar is.
The bar is set to reference the value of a statistic (The vampire XP stat), but your Sorcerers do not have that stat IIRC. So it doesn't know what to set the bar to.
Also, to add your occult to sims.occult_tracker tuning, you'd need to add your occult here:
Oh, also, I don't know what we're doing differently. I've tried saving the file multiple times in multiple ways. It always appears to save the changes fine and then when I reload it, that function is empty.
Interesting, good to know!
Right now, I've kind of set aside the attempts to add an "official" occult type while I focus on other things, but if I get back to it at some point, this should be valuable insight.
^click that save button THEN
^message box says 'code successfully saved'. Close it out. THEN
^Click the button up top to save the GFX file