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!
Virtual gardener
staff: administrator
Original Poster
#1 Old 30th Mar 2018 at 9:54 PM
Default Genetics causes overload error?
Hi!

So I've been working on a object that spawns a specific sim, wearing an object and basically appearing as an invisible sim (Kinda like bonehilda, grim reaper, etc). I've been using the mummy and bonehilda coffin as a reference to see if i'm coding it right and just copy pasting specific lines (Because lazy me :P) However, I have ran into an issue that I can somehow not fix, no matter what I do, yet has to be included:

Code:
this.Target.mFloursackAdult = Genetics.MakeSim(32, 8192, GameUtils.GetCurrentWorld(), 4294967295u);


Now I know from the original code, it should be stated that way, given how it's:

Code:
	public static SimDescription MakeSim(CASAgeGenderFlags age)
{
	CASAgeGenderFlags gender = RandomUtil.CoinFlip() ? 4096 : 8192;
	return Genetics.MakeSim(age, gender, GameUtils.GetCurrentWorld(), 4294967295u);
}


However I keep getting these sorts of errors:

Error 1: The best overloaded method match for 'Sims3.Gameplay.CAS.Genetics.MakeSim(Sims3.SimIFace.CAS.CASAgeGenderFlags, Sims3.SimIFace.CAS.CASAgeGenderFlags, Sims3.SimIFace.WorldName, uint)' has some invalid arguments.

but I guess this could be one of those 'unprotected' files issues again... any thoughts?
Advertisement
Space Pony
#2 Old 30th Mar 2018 at 10:43 PM
It looks like you need to cast the 8192 to casagegenderflags so i would try something like this:
this.Target.mFloursackAdult = Genetics.MakeSim((CASAgeGenderFlags )32, (CASAgeGenderFlags )8192, GameUtils.GetCurrentWorld(), 4294967295u);

E: for better readability:
this.Target.mFloursackAdult = Genetics.MakeSim(CASAgeGenderFlags.Adult, CASAgeGenderFlags.Female, GameUtils.GetCurrentWorld(), 4294967295u);
Virtual gardener
staff: administrator
Original Poster
#3 Old 31st Mar 2018 at 11:23 AM
Ah that fixed it! And fixed a few other overload issues that weren't relevant to this thread! I guess it makes sense why that would work. Makes me feel a little stupid I didn't think of that yet Thanks a lot!
Back to top