|Search this Thread|
|3rd Mar 2007, 12:05 PM||Tutorial: Making a better interaction - Entries, exits, skills and motives #1|
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!
38 users say thanks for this.
[ Click here to view a longer list ]
|14th Mar 2007, 09:13 PM||#2|
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
|17th Mar 2007, 05:16 PM||#3|
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!
|18th Mar 2007, 04:12 AM||#4|
The values for different skills are all listed here, if it's any help:
I'll take a look at the object in game soon, but just from a quick check in 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".
|18th Mar 2007, 11:08 AM||#5|
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.
|18th Mar 2007, 11:56 AM||#6|
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!
|19th Mar 2007, 09:42 PM||#7|
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
|20th Mar 2007, 10:16 AM||#8|
Join Date: Dec 2006
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
|20th Mar 2007, 01:20 PM||#9|
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.
|30th Mar 2007, 01:58 AM||#10|
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 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!
|13th Apr 2007, 06:27 PM||#11|
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
I did manage this, by playing with the ratingSkillFlags setting in the Object Data section in - 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?
|14th Apr 2007, 07:46 AM||#12|
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.
|4th May 2007, 10:07 PM||#13|
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?
|5th May 2007, 12:30 AM||#14|
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:
under the "Passing variables to functions" section.
|5th May 2007, 09:04 PM||#15|
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.
|17th May 2007, 05:51 PM||#16|
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!
|18th May 2007, 11:21 AM||#17|
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))
[prim 0x0002] Expression (My 0x002A (placement flags) Set Flag flag# Literal 0x0003 (allow under water))
|18th May 2007, 02:49 PM||#18|
Thanks so much Echo.
|19th Jul 2007, 08:35 PM||#19|
Join Date: Sep 2005
The skill flags are:
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.
|12th Aug 2007, 05:11 AM||#20|
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.
|12th Aug 2007, 05:27 AM||#21|
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.
|12th Aug 2007, 08:34 AM||#22|
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?
|12th Aug 2007, 09:04 AM||#23|
Probably, yep. Haven't tried it myself, but the interests are certainly all stored in "Person data".
|12th Aug 2007, 09:09 AM||#24|
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?
|12th Aug 2007, 09:18 AM||#25|
Not without seeing it, no. Post it here perhaps?