Replies: 51 (Who?), Viewed: 46801 times.
Page 1 of 3
Retired Duck
retired moderator
Original Poster
#1 Old 3rd Mar 2007 at 12:05 PM Last edited by Echo : 18th Mar 2007 at 4:13 AM.
Default Tutorial: Making a better interaction - Entries, exits, skills and motives
Making a better interaction - Entries, exits, skills and motives

This tutorial is, loosely, a sequel to the "Making Your First Custom BHAV" tutorial already posted. I very strongly recommend attempting that tutorial before trying to do anything here.

The tutorial does assume strong familiarity with SimPE, and a general understanding of BHAVs. If you got through the first tutorial then spent a few hours playing around on your own, you should be able to do this.

The tutorial covers standard entries and exists, and the proper way to make sims earn skills and build motives in interactions.

A pdf version is attached to this post in "interaction2.zip", as is a package file ("echo-tutorial-2.zip") containing the end product for comparisons. If you cannot read pdf files for some reason, there is an straight HTML version available online here.

If you have a question about something in the tutorial which nobody has asked yet, then please post your question here so everyone can benefit from the answer. When posting questions, please attach everything which could be helpful to me in diagnosing the problem. That includes the package you're working on, and any error logs that you game has produced while running it.

Good luck with the tutorial, and if you have any suggestions, corrections or other feedback, then please share them with me. If nothing else, I can try to integrate it into whichever tutorial I attempt next. Enjoy!
Download - please read all instructions before downloading any files!
File Type: zip interactions2.zip (487.7 KB, 981 downloads) - View custom content
File Type: zip echo-tutorial-2.zip (313.1 KB, 593 downloads) - View custom content
Advertisement
Lab Assistant
#2 Old 14th Mar 2007 at 9:13 PM
Thank you so much Echo!
I hope I will have the time to try it this weekend. As always it is very well explained. You make such great turorials
Lab Assistant
#3 Old 17th Mar 2007 at 5:16 PM Last edited by solfal : 17th Mar 2007 at 6:47 PM.
I had so much fun testing this and my little toddler did gain skills just fine. (still looking for the value to gain logic skill)

The dialog box showed up but there was tree of them in a row, next time I tested there were four and last time there were nine dialog boxes. Seems they are stored somehow but I don´t understand where?

Great tutorial, so easy to follow!
Download - please read all instructions before downloading any files!
File Type: rar SolfalToddlerStemBoat0703.rar (33.0 KB, 41 downloads) - View custom content
Retired Duck
retired moderator
Original Poster
#4 Old 18th Mar 2007 at 4:12 AM
Hi Solfal,

The values for different skills are all listed here, if it's any help:
http://www.modthesims2.com/showthread.php?t=187257

I'll take a look at the object in game soon, but just from a quick check in SimPE I can see one thing which doesn't look quite right... In your loop, you cycle right back to the "Standard Entry", then re-run the "skill start". Those two commands should happen before the loop starts, because you only want to enter and start once at the start, then loop the animations, then stop and exit at the end. You've got the stop and exit correct at the end, you just have to set the loop to jump back to the node after the "Skill - Start".
Lab Assistant
#5 Old 18th Mar 2007 at 11:08 AM
Thank you so much Echo!
I feel so stupid. It was very clear in the tutorial that you sholdn´t include the skill start in the loop and still I did. (The skill point were earned very fast because of this!)
When I changed that it workes perfectly. I am so happy to be able to do this.

The information about the different skills is great. Thank you for the link.
Retired Duck
retired moderator
Original Poster
#6 Old 18th Mar 2007 at 11:56 AM
No probs, glad that solved the problem! And it's an easy mistake to make, I've done similar in the past and ended up with all sorts of things happening way too quickly. You'll have to point me in the right direction when you've got it all working, it looks cute!
Lab Assistant
#7 Old 19th Mar 2007 at 9:42 PM
I am so proud of your interest in my little toy so I decided to uppload one version here and one at TSR.

I did spend two days trying to understand why I got an error when two toddlers tried to play with it at the same time. When I had changed almost everything I realised I had to set the first "go to routing slot" to falce target return falce instead of error. Easy fix when I finally discovered it
Test Subject
#8 Old 20th Mar 2007 at 10:16 AM
Hey, I'm an ametuer programmer with a Sims passion and I've just recently (like today) been reawaken to The Sims and want to try my programming skills with The Sims 2 now. Unfortunately I'm at work right now so I can't see any of these downloads at the time. I just wanted to know before I get started: do these tutorials cover how to edit interactions with other sims? Such as, you know, slap and hug and what have you. See I'm trying to add some interactions which may be innappropriate to discuss but for all intent and purposses will hopefully make my sims' lives a little more real. One, for example, would be teenage and young adult woohooing and some interactions with ghost sims.

So to go back to my question (I know, I like to talk :P): can I edit bhavs that deal with sim-to-sim interactions? Or am I just talking gibberish and should just learn patience and explore these downloads when I get home? (I can't help it, I'm so excited) :P

Thanks
Forum Resident
#9 Old 20th Mar 2007 at 1:20 PM Last edited by JohnBrehaut1 : 20th Mar 2007 at 1:23 PM. Reason: typo
janusmaguszeal, Yes it is possible to make sim-to-sim interactions, though this tutorial does not specifically deal with it, but it will definately help with the social interaction, because it uses entries and exits.
Retired Duck
retired moderator
Original Poster
#10 Old 30th Mar 2007 at 1:58 AM
Solfal - The boat is so cute! Thank you for sharing it here so I can play with it! :D

Janus - sorry for the slow response, I've been unable to use a computer for several days. As John pointed out, what you have described is certainly possible. This tutorial and its predecessors focus primarily on sim-object interactions, as they are considerably easier to make and understand, but the basic principle is the same. If you make it through these tutorials okay, then do a search on Social Plugin objects. They're the mechanism that allows modders to add new sim-sim interactions. But I'd strongly recommend working through sim-object interactions first, since they're much more straightforward!
Scholar
#11 Old 13th Apr 2007 at 6:27 PM
Another great tutorial, Echo.

I had the same problem with the slot error - it's something to check if your object has a slot that you are using.

My object was originally cloned from a stereo, and I used the "Repair" slot

Maxis seemed to set these to "error" instead of "false" - or maybe I accidentally did that somewhere along the line...

I also found it was possible to leave in the regular radio functions (dance and Work Out) since they don't use a slot. I did have to make the skill message suitable for both Work Out and Mechanical Skill since I didn't see any way to separate the messages - both skills use the same message when a point is gained, so I just made it say (Sim's name) has gained a skill point, leaving out the skill name.

I also wanted the catalog description to come up correctly with both
+ Body and
+ Mechanical

I did manage this, by playing with the ratingSkillFlags setting in the Object Data section in SimPE - but I had to do it by trial and error since I didn't know how to correctly combine the numbers. Is there a listing of these somewhere?
Screenshots
Retired Duck
retired moderator
Original Poster
#12 Old 14th Apr 2007 at 7:46 AM
The slot error is unusual - none of the code in this tutorial actually touches slots at all... Or was it something else which you were changing?

It should be possible to separate the messages for skill gain, but it's not immediately obvious how.

The easiest way I can think of to do it would be to create an attribute called, say, "Current Skill". When you start an interaction which is building body skill, set that attribute to 0x0. When you start an interaction which is building mechanical skill, set that attribute to 0x1. Now, go to the text list with the dialog text in it, and enter in your alternative dialog message in an empty line.

Now, in the CT function, put a check right before the "dialog" command. If the attribute is set to 0x1, then run the existing dialog command. If not, then run a different dialog command. You'll need to make the new dialog command identical to the existing one to start with. Then, if you use the instruction wizard on that command, there's a box labelled "Message". Use that to point to your newly added message. Voila! Should work.

Alas, I don't have a list of the ratingSkillFlags, but I can tell you that it is a flag field. That means that the best way to edit it is to go into "binary" mode. In that mode, each digit in the field represents one skill type. If the digit is 1, it lists that skill. If the digit is 0, it doesn't list that skill.

I might put together a list later and add it to the tutorial, but no promises.
Field Researcher
#13 Old 4th May 2007 at 10:07 PM
Echo, I'm having a bit of a problem with the personality bonuses part of the tutorial. Where you say put 0x02EE the current version of the PJSE instruction wizard will only accept 4 entries 0x02. Is this alright or is there a way to get it to enter correctly?
Retired Duck
retired moderator
Original Poster
#14 Old 5th May 2007 at 12:30 AM
Well that's weird... I might have to run that by Peter Jones, see if there's a reason it was changed. In any case, you can enter the parameters directly thus:
07 06 00 07 EE 02 00 00
00 00 00 00 01 00 00 00

And if you want there are details on how to translate the list of parameters into the operands here:
http://www.modthesims2.com/showthread.php?t=212101
under the "Passing variables to functions" section.
Field Researcher
#15 Old 5th May 2007 at 9:04 PM
Okay, thanks. And thanks for the link to the Data Types information. That'll probably come in handy in the future.

BTW is there a list of the literal codes for the personalities somewhere. I need to have the active personally get a skill boost on my object and I'm assuming it's somewhere within the 0x1-0x9 range at least, but a list would save alot of trial and error.
Scholar
#16 Old 17th May 2007 at 5:51 PM
Thanks you so much for this tutorial Echo. You are so good at writing very easy to understand tutorials.

I think it'd be very helpful if this was listed in the wiki listing. With something to the effect that it teaches us how to make our items give skill points. I tried to figure out for a couple of days why the ct skill gain dialog wasn't using the correct terms. I had an idea that it was in the STR but just couldn't find it. You really saved me with this tutorial.

If you have a the time I'd love to see a tutorial on object placement. I'm tring to find out how to set something on water and Numenor info doesn't include it.

Your tutorials have been so helpful to me, with pics and examples you makes it so much easier to learn.

Thanks so very much!
Retired Duck
retired moderator
Original Poster
#17 Old 18th May 2007 at 11:21 AM
Thank you for the lovely comments, they're much appreciated!

As for making something placeable on water, just add one of these commands to your init function:

[prim 0x0002] Expression (My 0x002A (placement flags) Set Flag flag# Literal 0x000F (allow on water surface))
or
[prim 0x0002] Expression (My 0x002A (placement flags) Set Flag flag# Literal 0x0003 (allow under water))
Scholar
#18 Old 18th May 2007 at 2:49 PM
Field Researcher
#19 Old 19th Jul 2007 at 8:35 PM
Quote:
Originally Posted by Dr Pixel
I did manage this, by playing with the ratingSkillFlags setting in the Object Data section in SimPE - but I had to do it by trial and error since I didn't know how to correctly combine the numbers. Is there a listing of these somewhere?


The skill flags are:
Cleaning 0080
Cooking 0001
Charisma 0020
Mechanical 0002
Creativity 0010
Body 0008
Logic 0004

To get more than one to show up at the same time you have to add them together in hex. So "+Mechanical, +Body" would be 000A. "+Mechanical, +Body, +Creativity" would be 001A.

Given that it's been a few months, I'm sure you have already figured that out, but someone else might be looking for the answer too.
Instructor
#20 Old 12th Aug 2007 at 5:11 AM
Echo - Thanks for some really super tutorials! I love this series you have made and am learning tons!

I am working through this tutorial and I have a small question. I have gotten all the way to where the dialog box comes up and decided to test that. It worked great but I noticed that the thought bubbles were not appearing above my dollies head like happens when you skill charisma with the mirror. I skimmed through the rest of the tutorial but didn't see that part included. Is it just my game not showing them up or do these need to be added seperately? Just curious.

Once I get finished with this tutorial I plan on working on skilling paintings for a gallery/art school and would like to have paintings appear above the dollies head such that it looks as though they are commenting on the paintings while learning charisma. Is this something that is possible to do? I have more questions regarding my skilling paintings but will hold off on that till I am through with these tuts....in case my questions are answered there.
Retired Duck
retired moderator
Original Poster
#21 Old 12th Aug 2007 at 5:27 AM
The though bubbles are created completely independently to the skill point code. It's a bit like setting up the animations sims play which they're skilling - you have to specify which animations to play and when/how to play them, they don't start with the skill code itself.

It is possible to start these bubbles using BHAVs, but I don't think there are any tutorials covering it at present. If you want to have them, your best option is to look for some code already in the game which does this, then try and copy it in your new function.
Instructor
#22 Old 12th Aug 2007 at 8:34 AM
Thanks Echo...I may just try that...I am finished with the tutorial now and have started working on my first painting. So far I have gotten everything the way I want it but I was wondering how to increase an interest while skilling. I figure it probably includes a My person data statement somewhere in the skilling loop. Am I even close?
Retired Duck
retired moderator
Original Poster
#23 Old 12th Aug 2007 at 9:04 AM
Probably, yep. Haven't tried it myself, but the interests are certainly all stored in "Person data".
Instructor
#24 Old 12th Aug 2007 at 9:09 AM
ok...I tested my new painting and it worked sort of. The view option was left alone and it works no problem. The sketch menu item just does view for now. So far I only have the study option with the charisma skill and culture interest increased working the first time through but why does it not work a second time the sim tries to use it. Any ideas?
Retired Duck
retired moderator
Original Poster
#25 Old 12th Aug 2007 at 9:18 AM
Not without seeing it, no. Post it here perhaps?
Page 1 of 3
Back to top