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
Lab Assistant
Original Poster
#1 Old 5th Sep 2014 at 7:43 PM
Won't run (newbe to C#) Help Please.
Ok, Using some code I found on the net until I learn more. I used this simple to show a message.

namespace Radar1
{
public class HelloWorld
{
[Tunable]
protected static bool kInstantiator = false;

static HelloWorld()

// code I found.
{

AlarmManager.Global.AddAlarm(1f, TimeUnit.Seconds, new AlarmTimerCallback(delegate()
{
StyledNotification.Show(new StyledNotification.Format("Hello World", StyledNotification.NotificationStyle.kSystemMessage));
}), "Hello World", AlarmType.NeverPersisted, null);

}
}
}

Made the kInstantiator.xml. and put them into a S3PE package. When I run the game, Nothing happens.

I'm sure I added the XML correctly into s3pe. The name I used was Radar1.HelloWorld, If I'm understanding this stuff corectly.

Just trying to get something to run so I can learn to MOD the game.

Tim
Advertisement
Instructor
#2 Old 6th Sep 2014 at 3:57 AM
Well, you're doing nothing wrong with your XML.

But, just as a piece of advice (from my past experience of failure making me hating C# so much, while hoping to mod the game as well), you shouldn't just copy tidbits here and there. The emphasis is that you need to read the whole tutorial and try to understand and comprehend the content!. I know what you're trying to do, basically is to show "Hello World" as a TNS message after 1 in-time second (almost instantly). But, your mod doesn't actually get loaded. Your static method does nothing to actually load the code you wrote. Read the Pure Scripting Tutorial by Buzzler, he will tell you how to set up a basic framework, which calls the OnWorldLoadEventFinished method, and then when this is invoked, you can begin your code inside the part. Really, his tutorial is definitely better than my try on explaining. The best thing I can do, is to suggest you to set up a basic framework that the game actually runs and allows you to put the real, main code inside, and then gradually building up your codes. You can't simply put some code snippets in whatever method / class / function VS doesn't give an error. When VS doesn't give an error, it's simply because you wrote in correct syntax with correct object references / variable types assigned. But it doesn't know the code is run in The Sims 3 as a game and it definitely won't know the game doesn't actually code the code as well.
Lab Assistant
Original Poster
#3 Old 9th Sep 2014 at 10:53 PM
I've already read the Pure Scripting Tutorial by Buzzler.

A little about me, I learned to program Basic in 1973 on an IBM mainframe. The when the PC's came out, I learned Pascal about 1985. This was long before Windows even came out. I haven't done anything in programming until now.

So I guess the Dll's are like Units in Pascal. In Pascal most of the code was in the Units and you called the bit of code you wanted to run from the main program. So I guess you call the bit of code from the Dll's you want to run.

All starting to make since now.

Thanks
Tim
Instructor
#4 Old 14th Sep 2014 at 12:36 PM
Well, as a noob, I don't really quite know all about Pascal and Basic - hmm... I only wrote in Visual Basic.NET aside from C# classes for Sims 3... Good luck on your mod, anyway!
Back to top