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!
Test Subject
Original Poster
#1 Old 28th Apr 2014 at 12:07 AM
Default Functioning Santa NPC--work in progress. Artists required, some scripting help desired
Hello!

I'm in the process of developing what I hope will be my first published mod for the sims 3. I'm trying to create a santa claus npc which is triggered by the existence of some object--like a stocking--which appears once a night as long as that object is on the lot. I haven't implemented everything yet, but I have come pretty far.

Here's a checklist of what I need to get done:

--Add a daily alarm for a function that checks whether the object is on the property: Not implemented yet because I'm still testing the actual npc itself

--If it is, spawn an elderly, male, overweight bearded NPC wearing a santa costume: Partially DONE. I managed to set all of the right physical attributes for the npc except for the beard. I'm not sure how to do that. I also need an artist to create the santa costume

--route the NPC to the object, play an animation, and make him drop as many gifts as there are sims on the lot: DONE but not perfect, and has errors. This is where I need scripting help right now. I also might need an artist to create the gift box

--A system of calculating a random chance that a mean spirited or evil sim will be given coal. Not implemented yet. I probably need an artist to make a coal object

I'm using git for the version control of my source code. The most up to date version of my code is here https://github.com/recursor94/Sims-...ster/Sims3Santa If you are willing to offer me help, please look through that code.

The biggest issue that I'm experiencing right now is in spawning the actual gift object. I'm trying to spawn a cloned version of the giftbox object, and I've given it a unique instance name "giftgiverbox". The object does not spawn, and blue rectangular prisms are generated instead. Spawning a normal in game object works correctly.

Here's the problem code block:
Code:
     public void spawnGifts(int numberOfSims)  //maybe in the future make it based on age, tunable variable for whether all age groups are okay or not.
       {
            IGameObject gift;
            
            float xOffset = 1f;
            for (int n = 0; n < numberOfSims; n++)
            {
                gift = GlobalFunctions.CreateObjectOutOfWorld("giftgiverbox"); //make random later.
                Vector3 objPosition = base.Target.Position;
                Vector3 giftPosition = new Vector3(objPosition.x + xOffset, objPosition.y, objPosition.z);
                gift.AddToWorld();
                gift.SetPosition(giftPosition);
                GiftGiverSituation.debugMessage("Gift Position" + gift.Position + "santa object position" + this.Target.Position);
                xOffset += 0.7f;
            }


I've uploaded the zip containing the package here: http://sourceforge.net/projects/rec...od.zip/download

I'm trying to make this compatible with the base game. Spawning a gift pile works fine but I don't want to make my mod specific to the seasons expansion pack.

Any help is appreciated in advance!
Advertisement
Instructor
#2 Old 28th Apr 2014 at 10:52 AM
Great job! I don't have any insights on scripting as I'm a noob with such. All I could say is that maybe you should only spawn gifts for Children, and Teens and Adults with Childish / Good traits. Best if tunable. Though, what you're doing are really sufficient!
Inventor
#3 Old 28th Apr 2014 at 4:18 PM
You can set the imediate flag in the makeservicerequest. this way your npc will teleport to the target lot, instead of the of routing by car.

Don't forget to destroy the 'GiftGiver.Instance.requestGiver' alarm before leaving the game.
Test Subject
Original Poster
#4 Old 28th Apr 2014 at 4:30 PM
Quote: Originally posted by douglasveiga
You can set the imediate flag in the makeservicerequest. this way your npc will teleport to the target lot, instead of the of routing by car.

Don't forget to destroy the 'GiftGiver.Instance.requestGiver' alarm before leaving the game.


Actually he doesn't route to it by car anymore, he just walks there. Which is what I want. Also, I have already set the bimmediate flag to true.


The main problem I'm having right now is that the gift object is not spawning. Every stock object in the game works correctly, but it fails for my cloned object.
Forum Resident
#5 Old 28th Apr 2014 at 8:09 PM Last edited by Consort : 28th Apr 2014 at 10:44 PM.
You could try the second first overload for CreateObjectOutOfWorld:
GlobalFunctions.CreateObjectOutOfWorld(new ResourceKey(ulong inst, uint type, uint group));

inst should be the instance value of your object, type the resource type (I'm guessing either OBJK or OBJD), group usually 0

Find my Mods: Here at MTS, over at Simlogical
Inventor
#6 Old 28th Apr 2014 at 10:22 PM
Test Subject
#7 Old 7th May 2018 at 7:01 PM
What ever came of this? Did anyone design this Santa Mod? People are still asking about this sort of thing.
I was wondering if it could even be Santa that you hire (like a pizza boy) and he shows up at midnight, jingle bells and then drops your gift pile. The gift pile that mysteriously shows up. Problem is, they would have to make enough room for the pile.
Test Subject
#8 Old 31st Jan 2021 at 11:31 PM
I realize that this is very old, but does anyone know if this was ever finished or maybe have a link to another mod that spawns Santa?
Back to top