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!
Field Researcher
Original Poster
#1 Old 4th Sep 2014 at 3:00 PM Last edited by fer456 : 27th Sep 2014 at 1:34 PM.
Core mod problem!
I reuse a older post I have. So, it has post below this.

I want to replace the value under Sim.WalkStyles.VampireRun. The value I see in Reflector is 27, but in IL, I see 0x0000001B. Extract of codes:

C#:
Code:
public const Sim.WalkStyle VampireRun = 27;


IL:
Code:
    .field public static literal valuetype Sims3.Gameplay.Actors.Sim/WalkStyle VampireRun = int32(0x0000001B)


I want to know how to hash numbers to int32 to put the hash number into the IL code and recompile. Anyone can help me?
Advertisement
Instructor
#2 Old 7th Sep 2014 at 11:37 AM
I believe it is a very core part, that it shouldn't be touched, I think. You are trying to replace a part of the very basic "Sim"...
Field Researcher
Original Poster
#3 Old 7th Sep 2014 at 3:59 PM
Quote: Originally posted by SimsMatthew
I believe it is a very core part, that it shouldn't be touched, I think. You are trying to replace a part of the very basic "Sim"...


I will see the core nod can replace that value.
Instructor
#4 Old 8th Sep 2014 at 9:22 AM
Hmm... I don't know it's worth the effort since to me, I won't download a core mod just to make Vampires faster, which is basically incompatible with NRaas's ErrorTrap (dunno if it's the same .dll) or any other relevant core mods.
Instructor
#5 Old 8th Sep 2014 at 3:52 PM
Hmmm, when I look into the .dll, I don't think it actually determines to speed of that walkstyle. Like, you think Auto-select is always the slowest??
Field Researcher
Original Poster
#6 Old 9th Sep 2014 at 6:40 AM
Quote: Originally posted by SimsMatthew
Hmmm, when I look into the .dll, I don't think it actually determines to speed of that walkstyle. Like, you think Auto-select is always the slowest??


Yes, I think that define the speed because the values in the walk styles are con cording about the speed in game.
Field Researcher
Original Poster
#7 Old 27th Sep 2014 at 1:35 PM
Here, I have updated the title!
Inventor
#8 Old 27th Sep 2014 at 5:07 PM
Quote: Originally posted by fer456
I want to know how to hash numbers to int32 to put the hash number into the IL code and recompile. Anyone can help me?


Seems to me you just have to convert from decimal to hexadecimal (or reverse) since 1B is 27.

Bye,
Arsil.
Field Researcher
Original Poster
#9 Old 28th Sep 2014 at 1:48 AM
Quote: Originally posted by Arsil
Seems to me you just have to convert from decimal to hexadecimal (or reverse) since 1B is 27.

Bye,
Arsil.


Do you know how to hash in hexadecimal? I try with the included tool in s3pe, but it give me another value, I think unique only for Sims 3 and not int32 or c values.

Thanks anyways.
Test Subject
#10 Old 28th Sep 2014 at 2:40 AM
S3PE can only make FNV hashes though, but don't worry, converting a value to hexadecimal is still very easy to do
Just open your pc's calculator then go to Display ---> Programmer. Your interface will then change into programmer mode to allow you to calculate in binary, hexadecimal, etc. To convert the value of a number in hexadecimal, just type it with Dec selected on the left, then click on Hex to see its value in the other numeral system.
Field Researcher
Original Poster
#11 Old 28th Sep 2014 at 10:18 AM
Quote: Originally posted by bleuminuit
s3pe can only make FNV hashes though, but don't worry, converting a value to hexadecimal is still very easy to do
Just open your pc's calculator then go to Display ---> Programmer. Your interface will then change into programmer mode to allow you to calculate in binary, hexadecimal, etc. To convert the value of a number in hexadecimal, just type it with Dec selected on the left, then click on Hex to see its value in the other numeral system.


OK thank you very much! I don't tenner that detail. I search on internet and I don't find anything, thank you very much!
Test Subject
#12 Old 28th Sep 2014 at 9:02 PM Last edited by bleuminuit : 28th Sep 2014 at 9:13 PM.
You're welcome, good luck with your core mod!
However, I wonder if it's possible to modify the vampires' speed through a pure script mod? It would cause much less compatiblity issuses.
Field Researcher
Original Poster
#13 Old 29th Sep 2014 at 2:15 PM
Quote: Originally posted by bleuminuit
You're welcome, good luck with your core mod!
However, I wonder if it's possible to modify the vampires' speed through a pure script mod? It would cause much less compatiblity issuses.


Yes, i know, but it doesn´t possible. And I am the first person that discover how to make them faster, i don´t know another method.
1978 gallons of pancake batter
#14 Old 8th Oct 2014 at 8:06 PM
Sim.WalkStyle is an enum. If you're lucky, changing it doesn't do a thing. If you're not, it will break things. The enum members are literals. That means in every spot a member is used, the compiler will replace the member reference with the actual literal value, i.e. 27. If any code counts on Sim.WalkStyle containing a member with the value 27, things will break. A lot of enum-related actions work with reflection, so I pretty much assume that they will.

Now I'm pretty out of touch nowadays, but if I remember correctly, a lot of the "sim movement" stuff is in the unmanaged code and thus unavailable for modders.

If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
Field Researcher
Original Poster
#15 Old 8th Oct 2014 at 9:26 PM
Quote: Originally posted by Buzzler
Sim.WalkStyle is an enum. If you're lucky, changing it doesn't do a thing. If you're not, it will break things. The enum members are literals. That means in every spot a member is used, the compiler will replace the member reference with the actual literal value, i.e. 27. If any code counts on Sim.WalkStyle containing a member with the value 27, things will break. A lot of enum-related actions work with reflection, so I pretty much assume that they will.

Now I'm pretty out of touch nowadays, but if I remember correctly, a lot of the "sim movement" stuff is in the unmanaged code and thus unavailable for modders.


Thanks for the info Buzzer. I didn't test it yet, so I can't confirm anything. I will answer that when I have results.

Thanks
Field Researcher
Original Poster
#16 Old 20th Nov 2014 at 5:40 PM
Finally, it didn´t work. Thanks for help anyway!

Anyway i have some other scripting questions, but i posted it on another thread.
Back to top