Replies: 5 (Who?), Viewed: 578 times.
Lab Assistant
Original Poster
#1 Old 7th Aug 2020 at 9: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
Field Researcher
#2 Old 7th Aug 2020 at 9: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
DELETED POST
Original Poster
7th Aug 2020 at 9:17 PM
This message has been deleted by CyrusBanefort. Reason: Already answered
Lab Assistant
Original Poster
#3 Old 7th Aug 2020 at 9: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?
Field Researcher
#4 Old 7th Aug 2020 at 9: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 9: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?
Field Researcher
#6 Old 8th Aug 2020 at 9: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