View Full Version : How do we add a new choosable interaction to an object?
6th Jun 2011, 01:35 PM
I'm working on creating a karaoke machine, of which my original intention was to make it a mirror clone so that people could use it for storytelling sceenshots that at least look like someone is singing. But, one of the comments on my recent microphone upload requesting that I add to the microphone the ability for sims to sing the songs that come with World Adventures, would be a great idea for the karaoke machine, as it would be much more fun and a much more authentic karaoke than just standing there giving a speech and waving their arms about. The one little problem is that I have no idea how to do that, or if it even can be done.
Having had a look through the jazz scripts in WA's jazzdata.package, where I would have expected to find these singing animations, I can't seem to find them. The only singing-related animations I found were the base game 'romantic' ones. I found all the other WA animations such as diving, mummy walk, etc, but nothing about singing Chinese, French or Egyptian songs. Does anyone know?
And, most importantly, if I can find the necessary animations, is it even possible to add them to the object's interactions, and how does one do it?
6th Jun 2011, 06:28 PM
Here you go Esmeralda, http://modthesims.info/showthread.php?t=434786 that will show you how to do the object interactions.
As for the sims singing the songs like China, Egypt, and France, it seems to be related to the SingSongInteraction class.
private void StartPlayingSound(StateMachineClient sender, IEvent evt)
string countryCode = SingingInfo.GetCountryCode(this.PickedSong.TraitToKnow);
string str2 = "";
str2 = "vo_sing_frnder_" + countryCode + "_frndlyA";
str2 = "vo_sing_frnder_" + countryCode + "_borA";
str2 = "vo_sing_frnder_" + countryCode + "_borC";
str2 = "vo_sing_frnder_" + countryCode + "_frndlyC";
Audio.StartObjectSound(base.Actor.ObjectId, str2, false);
This is basically telling the game to get the countryCode (China, Egypt, France) and if they know the composition then to sing it. You can find the full line of coding around here: Sims3.Gameplay.ActorSystems.SingingInfo
This can be very confusing to implement into a Karaoke if you're just beginning with object modding for sims 3. I honestly don't know how to go about adding this in for the interaction, though I don't think it would be that difficult. I'm guessing you'd just have to reference the StartPlayingSound in the Run() with something like this.StartPlayingSound().
Hope this bit of info helps you out and good luck on your project.
6th Jun 2011, 07:02 PM
Thank you VERY much - I am just beginning with object modding (have never tried it before), have very little (and very rusty) coding experience, and the tutorial looks very daunting, but I'll try to work my way through it, and the piece of code you supplied above should be a huge step in the right direction. Thanks again!
14th Jun 2011, 12:00 PM
Hello Odistant, hope you'll come back to this thread - I'm unfortunately not getting anywhere with this due to my own lack of knowledge and experience re both C# coding (my C coding days ended way back when it was just plain C and I wasn't much good at it anyway) and modding objects, but the one thing I wanted to ask you is, where do you find Sims3.Gameplay.ActorSystems.SingingInfo, as mentioned in your post?
Following the tutorial you linked to, I found and extracted Automation, mscorlib, ScriptCore, SimIFace, Sims3GameplayObjects, Sims3GameplaySystems, Sims3Metadata, System, System.Xml, and UI from gameplay.package, scripts.package, and simcore.package as instructed, but could not for the life of me find Sims3.Gameplay.ActorSystems.SingingInfo anywhere.
Sorry to be such a n00b - it's probably something really simple if you know how, but unfortunately I dunno how. Thanks for your help! :)
(Also, anybody, should this have gone in Modding Discussion rather than Object Creation? Wasn't sure which.)
20th Jun 2011, 06:40 PM
where do you find Sims3.Gameplay.ActorSystems.SingingInfo, as mentioned in your post?Open the libraries you exported in an assembly browser (ILSpy or Reflector, there's a link in the related tutorials). SingingInfo is in Sims3GameplaySystems. Just expand it, then Sims3.Gameplay.ActorSystems and then scroll down until you find SingingInfo. Or just do a search.
(Also, anybody, should this have gone in Modding Discussion rather than Object Creation? Wasn't sure which.)Modding Discussion is better suited for stuff like this. Also in Modding Discussion I would've seen this thread. ;)
21st Jun 2011, 07:30 PM
Ah, thank you Buzzler, I'll take a look at that with ILSpy, which I've downloaded (apparently you have to pay for Reflector now and I'm too broke, ha ha). Glad you did find this thread, and if I ever have any more questions of this type I'll ask them in Modding Discussion, thanks for the advice!
vBulletin v3.0.14, Copyright ©2000-2013, Jelsoft Enterprises Ltd.