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 7th Aug 2020 at 8:11 PM
Default About Generation Walking Canes
What exactly prevents sims of other ages and occult types from using them? I am currently seeking to make a adult sim which uses a cane, so I'm planning to unlock the cane interactions, but I need to know how to do that first.
Advertisement
Space Pony
#2 Old 7th Aug 2020 at 8:14 PM
Hi @CyrusBanefort

there is a method inside the cane class that does the checking
Code:
		public static bool IsAllowedToUseCane(Sim sim)
		{
			return sim.OccultManager.CanUseCane() && !sim.SimDescription.IsGhost && !sim.IsPet && sim.SimDescription.DeathStyle == SimDescription.DeathType.None && sim.SimDescription.Elder;
		}


E: you would have to replace all the interactions you need with the cane or create a complete cane replacement/addition with a custom class
Lab Assistant
Original Poster
#3 Old 7th Aug 2020 at 8:31 PM
Quote: Originally posted by Battery
Hi @CyrusBanefort

there is a method inside the cane class that does the checking
Code:
		public static bool IsAllowedToUseCane(Sim sim)
		{
			return sim.OccultManager.CanUseCane() && !sim.SimDescription.IsGhost && !sim.IsPet && sim.SimDescription.DeathStyle == SimDescription.DeathType.None && sim.SimDescription.Elder;
		}


E: you would have to replace all the interactions you need with the cane or create a complete cane replacement/addition with a custom class


@Battery, where exactly the code of the cane interactions is located?
Space Pony
#4 Old 7th Aug 2020 at 8:33 PM
Quote: Originally posted by CyrusBanefort
@Battery, where exactly the code of the cane interactions is located?


Sims3.Gameplay.Objects.Cane is the class which contains the interaction classes like HarassEveryone, StartUsingCane etc
Lab Assistant
Original Poster
#5 Old 7th Aug 2020 at 8:50 PM
Quote: Originally posted by Battery
Sims3.Gameplay.Objects.Cane is the class which contains the interaction classes like HarassEveryone, StartUsingCane etc


@Battery,

So I would only need to add "Adult"/"Young Adult" and the other occult markers to make the interaction available to occult and adult/young adult sims, correct?
Space Pony
#6 Old 8th Aug 2020 at 8:08 AM
Kind of.

The Conditions are partly mutual exclusive. If a Sim is a Elder he cant be a young adult. So when you rewrite the interactions or the Cane class you would have to make these parts or conditional. Instead of


sim.SimDescription.Elder

write

sim.SimDescription.Elder || sim.SimDescription.Adult.

for example



Alternatively you could just exclude Sims who cant use the cane dependent on the scope you are going for this may be the better way. So if you want everyone who is a Young adult or above you could write
Code:
		public static bool IsAllowedToUseCane(Sim sim)
		{
			return sim.SimDescription.YoungAdultOrAbove;
		}
Back to top