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!
Lab Assistant
Original Poster
#1 Old 8th Nov 2014 at 4:48 PM
Default How to add Interaction to the House?
Hello.
I want to add balloon of the Interaction to the all houses in town.
I trying to add
Code:
 internal sealed class GetAllTheSimsFromHouse : Interaction<Sim, Household>

but MS VS 2012 get error
Error 1 The type 'Sims3.Gameplay.CAS.Household' cannot be used as type parameter 'TTarget' in the generic type or method 'Sims3.Gameplay.Interactions.Interaction<TActor,TTarget>'. There is no implicit reference conversion from 'Sims3.Gameplay.CAS.Household' to 'Sims3.Gameplay.Interfaces.IGameObject'. C:\Art\Projects\sims3mods\My_Mods\Tests\ClassLibrary1\ClassLibrary1\GetAllTheSimsFromHouse.cs 23 27 ClassLibrary1
How to fix this?
Thanks.
Advertisement
1978 gallons of pancake batter
#2 Old 8th Nov 2014 at 4:52 PM
Only classes derived from GameObject can be the target of an interaction. Household is the representation of a group of sims, not a visible entity. Try making the target Lot.

If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
Lab Assistant
Original Poster
#3 Old 8th Nov 2014 at 4:57 PM
Is it correct?
Code:
****
 internal sealed class GetAllTheSimsFromHouse : Interaction<Sim, Lot>
    {
****
sims = Target.Household.AllActors;
            foreach (Sim member in sims)
            {
****
1978 gallons of pancake batter
#4 Old 8th Nov 2014 at 5:03 PM
Depends on what you're trying to do. AllActors will really give you all actors, so pets too. If you only want "humans" you should use Household.Sims. Also you should make a null check before accessing Lot.Household, because the household will be null if the lot isn't occupied.

If gotcha is all you’ve got, then you’ve got nothing. - Paul Krugman
Lab Assistant
Original Poster
#5 Old 8th Nov 2014 at 5:46 PM
Thanks!
Test Subject
#6 Old 15th Nov 2014 at 4:03 AM Last edited by brando130 : 15th Nov 2014 at 4:37 AM.
Assuming base.Target is a Lot:
Code:
foreach (Sim sim in base.Target.GetSims()) {  }
Back to top