Posts: 16
Thanks: 62 in 2 Posts
4 Achievements
Help: Beginner adding a command
Hey, sorry if this is silly/obvious but I'm such a beginner to this all and I'm really confused! I'm so close to giving up
So I followed the Pure Scripting Modding tutorial and made myself a VS project template that I think is correct. Using some of the guidance from that tutorial I ended up trying to make this as my first simple project, another way to type testingCheatsEnabled into the console. This was the result:
Code:
using System;
using Sims3.Gameplay.Core;
using Sims3.SimIFace;
namespace Swiffy.HelloWorldCommand
{
public class HelloWorld
{
[Tunable]
private static bool kInstantiator = true;
static HelloWorld()
{
World.OnWorldLoadFinishedEventHandler += new EventHandler(OnWorldLoadFinished);
}
private static void OnWorldLoadFinished(object sender, EventArgs e)
{
Commands.sGameCommands.Register("testingAlias", "enables testing cheats", 2, Commands.OnTestingCheats);
}
}
}
Yet I keep getting the errors in VS that 'Commands' does not contain a definition for 'sGameCommands' nor for 'OnTestingCheats'! I managed to reduce an error by using 2 instead of CommandType.Cheat but I'm so confused because when I peek at the Commands definition in Sims3.Gameplay.Core...
Code:
public class Commands
I see...
Code:
private static CommandRegistry sGameCommands;
right there! I think I saw a code snippet in here about using CommandSystem instead but I've checked some other mods in dnSpy and this seems to be the legit way to do it. Please be nice, I'm so stuck