Help with scripting: adding interaction from a fireplace to a custom stove to make a fire? ("light fire/put out fire")
Hi, some of you might have seen my thread about adding a decorative fire effect here:
https://modthesims.info/showthread.php?t=688695
Currently I’m trying to work on the custom script, and thought it was better to make a dedicated thread on the subject.
I know nothing about scripting. It’s basically a copy-paste of the code of the fireplace.
I only want the interactions “light fire/put out fire”, and make it so that, like with a fireplace, the fire is lit/put out, that’s all.
I used these tutos to get started:
https://modthesims.info/wiki.php?ti..._Object_Modding
https://modthesims.info/showthread.php?t=632267
I used Ilspy too along with sharpdevelop.
Here’s the code so far, I plan to add it to the custom stove with the fxsmoke I made and talked about in the thread about adding a decorative fire effect.
Also, here’s an archive of my sharpdevelop folder project, with the custom stove, so that anyone can take a look at it.
https://www.mediafire.com/file/fcrd...t_test.rar/file
The code.
Code:
/*
* Created by SharpDevelop.
* User: ijera
* Date: 15/03/2025
* Time: 17:18
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Reflection;
using System.Runtime.InteropServices;
using Sims3.Gameplay.Abstracts;
using Sims3.Gameplay.ActiveCareer.ActiveCareers;
using Sims3.Gameplay.Actors;
using Sims3.Gameplay.ActorSystems;
using Sims3.Gameplay.Autonomy;
using Sims3.Gameplay.Careers;
using Sims3.Gameplay.CAS;
using Sims3.Gameplay.Controllers;
using Sims3.Gameplay.Core;
using Sims3.Gameplay.EventSystem;
using Sims3.Gameplay.Interactions;
using Sims3.Gameplay.InteractionsShared;
using Sims3.Gameplay.Interfaces;
using Sims3.Gameplay.ObjectComponents;
using Sims3.Gameplay.Objects.Alchemy;
using Sims3.Gameplay.Objects.Appliances;
using Sims3.Gameplay.Objects.CookingObjects;
using Sims3.Gameplay.Objects.Counters;
using Sims3.Gameplay.Objects.Fireplaces;
using Sims3.Gameplay.Objects.FoodObjects;
using Sims3.Gameplay.Objects;
using Sims3.Gameplay.Situations;
using Sims3.Gameplay.Skills;
using Sims3.Gameplay.ThoughtBalloons;
using Sims3.Gameplay.TuningValues;
using Sims3.Gameplay.Utilities;
using Sims3.Gameplay;
using Sims3.SimIFace.CustomContent;
using Sims3.SimIFace.Enums;
using Sims3.SimIFace;
using Sims3.UI.Hud;
using Sims3.UI;
using System.Collections.Generic;
namespace Sims3.Gameplay.Objects.Appliances.Mimics.ijerafirestove
{
/// <summary>
/// Description of MyClass.
/// </summary>
public class firestove : StoveCountry
{
public class FireplaceInteraction : Interaction<Sim, firestove>
{
public class LightFire : FireplaceInteraction
{
private sealed class Definition : InteractionDefinition<Sim, firestove, LightFire>
{
protected override string GetInteractionName(Sim a, firestove target, InteractionObjectPair interaction)
{
return ("LightFire");
}
protected override bool Test(Sim a, firestove target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
{
return !target.mLit;
}
}
}
}
public class PutOutFireInteraction : FireplaceInteraction
{
private sealed class Definition : InteractionDefinition<Sim, firestove, PutOutFireInteraction>
{
protected override string GetInteractionName(Sim a, firestove target, InteractionObjectPair interaction)
{
return ("PutOutFire");
}
protected override bool Test(Sim a, firestove target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
{
return target.mLit;
}
}
}
}
}