PDA

View Full Version : Deletable Imaginary Friend Doll-script mod help


claudiasharon
24th Oct 2011, 04:06 PM
I was editing the OBJD to make the Imaginary Friend Doll buyable but I cannot seem to make it deletable. Would I have to make a script mod or something? Why can't I get it to delete by just the OBJD itself? Because it turns real? Anybody have any ideas?

Sims MX
24th Oct 2011, 05:24 PM
Yes, you would need a script mod to fix the doll. Head to the Tutorials section and take a look at the object modding tutorial.

This needs to be changed:
public override bool CanBeSold()
{
return false;
}

claudiasharon
24th Oct 2011, 05:31 PM
Yeah I figured out that needed to be changed, but I couldn't get it to work. I'm looking at the object modding tutorial right now. Tested in game, still wouldn't delete the doll.

Edit: I still can't figure it out. :\ I fail at this whole coding thing.

Edit2: Now I can't get it to build, I keep getting various errors.

Edit3: I think my problem is that I don't know what to put in the "protected override bool Run()" part of the tutorial for my mod. Anybody have any suggestions?

Sims MX
25th Oct 2011, 05:55 AM
The "Run()" method is used in interactions. As you're not adding new interactions, you don't need it.

Your code should look like this:
public class ImaginaryDoll : Sims3.Gameplay.Objects.Miscellaneous.ImaginaryDoll
{
public override void OnStartup()
{
base.OnStartup();
}

public override bool CanBeSold()
{
return true;
}
}

claudiasharon
25th Oct 2011, 09:15 AM
The "Run()" method is used in interactions. As you're not adding new interactions, you don't need it.

Your code should look like this:

Oh sweet, I was close. I didn't know if I needed that part or not. Thanks for the help! I tested in game and it works. But only on newly created IFs, not existing ones. Is there a way to change that? Or is that just how it is going to have to be?

Odistant
26th Oct 2011, 03:09 AM
Youd have to load up the IF by a WorldEventHandler.


Im guessing by IF you nean interaction function or something like that?

claudiasharon
26th Oct 2011, 03:10 AM
Youd have to load up the IF by a WorldEventHandler.


Im guessing by IF you nean interaction function or something like that?

IF=Imaginary Friend.

And how would I do that?