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!
Quick Reply
Search this Thread
Instructor
Original Poster
#1 Old 30th Aug 2014 at 3:25 PM Last edited by leefish : 31st Aug 2014 at 7:46 AM. Reason: added spoiler tags
Help with Scripting
Hi everyone,

I'm working on another mod that tries to implement a Horse Temperament System. The more you ride a horse, it becomes easier to ride. This is shown by 1. moodlets, and 2. Chance of throwing sims / biting / kicking (implemented later)

However, I can't declare Sim in the callback when the timer ends:

The hex numbers are references to custom moodlets.
I can only assign it to be "null" which obviously isn't correct.
I have tried assigning it to be the variable "horse" in OnSimRodeHorse and other places as well, but without success.
The problem in concern is "private static void OnTemperamentTimerEndReloop()". Tried setting it to public as well.
Help please!
Advertisement
Field Researcher
#2 Old 31st Aug 2014 at 7:44 AM
Looking at the "AddSeasicknessAlarm" method in Sims3.Gameplay.ActorSystems.Seasickness should help, basically create a "helper" class to store the information you need for your callback (Btw, it's a good habit to check that "sim" and "horse" are not null at the start OnSimRodeHorse just in case)
Instructor
Original Poster
#3 Old 31st Aug 2014 at 9:54 AM
Thanks icarus_allsorts, it worked again
You're forever the best xdd
Thanks so much!
Instructor
Original Poster
#4 Old 1st Sep 2014 at 9:50 AM Last edited by SimsMatthew : 1st Sep 2014 at 11:34 AM.
I now have another problem: there is no EventListener that actually checks when a Sim is added to household (from NRaas and the game .dlls). The tutorial here: http://modthesims.info/wiki.php?tit..._Extra_Sim_Data adds the dictionary whenever a Sim is instantiated, not just added to household. But I'm afraid that if I put a sim.IsInActiveHousehold check there it will be too early... Hmm..... What should I do? Writing up a manual interaction for players to manually iterate all Sims in town and then add the dictionary to eligible sims is my last resort.

I'm actually even afraid that when a Sim is added to household, it isn't re-instantiated at all, causing the kSimInstantiated event not to fire at all, making it useless..

EDIT: The reason I do not add the code of adding a key in the dictionary if none for that particular horse is found, is because "instructing players to ride a horse at least once to activate the system" is probably just the same as "click the interaction to manually add keys to the dictionary for the eligible horses if none is found for each one." I have thought of using "kSimDismountsHorse" since when a horse is bought, it is ridden, thus when the sim dismounts, the system is added as well, making the system fire almost instantly. But, this doesn't work for adopted ones or tamed wild horses, so I have no idea what to do. As I said before, I am trying to think of alternatives before resorting to the last method.
Instructor
Original Poster
#5 Old 6th Sep 2014 at 2:34 PM
I have done that above parts.

Another question: How can I actually make an Actor horse and a human sim to get riding? I mean, I have the RidingPosture.AnimateSimAndStartRiding method when the Sim exits the rabbithole, but how to get them actually go into correct postures?? Can anyone give some codes???
Back to top