- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Modding Discussion >
- First Mod: Insect Spawner
- Site Map >
- Modding and Creation >
- Sims 3 Creation >
- Modding Discussion >
- First Mod: Insect Spawner
Replies: 1 (Who?), Viewed: 1150 times.
#1
23rd Jul 2014 at 6:23 AM
Posts: 10
First Mod: Insect Spawner
Hey, everyone! I'm zefelici and even though I have frequented ModTheSims for as long as I can remember, this is my first time ever in its forums and, more importantly, the first time ever that I'm Modding an object.
I have tunned XML files for a while, but, recently, I decided to try and mod objects, since I was in need of a Insect Spawner for my game.
Well, done with a little "briefing", let's get to the part that matters:
As I don't have a lot of experience in C# programming (or in any programming languages, actually), I used a couple tutorials to guide me, but used mainly what EA had already done.
I also did a little digging in Treeag's Treasure Box (since I wanted something similar to their mod). I actually managed to Build the Solution and create the package. So I went testing.
There was no blue screen or crashing or anything when I placed or tried to use the object, so that's a star
But, and here is why I wanted to ask you guys for help , the interactions which the Spawner was supposed to have don't show up When I hover over it, it also displays only the nameplace of the file.
Code:
namespace Sims3.Gameplay.Objects.Miscellaneous.ZefeliciMod.InsectSpawner { public class InsectSpawner : TreasureChestFrance { private sealed class Open : ImmediateInteraction<Sim, InsectSpawner> { // Fields public static readonly InteractionDefinition Singleton = new Definition(); // Methods protected override bool Run() { HudModel.OpenObjectInventoryForOwner(base.Target); return true; } // Nested Types private sealed class Definition : ImmediateInteractionDefinition<Sim, InsectSpawner, InsectSpawner.Open> { // Methods protected override string GetInteractionName(Sim a, InsectSpawner target, InteractionObjectPair interaction) { return Localization.LocalizeString("Gameplay/Objects/Toys/ToyBox/Open:Open", new object[0]); } protected override bool Test(Sim actor, InsectSpawner target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { return true; } } } private sealed class InsectSpawn : ImmediateInteraction<Sim, InsectSpawner> { // Nested Types [DoesntRequireTuning] private sealed class Definition : ActorlessInteractionDefinition<Sim, InsectSpawner, InsectSpawner.InsectSpawn> { // Fields public InsectType mType; // Methods public Definition() { } public Definition(InsectType type) { this.mType = type; } protected override void AddInteractions(InteractionObjectPair iop, Sim actor, InsectSpawner target, List<InteractionObjectPair> results) { foreach (InsectType type in InsectData.sData.Keys) { results.Add(new InteractionObjectPair(new InsectSpawner.InsectSpawn.Definition(type),target)); } } protected override string GetInteractionName(Sim a, InsectSpawner target, InteractionObjectPair interaction) { InsectData data = InsectData.sData[this.mType]; return Localization.LocalizeString(data.Name, new object[0]); } public override string[] GetPath(bool isFemale) { string str; InsectData data = InsectData.sData[this.mType]; if (data is ButterflyData) { str = "Butterfly..."; } else if (data is BeetleData) { str = "Beetle..."; } else if (data is GlowBugData) { str = "Glow Bug..."; } else if (data is NaniteData) { str = "Nanite..."; } else { str = "Other..."; } return new string[] { Terrain.kCreateName, "Insect...", str }; } protected override bool Test(Sim a, InsectSpawner target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { return true; } } } } }
This is the code I got. I don't even know if it is the best or the ideal code for this kind of mod, but, since, at first, it is solely for personal use, I don't really mind.
Could any one, please, help me?
Thank you,
zefelici
Advertisement
#2
24th Jul 2014 at 4:22 PM
Posts: 10
Well, I gave up, I'm too of a noob in programming to create such mod...
BUT! Good news! I found that Nraas' Debug Enabler has an Insect Spawner, so I'm done with this project for now
I'm just surprised I didn't find it before
BUT! Good news! I found that Nraas' Debug Enabler has an Insect Spawner, so I'm done with this project for now
I'm just surprised I didn't find it before
Who Posted
|