- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Object Creation >
- S3OC/S3PE - Changing sounds and effects?
- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Object Creation >
- S3OC/S3PE - Changing sounds and effects?
Posts: 4,419
Thanks: 2483 in 21 Posts
I cloned the firetruck and would like to change the sound and effects.
Could be that both(links) are part of the animation file right?
If so, is it possible to relink the truck to another car animation?
Were would i start?
Posts: 1,740
Thanks: 107793 in 53 Posts
public class CarServiceFiretruck : CarServiceWithSiren { // Fields [Tunable] private static Vehicle.CarTunables kCarTuning = new Vehicle.CarTunables(); // Properties protected override string CarAudioSuffix { get { return "fire"; } } public override Vehicle.CarTunables CarTuning { get { return kCarTuning; } } public override string SirenEffectName { get { return "firetruckSirenLights"; } } }
| (• ◡•)| (❍ᴥ❍ʋ) [◕ ‿ ◕]
Posts: 256
Thanks: 1130 in 6 Posts
You can use this code to derive a new firetruck called LivingFiretruckToy : MyFiretruck. You should still add in some more standard object methods into MyFiretruck class. You can look at some of the Sims3.Gameplay.Objects.Toys classes to see how it's done.
public class MyFiretruck : GameObject, IGameObject { public abstract string SirenEffectName { get; } public VisualEffect mSirenEffect; // Honestly, I'm not sure how the FxSlots work. You'll have to research that. public static Slot mFxSlot = ((Slot)ResourceUtils.HashString32("_FX_2")); public override void Dispose() { if (this.mSirenEffect != null) { this.mSirenEffect.Stop(); this.mSirenEffect.Dispose(); this.mSirenEffect = null; } base.Dispose(); } public override void OnCreation() { base.OnCreation(); this.mSirenEffect = VisualEffect.Create(this.SirenEffectName); this.mSirenEffect.ParentTo(this, mFxSlot); this.mSirenEffect.Start(); } public override string SirenEffectName { get { return "firetruckSirenLights"; } } }
Posts: 4,419
Thanks: 2483 in 21 Posts
I really want to learn this, its the last step....
Is there a good tutorial that explains were to start? Like:
How to extract/view the original script?
Can it be updated with new(or other default) sounds or effects?
Can you extract it, modify it and reuse it on a custom object?
sorry for all the quistions but i have tons of great ideas and this is the last thing i need to learn......
As a test i wanted to switch the firetruck with the policecar but then both sound as effects are wrong, other then that it works fine.
Problem with most tutorials i need to go study english first before i can understand them
Posts: 256
Thanks: 1130 in 6 Posts
It is possible to replace the existing toy firetruck. You would just have to add in your script to the object. Buzzler shows how to do that in the tutorial i mentioned. The class I gave you is a bit more advance. When I get home I'll work on one similar to the tutorial.
Posts: 4,419
Thanks: 2483 in 21 Posts
That vehicle can be cloned as normal vehicle and has some nice features
You can tune it and maintanance it
I want to use it to create a car sims can work on, like pop the hood and tune the engine.
The firetruck alraedy has all this, just need to reassigne the animations/sound and effects.
So wat im after is the truck with a custom script attached.
The scripte can be default 99%, but updated with new links/names for the:
Object animation(just a pose)
New or basegame effect(smoke would be cool)
New or basegame sound
I had a look at buzzer tutorial but it is to complicated at this point for me.....
Posts: 256
Thanks: 1130 in 6 Posts
First off, you do have Visual Studio 2008 Express Installed, yes?
You'll also need the trial version of Reflector too. This lets you explore the Sims 3 Scripts.
Read this on how to setup your project. If you have trouble understanding, I can assist with that as well. http://modthesims.info/wiki.php?tit..._Studio_project
Once you have that all setup you're ready to go and start making a script. You cannot simply "change" the values of the firetruck. You could however do something such as Interaction Injections but that's Twallans expertise.
Alright, so now lets get to the actual coding. You should change the default namespace to something like Sims3.Gameplay.Objects.Bloombase. You want to but sure that you inculde Sims3.Gameplay in the namespace otherwise your scripted object will not work.
Now, lets create the main class (group which contains code) that will contain everything. You will also want to "derive", or set the group the object is based off of. Think of a Apple for example. A Apple is it's own species of plant but it is grouped under the vegetables because it has similarities. The same idea applies to deriving a class.
Open up reflector and import those .dll's that you got from the .package's in the TS3 folder. Go into Sims3GameplayObjects and then go under Sims3.Gameplay.Objects.Vehicles and look for the "CarServiceWithSiren" class. This is what we will be deriving off of. Why don't we derive off of "CarServiceFiretruck"? If we were to do that, then we would not be able to set our own Siren and Effects. If you notice, you can see that the CarServiceWithSiren is derived off of CarService, derived off of CarNpc, derived off of Car, and finally Vehicle is derived off of GameObject. GameObject is THE highest group you can go up to. Object contains every class you will need to make a object script.
So, now lets go back into Visual Studio and put in this code:
public class MyFiretruck : CarServiceWithSiren
Notice the " : " after the space in MyFireTruck? This is telling the game to use the same "methods" (functions, like how to do a problem in math) for this object as CarServiceWithSiren. It's very possible to use the CarServiceWithSiren class on a object if we really wanted to. It just wont contain the effects that we want it too because it's not defined in the class.
Alright, I'll go deeper into Buzzlers tutorial once you understand this, otherwise we'd be getting nowhere! I also highly reccomend getting a book on C# in your language too as that will help you a ton, as it has helped me. I'm still learning, but I know enough to help you out . Trust me, once you learn C#, you can pick up other similar programming languages very quickly like Java. Also, if you're confused on what ANY word means that I just talked about, please do ask and I can help you with that too if I didn't explain it well.
Edit: I'm working on a tutorial now since I got a ton of free time which goes over C# programming in Sims 3. You can find it here: http://simswiki.info/wiki.php?title...Depth_Scripting
Posts: 4,419
Thanks: 2483 in 21 Posts
So, we will be able to use most of the coding of the CarserviceFiretruck with updates on the animations and effects called?
Or does it not work like that?
When starting you have to setup the folders, do you need to include Ambitions also or does the EP's do not have core libraries?
Thank you!!
Edit,
How would i get the file Carservicefiretruck and view it?
Is this the file CMo showed?
And do i need Reflector because it isn't Free....
Posts: 256
Thanks: 1130 in 6 Posts
No, using the base game DLL's are perfectly fine. They are exactly the same.
You view this file by using Reflector. You can use dotPeek which is very similar to Reflector but it's still in it's early development stage. Reflector has a 14 day trial.
Posts: 703
Thanks: 941 in 1 Posts
I've had it since reflector timebombed last january, and no complaints. There's a link for it on here somewhere,
I think it's ...
http://www.modthesims.info/showthread.php?t=436481
... 2nd on buzzlers list.
Posts: 4,419
Thanks: 2483 in 21 Posts
Posts: 256
Thanks: 1130 in 6 Posts
Posts: 4,419
Thanks: 2483 in 21 Posts
According to the tutorial(the video) Koli imports 11 .DLL files as reference files in MS visual C but i only have 8....
Following the tutorial I took the files from:
Gameplay.package wich has 3 files in it(Sims3GameplaySystems.dll / Sims3GameplayObjects.dll / UI.dll)
SimsCore.package wich has 3 files in it(System.Xml.dll / System.dll / mscorlib.dll)
Script.package wich has 3 files in it(SimIFace.dll / ScriptCore.dll / Sims3Metadata.dll)
A total of 9 but according to the tut you dont need the mscorlib.dll as it is integrated in MS visual C already, so i have 8
I am still missing 3 files, wich ones and were to locate them?
Posts: 256
Thanks: 1130 in 6 Posts
Posts: 4,419
Thanks: 2483 in 21 Posts
It is not possible to import mscorlib. because it is already referenced, you get a error
Posts: 256
Thanks: 1130 in 6 Posts
Once there, select Build. And now click on the button that says Advanced in the bottom right hand corner under the Output category.
When you click on that, uncheck the "Do not reference mscorlib". Now, go into Application tab and make sure for Framework it says .NET Framework 2.0. If not, then change it. That should tell you you need to save project and it will be reopened.
You are now able to import the mscorlib from the package.
Posts: 4,419
Thanks: 2483 in 21 Posts
Its the fireengine wat gives the tuning stuff and such
Thnx again
Posts: 256
Thanks: 1130 in 6 Posts
Posts: 4,419
Thanks: 2483 in 21 Posts
I prolly need your help, the script is perfect exept that the tuning of the vehicle is related to the career.
I hope i can find and eliminate that.
Posts: 256
Thanks: 1130 in 6 Posts
Posts: 703
Thanks: 941 in 1 Posts
He's trying to get it so it doesn't have to be a fireman.
Posts: 256
Thanks: 1130 in 6 Posts
Posts: 4,419
Thanks: 2483 in 21 Posts
There are 2 possibility's:
Mantainance on the car wich can do each sim
Tuning of the car speed ingame, this can only a sim do wich is a fireman.
Both are the same animation but unfortunate related to the fireengine(truck)
this prolly means that when you tune the car you will auto tune all firetrucks in town.
Anyway, ill figure it out i hope.
I already have them walk up to the front of the car and pop the hood were they start tuning
And if i can not figure it out you guys prolly can.
This is the car im working on:
http://koti.mbnet.fi/turpuli/garage/vc70gtx.html
Posts: 256
Thanks: 1130 in 6 Posts
We'll derive off of FireEngine. I made a big booboo and derived off of the wrong one. I'm so sorry! Mistakes happen, and we learn from them
I'm having you derive off of FireEngine instead since that has what you're looking for. We could derive off of SirenEnabledVehicle if you want too.
The CarService class was for NPC use, which is why you couldn't really change anything. Taking a look at the FireEngine class shows us a ton of different methods we can override to fit our preferences.
I'm honestly not sure if you will need to do something else for it. Just replace the class I had you derive from before and you will probably be good.
Who Posted
|