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!
Test Subject
Original Poster
#1 Old 25th Sep 2014 at 6:37 AM Last edited by bleuminuit : 4th Oct 2014 at 5:39 PM.
Default [Solved!] Trying to make a mod that allows blogging on computers, need help
Hi everyone!

After reading a lot of tutorials, I decided to make my first pure script mod, which is supposed to allow sims to blog on the computer. What I did was that I made a new interaction based on the smartphone's blog app and then I injected it in the object through an Instantiator class. However, even though I made and localized the interaction's string with the appropriate coding in the interaction class to make it work, it didn't appeared in the computer's pie menu for some reason.

Can someone help me find out what's wrong and how to fix it please?
Attached files:
File Type: 7z  Blackcatluna_AllowBloggingOnComputers.7z (1.4 KB, 54 downloads) - View custom content
Description: My mod's source code (not working)
Advertisement
Instructor
#2 Old 25th Sep 2014 at 11:31 AM
Code:
computer.AddInteraction(BlogAppComputer.Singleton);


This, perhaps delete the foreach loop, and instead, add parameter true after Singleton (for bool checkForDuplicate).

Code:
                return target.IsComputerUsable(a, true, false, isAutonomous);


Try !isAutonomous?
Test Subject
Original Poster
#3 Old 26th Sep 2014 at 1:06 AM
I just tried out what you suggested but it didn't worked sadly, still no interaction in the pie menu
Instructor
#4 Old 26th Sep 2014 at 2:44 PM
Try looking at JunJayMDM's computer mod at DEN Simlogical, and then copy a base of the computer interaction, then slowly add in parts of the blogging interaction. Does the computer become unusuable (ie when clicked, no pie menu?) Or check whether your active Sims can be clicked (ie have A click A, have A click B, have B click A, have B click B). Sometimes, if your interaction is wrongly injected on another object, this could happen. I didn't quite have the time today, read through your interaction definition to see if it points exactly to your interaction, and then also see if the AddInteraction method for your interaction is targeted towards Computer.

Good luck
Test Subject
Original Poster
#5 Old 27th Sep 2014 at 5:36 AM
Good news!

When I looked again at my package to re-import my script, I just realised that I forgotten to add the quotation marks around "true" in the Instantiator xml, what a silly mistake!
I can see the blog app in the computer's pie menu now, no wonder it did nothing

The interaction itself doesn't work yet though, it keeps cancelling every time I try to use it. Adding the ! or not in isAutonomous didn't changed anything either. I also improved the Instantiator class by adding the possibility to use the interaction from the inventory for laptops while keeping the foreach loop, since it did nothing when I removed it but I saw it in both of JunJayMDM and NonaMena's computer mods so it must be there for a good reason, and the true parameter for AddInteraction. I'm currently still looking at the other mods and EA's interactions to see how I can make mine work.
Instructor
#6 Old 27th Sep 2014 at 12:10 PM
Good luck! I don't really have experience with computer interactions, so I can't really give you input. Though you are welcome to ask me anytime.
Test Subject
Original Poster
#7 Old 28th Sep 2014 at 1:30 AM
Ok no problem, thanks a lot for your help Matthew!
Inventor
#8 Old 28th Sep 2014 at 2:37 PM Last edited by Arsil : 28th Sep 2014 at 8:57 PM.
The problem is "startComputing" returning false. I'm investigating it.

EDIT: not sure if related, but if the computer is in the inventory the
interaction is not available.
Test Subject
Original Poster
#9 Old 28th Sep 2014 at 8:42 PM
I see...and also don't worry about the availability of the interaction from the inventory, I fixed it already
Attached files:
File Type: 7z  Blackcatluna.AllowBloggingOnComputers.Common.7z (843 Bytes, 41 downloads) - View custom content
Description: My improved instantiator class
Test Subject
Original Poster
#10 Old 3rd Oct 2014 at 12:33 PM Last edited by bleuminuit : 3rd Oct 2014 at 12:47 PM.
Sorry if I didn't posted a lot these days, I was a bit busy.

I just started working on my script again this morning, and I noticed that BlogAppComputer was missing the Begin and EndCommodityUpdates lines that all other computer interactions had and I fixed that. But the interaction itself still didn't worked so I looked at my code again and I wondered if the BlogAppDialog was the culpit...

I then looked at it in ILspy and I noticed that it was actually derived from the SmartphoneDialogBase, so that's probably why it returned false!
Looks like I will have to make my own modal for it, but I won't be giving up!
Inventor
#11 Old 3rd Oct 2014 at 5:59 PM Last edited by Arsil : 4th Oct 2014 at 10:07 AM.
You didn't "see" after all. Maybe cause I write like a moron. You hurt me. Just kidding.

The only issue reusing ShowBlogAppDialog is that you'll get the "smartphone interface" even when
blogging with the computer. And calling it without checking if the sim has enough social networking
skill in order to use a blog is bad cause you'll not be able to create a blog (you can but when
you leave the blogging interface the sim get resetted and the changes to the blog aren't saved).

I commented [EDIT: "base.StandardExit()" and] "return false" in the "startComputing" check, compiled,
updated the package and tried the mod. The sim get resetted because of the AnimateSim call:
this means a state machine hasn't been initialized (this is important, let's keep it in mind).
I commented that call too, tried again the mod and it works. I mean, the sim get resetted again
when calling "stopComputing" but the changes to the blog are saved this time.

So, let's focus on startComputing. It returns false only if startWorkingWithComputer returns false.
There are only 2 reasons for this last method to return false. I think we can discard one of them
cause there's no line to use the computer in my tests. So the only reason left is that the sim is not
"currentlyComputing": he is not sitting in a chair in front of a surface with a computer on top.

Your interaction is pretty much identical to any other computer interaction, so I don't get why
in this case all the "routing to the object" part is missing. If we figure out where the routing
happens maybe we can fix your mod. Even finding where the state machine for the animations
is initialized may help to solve this mistery.

EDIT

Last night the modding demons visited my dreams and said to me:
"Arsil, don't you remember that some ituns set posture preconditions?".
So I tried creating an itun for the interaction but sadly to no avail.
At least you can use it to set the skill threshold and filtering the age...
and seeing that they are not working either I realized that my itun is being ignored,
so I still maintain the foolish hope that maybe it can take care of the routing.

What I'm doing wrong? I tried all the commented names for the interaction.

Code:
<?xml version="1.0"?>
<base>
	<!--<Interaction name="Sims3.Gameplay.Objects.Electronics.Computer+BlogAppComputer" />-->
	<!--<Interaction name="Blackcatluna.AllowBloggingOnComputers+BlogAppComputer" />-->
	<Interaction name="Blackcatluna.AllowBloggingOnComputers+BlogAppComputer+Definition" />
	<Object name="Sims3.Gameplay.Objects.Electronics.Computer" />
	<!--<CodeVersion name="BaseGame" considerCodeVersion="False" />-->
	<CodeVersion name="EP9" considerCodeVersion="True" />
	<Current_Tuning>
		<Disallow DisallowAutonomous="True" DisallowUserDirected="False" DisallowPlayerSim="False" />
		<BaseAvailability>
			<AgeSpeciesAvail AgeSpeciesValue="T,Y,A,E" />
			<MotiveThreshold MotiveThresholdType="None" MotiveThresholdValue="0" MotiveBelowCheck="False" />
			<MoodThreshold MoodThresholdType="None" MoodThresholdValue="0" />
			<!--<SkillThreshold SkillThresholdType="None" SkillThresholdValue="0" />-->
			<SkillThreshold SkillThresholdType="SocialNetworking" SkillThresholdValue="1" />
			<ExcludingTrait type="AntiTV" />
			<Occult OccultRestrictionType="Ignore" OccultTypes="0x0" OccultTypesHumanAllowed="True" />
			<CareerThreshold CareerThresholdType="Undefined" CareerThresholdValue="0" IncludePastCareers="False" />
			<Lot AllowNonGreetedSimsIfObjectOutside="False" AllowNonGreetedSimsIfObjectOutsideUserDirected="True" AllowGreetedSims="True" AllowOnCommunityLots="True" AllowOnAllLots="True" />
			<World RestrictionType="None" Types="" Names="" />
			<Room AllowInTombRoomAutonomous="False" AllowEvenIfNotAllowedInRoomAutonomous="False" />
			<Misc DisallowedIfPregnant="False" DisallowedFromInventory="False" />
		</BaseAvailability>
		<PosturePrecondition name="Sitting" value="1">
			<Check name="InFrontOfSurfaceForTarget" />
			<Check name="ChairScootedIntoSurface" />
		</PosturePrecondition>
		<PosturePrecondition name="Standing" value="1">
			<Check name="TargetInInventory" />
		</PosturePrecondition>
		<Check type="SelfRegarding" value="1.5" />
		<Check type="InappropriateForVisitor" value="0.5" />
		<Check type="All" value="0" />
		<Tradeoff name="BlogAppComputer">
			<Localization autoGenerate="False" />
			<Time value="1" addRoute="True" />
			<Exit funExit="False" stressExit="False" interruptible="False" />
			<RouteLeadIn allowed="True" />
			<AskJoinInteraction joinable="False" />
			<AllowAutonomousReinforcement allowPraise="False" allowScold="False" />
			<ScoringFunction alwaysChooseBest="False" name="" specificCommodity="None" />
			<ActionTopic name="" ActionTopicUnavailableAfterActionFinishes="False" />
			<Output>
			</Output>
		</Tradeoff>
	<Notes Notes="" DesignerNotes="EP9 - Arsil" LastChange="10/04/2014 9:25:00 AM" />
	</Current_Tuning>
</base>
Test Subject
Original Poster
#12 Old 4th Oct 2014 at 2:09 PM Last edited by bleuminuit : 4th Oct 2014 at 5:36 PM.
The name of my interaction is actually Blackcatluna.AllowBloggingOnComputers.BlogAppComputer. The namespace.object+interaction format is only used when it's an interaction class inside an object's class, unlike mine who should be written in the namespace.interaction format since it's a standalone interaction injected through an instantiator class.

I didn't mentionned it in my last post, but I also looked at the startComputing loop. However, I told myself that it couldn't be it since it was present everywhere in EA and other modders' computer interactions so I suspected the BlogAppDialog instead. I was really going in the wrong direction!

Looks like it was also a bad idea to clone my ITUN from the blog app's one, no wonder the posture preconditions were missing...
I'm gonna try again with them.

Edit: Nope, still not working. I also just noticed that the game ignores my ITUN too, what the heck?

One more edit: I added +Definition to the interaction name and it works!!!
Thanks for the help Arsil!
Inventor
#13 Old 5th Oct 2014 at 2:46 PM
Good job. You made me learn a lot, so thank you too.
Test Subject
#14 Old 12th Oct 2014 at 6:25 PM
Well it could be you didn't extract the whole file into the sims 3 computer file, it is common that , that happens Hopefully this helps!
Test Subject
#15 Old 1st Aug 2017 at 5:31 AM
Default Does it work now? Where can I download it?
Quote: Originally posted by Blackcatluna
The name of my interaction is actually Blackcatluna.AllowBloggingOnComputers.BlogAppComputer. The namespace.object+interaction format is only used when it's an interaction class inside an object's class, unlike mine who should be written in the namespace.interaction format since it's a standalone interaction injected through an instantiator class.

I didn't mentionned it in my last post, but I also looked at the startComputing loop. However, I told myself that it couldn't be it since it was present everywhere in EA and other modders' computer interactions so I suspected the BlogAppDialog instead. I was really going in the wrong direction!

Looks like it was also a bad idea to clone my ITUN from the blog app's one, no wonder the posture preconditions were missing...
I'm gonna try again with them.

Edit: Nope, still not working. I also just noticed that the game ignores my ITUN too, what the heck?

One more edit: I added +Definition to the interaction name and it works!!!
Thanks for the help Arsil!
Does it work now? Can i download it?
Virtual gardener
staff: administrator
#16 Old 1st Aug 2017 at 1:27 PM
Please don't resurrect 3 years old threads please I'm sure if it works, they would have uploaded it somewhere, unless it's a private download/project of course

Thread closed!
Locked thread | Locked by: Greenplumbbob Reason: Necromancy
Back to top