PDA

View Full Version : How to make social interactions/ sim pie menu?


deathealer
26th Aug 2011, 12:12 AM
I was wondering how do you make a custom social interaction? for example an interaction that could make plantsims feed off of people for an increased water motive. i tried reading the thread about this with cloning the social download test but i didnt understand it. ive made a modded painting that increases motives/ animates sim, if that helps and im familiar with simpe. please help me out?

maybesomethingdunno
27th Aug 2011, 04:48 AM
Check out this thread (http://www.modthesims.info/showthread.php?t=451218), specifically Echo's post.


The second piece of advice I'd give is not to use the Social Download Test. I know that's what the thread tells you to use, but it's buggy and in need of some serious pruning before its usable. Instead, you might find it easier to take one of the social objects already available for download and reverse engineer that instead. You're welcome to use the ones here: http://modthesims.info/d/258224 (if you're changing it significantly, no credit is required). It has self-interactions and multiple-sim interactions so it should cover most of what you need.

deathealer
27th Aug 2011, 08:46 PM
Check out this thread (http://www.modthesims.info/showthread.php?t=451218), specifically Echo's post.

thanx man i been workin on one for like 3 hours now idk if itll work but ill try it out n see

deathealer
28th Aug 2011, 04:50 PM
thanx man i been workin on one for like 3 hours now idk if itll work but ill try it out n see

hey man my object aint workin can you take a look at it?

maybesomethingdunno
29th Aug 2011, 04:27 AM
Okay. I have not tested this in game. But for starters, you have three BHAVs with the same Instance number. That's certainly not good. The Instance number is how the game know what is what. If they all have the same number, how is the game going to know which one is the one you want? The True Target for your "CT - Object Menu" and "CT - Object Menu Command" BHAVs point to nonexistent nodes. That also can't be good. I am not certain if the init in the OBJF should be pointing to the "CT - Object Menu" BHAV...was that a change you made or was it already pointing to that BHAV? It is possible that is because of the Instance number conflict.


Looking ahead, I see [global 0x048F] Vampire - Is Sim a Vampire? (1 arg: Sim ID=Stack Object's attribute 0x0000 ("Person A")) in your "Interaction - Person A" BHAV. I don't think that is going to work unless the value of the Stack Object's "Person A" attribute is a Sim ID. However that is not even the right check for a Plant Sim. You would need to check to see if the Stack Object's person data PersonData Flags 1 has a particular flag set...in particular Const 0x0119:0x2A ("Is Plantman?" Value: 0x0009). In addition to changing it to alter the water motive, you will also need to get rid of the Vampire transformation code and anything related to the "Grand Vampire" NPC. By the looks of things, it does not seem like you have done much in terms of altering what the interaction actually does, correct?

Personally, I really think Echo's Sim Sourcery mod would be a better base as it would seem to be easier to modify (less leftover EA stuff to get rid of) and it would minimize the chance of errors should your Social object have been improperly cloned.

deathealer
30th Aug 2011, 01:36 AM
Okay. I have not tested this in game. But for starters, you have three BHAVs with the same Instance number. That's certainly not good. The Instance number is how the game know what is what. If they all have the same number, how is the game going to know which one is the one you want? The True Target for your "CT - Object Menu" and "CT - Object Menu Command" BHAVs point to nonexistent nodes. That also can't be good. I am not certain if the init in the OBJF should be pointing to the "CT - Object Menu" BHAV...was that a change you made or was it already pointing to that BHAV? It is possible that is because of the Instance number conflict.


Looking ahead, I see [global 0x048F] Vampire - Is Sim a Vampire? (1 arg: Sim ID=Stack Object's attribute 0x0000 ("Person A")) in your "Interaction - Person A" BHAV. I don't think that is going to work unless the value of the Stack Object's "Person A" attribute is a Sim ID. However that is not even the right check for a Plant Sim. You would need to check to see if the Stack Object's person data PersonData Flags 1 has a particular flag set...in particular Const 0x0119:0x2A ("Is Plantman?" Value: 0x0009). In addition to changing it to alter the water motive, you will also need to get rid of the Vampire transformation code and anything related to the "Grand Vampire" NPC. By the looks of things, it does not seem like you have done much in terms of altering what the interaction actually does, correct?

Personally, I really think Echo's Sim Sourcery mod would be a better base as it would seem to be easier to modify (less leftover EA stuff to get rid of) and it would minimize the chance of errors should your Social object have been improperly cloned.

i knew i had a TON of problems with that first one but i did just try to to use echo's magic wand mod i think it was from the link that you gave me a few posts back, and it did not work. but i am trying to make an interaction where a sim could "feed" off another sim for increased motives. i deleted all the crap involving the magic wand except for a person and a person b. i then added the animation, renamed(pie menu strings etc.), and messed with OBJD. i tried it and no interaction. i checked off what you said about my previous one and all was right but still no effect. am i using the right mod, or am i doing something wrong? i will post it if you would like to check it.

deathealer
30th Aug 2011, 01:51 AM
i knew i had a TON of problems with that first one but i did just try to to use echo's magic wand mod i think it was from the link that you gave me a few posts back, and it did not work. but i am trying to make an interaction where a sim could "feed" off another sim for increased motives. i deleted all the crap involving the magic wand except for a person and a person b. i then added the animation, renamed(pie menu strings etc.), and messed with OBJD. i tried it and no interaction. i checked off what you said about my previous one and all was right but still no effect. am i using the right mod, or am i doing something wrong? i will post it if you would like to check it.

here it is i was using the right mod but i had no effect. im thinking maybe an error with the pie menu because the feed interaction doesnt show up in the pie menu.

maybesomethingdunno
30th Aug 2011, 04:52 AM
It's not showing up because there is nothing to tell it to show up. Your object is actually going to be an off-world object. It will be somewhere floating in the Sim ether. If it were an object which could be placed on the ground or on a table, you could simply click on it and you would see the pie menus on the object itself. What you need is the social plugin to add the pie menus onto the Sims.

In Echo's mod, it is the "echo_magicwand_spellset.package" file. In it, there will be two BHAVs: "CT - Object Menu" which should act as the Guardian function for the interaction(s) and "CT - Object Menu Command" which will decide what actions will be pushed onto the Sim. Take note of the value of the Temp and the subsequent "Add/Change the Action String" nodes inside the "CT - Object Menu" BHAV. If I recall correctly, there should be a correlation with a Param (Param 0?) in the "CT - Object Menu Command" BHAV which typically used as a means of checking what interaction should be pushed. You should see a node in the "CT - Object Menu Command" BHAV which spawns a new instance of an object (using its GUID) that will be your social whose interactions can be referenced and pushed onto a Sim.

xSkyBirdx
1st Sep 2011, 03:00 AM
Ok there was some good info in this thread that helped me understand some stuff but I'm still really confused because I don't even know where to start and I can't find this info ANYWHERE...

If I want to add a new social interaction, what files do I need to include in the package, exactly? When I tried to do this, I first cloned that Social Download Test OBJD thing that now I don't think I am even supposed to use. Then I made a Pie Menu Function TTAB and in the Plugin View thing it needed a Pie String ID, an Action BHAV, and a guardian BHAV. I made a Pie Menu String TTAs and then selected it as the option in the TTAB thing and I imported clones of BHAVs from an interaction similar to the one I'm trying to make and set those to be the action and guardian BHAVs for the TAB thing.

So I thought since it had a name and a guardian and an action it would show up in the pie menu now and then I could edit the BHAVs from there, but I am obviously not doing it right because that didn't work at all. How do I even set this up so that it will be in the pie menu, like what are the bare minimum of the files I need and how do I make sure they are all set up and connected right so that I can use the interaction in the game and change what it does by editing the BHAV stuff?

Yeah I know this is probably a stupid question but I have no idea what I'm doing here trying to set this up :( Can someone please point me in the right direction?

PS: Also I had another question.. I think that when I make new things I'm supposed give them unique instances so they don't overwrite/conflict with other stuff but how do get the instance and if I just pick something random how do I know that it isn't already used? Is there like a system or a way to figure out how to change that? I never really got what to do when the tutorials told me to give it a unique instance... :/

Edit for more info: Right now when I put the package in my downloads it bugs the game out, the sims just keep resetting and can't do anything. So I think maybe I accidentally overwrote something important? (see the question in the PS... :/)

deathealer
2nd Sep 2011, 01:40 AM
It's not showing up because there is nothing to tell it to show up. Your object is actually going to be an off-world object. It will be somewhere floating in the Sim ether. If it were an object which could be placed on the ground or on a table, you could simply click on it and you would see the pie menus on the object itself. What you need is the social plugin to add the pie menus onto the Sims.

In Echo's mod, it is the "echo_magicwand_spellset.package" file. In it, there will be two BHAVs: "CT - Object Menu" which should act as the Guardian function for the interaction(s) and "CT - Object Menu Command" which will decide what actions will be pushed onto the Sim. Take note of the value of the Temp and the subsequent "Add/Change the Action String" nodes inside the "CT - Object Menu" BHAV. If I recall correctly, there should be a correlation with a Param (Param 0?) in the "CT - Object Menu Command" BHAV which typically used as a means of checking what interaction should be pushed. You should see a node in the "CT - Object Menu Command" BHAV which spawns a new instance of an object (using its GUID) that will be your social whose interactions can be referenced and pushed onto a Sim.

hey man same problem, did what you told me but what do i do from here? i extracted and imported the Launch Social BHAV form echo's thing as well as the CT menus. So what do need to do to finish it up?

deathealer
2nd Sep 2011, 01:41 AM
Ok there was some good info in this thread that helped me understand some stuff but I'm still really confused because I don't even know where to start and I can't find this info ANYWHERE...

If I want to add a new social interaction, what files do I need to include in the package, exactly? When I tried to do this, I first cloned that Social Download Test OBJD thing that now I don't think I am even supposed to use. Then I made a Pie Menu Function TTAB and in the Plugin View thing it needed a Pie String ID, an Action BHAV, and a guardian BHAV. I made a Pie Menu String TTAs and then selected it as the option in the TTAB thing and I imported clones of BHAVs from an interaction similar to the one I'm trying to make and set those to be the action and guardian BHAVs for the TAB thing.

So I thought since it had a name and a guardian and an action it would show up in the pie menu now and then I could edit the BHAVs from there, but I am obviously not doing it right because that didn't work at all. How do I even set this up so that it will be in the pie menu, like what are the bare minimum of the files I need and how do I make sure they are all set up and connected right so that I can use the interaction in the game and change what it does by editing the BHAV stuff?

Yeah I know this is probably a stupid question but I have no idea what I'm doing here trying to set this up :( Can someone please point me in the right direction?

PS: Also I had another question.. I think that when I make new things I'm supposed give them unique instances so they don't overwrite/conflict with other stuff but how do get the instance and if I just pick something random how do I know that it isn't already used? Is there like a system or a way to figure out how to change that? I never really got what to do when the tutorials told me to give it a unique instance... :/

Edit for more info: Right now when I put the package in my downloads it bugs the game out, the sims just keep resetting and can't do anything. So I think maybe I accidentally overwrote something important? (see the question in the PS... :/)

hey mate, i'm no expert but pm me so i dont have to write a long freakin post. but like i said i'm no expert, i can try to help you but i'm learnin too.

maybesomethingdunno
2nd Sep 2011, 06:00 AM
deathealer: I don't have time tonight to look at the file. My time has become sadly limited lately. But you probably should have 2 package files: one which contains the Person A/Person B interaction and the other which adds the pie menu and spawns and then pushes the interaction. Don't try to import everything into the same package. What you described sounds like the problem in the thread I linked to in Post #2.

xSkyBirdx: Have you worked with BHAVs before? If not, you really should complete this tutorial (http://www.modthesims.info/showthread.php?t=142907) first. Wiki entry about SimPE Resources Editing: Instances (http://www.modthesims.info/wiki.php?title=Programming_Info#Instance). Two separate packages can have a resource of the same instance. So two package files can each have a BHAV of instance value of 0x1005, but there cannot be two BHAVs of instance value of 0x1005 in the same package file. As far as I know, they can be completely arbitrary, but what matters is that they are unique within the package and that they remain within the appropriate range. I think it would be easier to make a proper clone of a mod than to completely Frankenstein-it together. More often than not, it is better to start with a base object/mod which is most like your goal than to start from scratch. It would be hard to diagnose your mod's problem without looking at it. All I can do is to refer you back to the advice previously given in this thread and the one I linked to in Post #2.

deathealer
4th Sep 2011, 01:09 AM
deathealer: I don't have time tonight to look at the file. My time has become sadly limited lately. But you probably should have 2 package files: one which contains the Person A/Person B interaction and the other which adds the pie menu and spawns and then pushes the interaction. Don't try to import everything into the same package. What you described sounds like the problem in the thread I linked to in Post #2.

xSkyBirdx: Have you worked with BHAVs before? If not, you really should complete this tutorial (http://www.modthesims.info/showthread.php?t=142907) first. Wiki entry about SimPE Resources Editing: Instances (http://www.modthesims.info/wiki.php?title=Programming_Info#Instance). Two separate packages can have a resource of the same instance. So two package files can each have a BHAV of instance value of 0x1005, but there cannot be two BHAVs of instance value of 0x1005 in the same package file. As far as I know, they can be completely arbitrary, but what matters is that they are unique within the package and that they remain within the appropriate range. I think it would be easier to make a proper clone of a mod than to completely Frankenstein-it together. More often than not, it is better to start with a base object/mod which is most like your goal than to start from scratch. It would be hard to diagnose your mod's problem without looking at it. All I can do is to refer you back to the advice previously given in this thread and the one I linked to in Post #2.

i made 2 pkg files, one with just 2 bhavs: the person a and person b with interactions in both; and the other with 3 but with ct object menu, ct object menu command, and function init(category 56?). i tried to use another thread with some VERY specific instructions but still no help. whenever you have time just take a look at them, because i am very patient :lol: and youve helped me a lot. so here they are, i think im somewhat close.

maybesomethingdunno
5th Sep 2011, 02:15 AM
Let me start off by apologize in advance for this wall of text....

It seems you merely duplicated the Social object to try to create the social plugin object. You will need to at least import the "Function - Main" and "Function - Init" BHAVs from Echo's social plugin into your "VampIntCT" package and update the "action BHAV" fields of the "main" and "init" lines in its OBJF to point to them.

In the "CT - Object Menu" BHAV of your "VampIntCT" package, the "False Target" path for node 3 ("[prim 0x0002] Expression (Param 0x0000 == My 0x000B (object id))") points to a nonexistent node. Nodes should always either point to an existing node or return a value (e.g. True, False, or Error).

Node 4 ("[prim 0x0033] Manage Inventory (Set To Next Token Of GUID, token: GUID 0x00000980, ......") is looking into the Sim's inventory for Echo's wand so this node should be removed unless you want the presence of a wand in the inventory as a requirement. The interaction is returning false and thus concluding if a wand is not present. (If you have "Special Buttons" checked, use the "Pescado's Delete" button when deleting a node to keep the links between nodes from breaking, resulting in nodes leading to nonexistent nodes.)

Nodes 5 and 7 also have broken references for either the True or False Target paths. Node 7 should return True for its True Target Path. I believe nodes 2 and 5 are unnecessary because they are remnants of Echo's mod which refer to the Magic Skill and I think Node 3's returns path is wrong for reasons I am about to explain.

But first, I'm going to take a brief and incomplete walk through Echo's "CT - Object Menu" and explain what is going on because I think it will help you. Hopefully, I won't make too many mistakes. ;) Echo created Labels which, as the name implies, adds helpful information in the "Instruction Settings" area. This enables a person to clarify what a particular variable represents. So instead of simply "Local 0x0005 := Literal 0", you can have "Local 0x0005 (Number of Eggs remaining in the basket) := Literal 0".

It seems Param 0 is the Target Sim and Param 1 is whether or not the action is autonomous.

Node 0: [prim 0x0002] Expression (Param 0x0001 (Autonomous? (1=true)) == Literal 0x0000). Checks to see if the interaction was autonomous.

Node 1: [[prim 0x0002] Expression (My person data 0x003A (Person Age) > Const 0x0110:0x01 ("Child" Value: 0x0003))]. Checks to see if the castor (Active Sim) is older than the child stage.

Node 2: [private 0x1012] Magic - Get Skill Level (1 arg: Subject Neighbour ID=My person data 0x001F (neighbor id)). This a custom BHAV by Echo which returns the castor's Magic skill level as Temp 0.

Node 3: [prim 0x0002] Expression (Local 0x0002 (Caster's magic skill) := Temp 0x0000). Sets the Magic skill as Local 2. Any future evaluations of Local 2 (e.g. is Local 2 greater than or equal to X?) is a check to see if the Sim's skill level is high enough. This is why I don't think those nodes dealing with Local 2 are necessary in your package.

Node 4: [prim 0x0002] Expression (Param 0x0000 (Target Sim) == My 0x000B (object id)). This checks to see if the Target Sim was the Active Sim. If true, the action is a self-interaction such as the "Primp" or "Do Yoga". Your mod only proceeds if this is true and follows a broken False path if it is not (which would be the case if a second Sim is the Target Sim).

Since we are not working with self-interactions, I will following the False Target of Echo's Node 4.

Node C: [prim 0x0002] Expression (Local 0x0000 (Local 0) := Stack Object ID 0x0000). Remember that logic puzzle about a man having to carry a cabbage, a goat, and a wolf across a river in a boat which can only hold him and one other at a time? The man can't leave the wolf alone with the goat and he can't leave the goat alone with the cabbage. If he does, either the goat or the cabbage will be eaten when he's not looking. Sometimes we must juggle values in a similar way to keep from losing a value. Here we are storing the Stack Object as Local 0 because the Stack Object is about to change and we will want to be able to recover the original Stack Object.

Node D: [prim 0x0002] Expression (Stack Object ID 0x0000 := Param 0x0000 (Target Sim)). Sets the Stack Object to the Target Sim.

Node E: [prim 0x0002] Expression (Local 0x0001 (Local 1) := Stack Object's person data 0x003A (Person Age)). Stores the age of the Target Sim (now the Stack Object) as Local 1.

Node F: [prim 0x0002] Expression (Stack Object ID 0x0000 := Local 0x0000 (Local 0)). Returns the Stack Object back to its original value.

Node 10: [prim 0x0002] Expression (Local 0x0001 (Local 1) > Const 0x0110:0x01 ("Child" Value: 0x0003)). This checks to see if the stored age of the Target Sim is above the childhood stage. You will likely want the False Target path to return False, but the True Target path to go to next node.

The rest of the BHAV mainly deals with the Magic skill. For example, if the Magic skill above level 9, then Temp 0 := Literal X and Add/Change the Action String. Else, check to see if it is above level 8 in which case Temp 0 := Literal X+1 and Add/Change the Action String. Else, check to see if it is above level 7, in which case Temp 0 := Literal X+2 and Add/Change the Action String....and so forth.

The "Expression (Temp 0x0000 := Literal 0x000X)" calls are there so that, if your "CT - Object Menu" call adds more than one pie menu option, you can tell which one was clicked in you "CT - Object Menu Command" code. Whichever value was in Temp 0 at the time when the "Add/Change the Action String" was called, will end up in param 0x01 of "CT - Object Menu Command"

Which takes us to your "CT - Object Menu Command" BHAV....

Node 0: [prim 0x0002] Expression (Param 0x0001 == Literal 0x0000). Param 1 is whatever Temp 0 was before the "Add/Change the Action String" was called, so Param 1 should be Literal 1 according to your "CT - Object Menu" BHAV.
The way you have it is a little backwards since you know what the value is going to be.
You typically check against known, valid possibilities and leave the "if all else fails" paths to the unanticipated scenarios. (It would be better to say "Is the Param == Known Valid/Possible Value? If so, proceed; else, return false." Instead, you are saying "Param == Known Value to be False/Invalid/Unlikely?").
But technically speaking, this should still work in this particular instance.

Since Literal 1 does not equal Literal 0, the False Target path is taken, leading to a node which spawns a new instance of the social object. We do want the social object created, however this node's True Target does not lead anywhere (there is no node 0x000B) or return anything. Even if it simply returned True, it would create an instance of the social object but then say "okay, I'm done." It would not push any interactions.

You need to import the "Social - Launch Social" BHAV from Echo's social plugin.

After you spawn the social object, you can proceed to the "Social - Launch" BHAV, since you are only adding one interaction (and thus no real need to check the value of Param 1 in the event of additional interactions). The "Social - Launch" BHAV needs 3 values.

Unless, I'm mistaken: the first is Param 0x0000, the second will be the Literal number for the interaction for Sim A (from the Pie Menu functions of the social object), and the third will be the Literal value for Sim B (again from the Pie Menu functions of the social object) which should also happen to be the value of Param 1. :) Since you are only adding one interaction, there is no real need to check against the value of Param 1 and so you could probably just insert Param 1 directly into the "Social - Launch" BHAV as the third argument.


Whew! There may be mistakes that I didn't catch (in my post or in your packages) but hopefully not. Let's see where this takes us for now. :)

deathealer
5th Sep 2011, 06:23 PM
Let me start off by apologize in advance for this wall of text....

It seems you merely duplicated the Social object to try to create the social plugin object. You will need to at least import the "Function - Main" and "Function - Init" BHAVs from Echo's social plugin into your "VampIntCT" package and update the "action BHAV" fields of the "main" and "init" lines in its OBJF to point to them.

In the "CT - Object Menu" BHAV of your "VampIntCT" package, the "False Target" path for node 3 ("[prim 0x0002] Expression (Param 0x0000 == My 0x000B (object id))") points to a nonexistent node. Nodes should always either point to an existing node or return a value (e.g. True, False, or Error).

Node 4 ("[prim 0x0033] Manage Inventory (Set To Next Token Of GUID, token: GUID 0x00000980, ......") is looking into the Sim's inventory for Echo's wand so this node should be removed unless you want the presence of a wand in the inventory as a requirement. The interaction is returning false and thus concluding if a wand is not present. (If you have "Special Buttons" checked, use the "Pescado's Delete" button when deleting a node to keep the links between nodes from breaking, resulting in nodes leading to nonexistent nodes.)

Nodes 5 and 7 also have broken references for either the True or False Target paths. Node 7 should return True for its True Target Path. I believe nodes 2 and 5 are unnecessary because they are remnants of Echo's mod which refer to the Magic Skill and I think Node 3's returns path is wrong for reasons I am about to explain.

But first, I'm going to take a brief and incomplete walk through Echo's "CT - Object Menu" and explain what is going on because I think it will help you. Hopefully, I won't make too many mistakes. ;) Echo created Labels which, as the name implies, adds helpful information in the "Instruction Settings" area. This enables a person to clarify what a particular variable represents. So instead of simply "Local 0x0005 := Literal 0", you can have "Local 0x0005 (Number of Eggs remaining in the basket) := Literal 0".

It seems Param 0 is the Target Sim and Param 1 is whether or not the action is autonomous.

Node 0: [prim 0x0002] Expression (Param 0x0001 (Autonomous? (1=true)) == Literal 0x0000). Checks to see if the interaction was autonomous.

Node 1: [[prim 0x0002] Expression (My person data 0x003A (Person Age) > Const 0x0110:0x01 ("Child" Value: 0x0003))]. Checks to see if the castor (Active Sim) is older than the child stage.

Node 2: [private 0x1012] Magic - Get Skill Level (1 arg: Subject Neighbour ID=My person data 0x001F (neighbor id)). This a custom BHAV by Echo which returns the castor's Magic skill level as Temp 0.

Node 3: [prim 0x0002] Expression (Local 0x0002 (Caster's magic skill) := Temp 0x0000). Sets the Magic skill as Local 2. Any future evaluations of Local 2 (e.g. is Local 2 greater than or equal to X?) is a check to see if the Sim's skill level is high enough. This is why I don't think those nodes dealing with Local 2 are necessary in your package.

Node 4: [prim 0x0002] Expression (Param 0x0000 (Target Sim) == My 0x000B (object id)). This checks to see if the Target Sim was the Active Sim. If true, the action is a self-interaction such as the "Primp" or "Do Yoga". Your mod only proceeds if this is true and follows a broken False path if it is not (which would be the case if a second Sim is the Target Sim).

Since we are not working with self-interactions, I will following the False Target of Echo's Node 4.

Node C: [prim 0x0002] Expression (Local 0x0000 (Local 0) := Stack Object ID 0x0000). Remember that logic puzzle about a man having to carry a cabbage, a goat, and a wolf across a river in a boat which can only hold him and one other at a time? The man can't leave the wolf alone with the goat and he can't leave the goat alone with the cabbage. If he does, either the goat or the cabbage will be eaten when he's not looking. Sometimes we must juggle values in a similar way to keep from losing a value. Here we are storing the Stack Object as Local 0 because the Stack Object is about to change and we will want to be able to recover the original Stack Object.

Node D: [prim 0x0002] Expression (Stack Object ID 0x0000 := Param 0x0000 (Target Sim)). Sets the Stack Object to the Target Sim.

Node E: [prim 0x0002] Expression (Local 0x0001 (Local 1) := Stack Object's person data 0x003A (Person Age)). Stores the age of the Target Sim (now the Stack Object) as Local 1.

Node F: [prim 0x0002] Expression (Stack Object ID 0x0000 := Local 0x0000 (Local 0)). Returns the Stack Object back to its original value.

Node 10: [prim 0x0002] Expression (Local 0x0001 (Local 1) > Const 0x0110:0x01 ("Child" Value: 0x0003)). This checks to see if the stored age of the Target Sim is above the childhood stage. You will likely want the False Target path to return False, but the True Target path to go to next node.

The rest of the BHAV mainly deals with the Magic skill. For example, if the Magic skill above level 9, then Temp 0 := Literal X and Add/Change the Action String. Else, check to see if it is above level 8 in which case Temp 0 := Literal X+1 and Add/Change the Action String. Else, check to see if it is above level 7, in which case Temp 0 := Literal X+2 and Add/Change the Action String....and so forth.


Which takes us to your "CT - Object Menu Command" BHAV....

Node 0: [prim 0x0002] Expression (Param 0x0001 == Literal 0x0000). Param 1 is whatever Temp 0 was before the "Add/Change the Action String" was called, so Param 1 should be Literal 1 according to your "CT - Object Menu" BHAV.
The way you have it is a little backwards since you know what the value is going to be.
You typically check against known, valid possibilities and leave the "if all else fails" paths to the unanticipated scenarios. (It would be better to say "Is the Param == Known Valid/Possible Value? If so, proceed; else, return false." Instead, you are saying "Param == Known Value to be False/Invalid/Unlikely?").
But technically speaking, this should still work in this particular instance.

Since Literal 1 does not equal Literal 0, the False Target path is taken, leading to a node which spawns a new instance of the social object. We do want the social object created, however this node's True Target does not lead anywhere (there is no node 0x000B) or return anything. Even if it simply returned True, it would create an instance of the social object but then say "okay, I'm done." It would not push any interactions.

You need to import the "Social - Launch Social" BHAV from Echo's social plugin.

After you spawn the social object, you can proceed to the "Social - Launch" BHAV, since you are only adding one interaction (and thus no real need to check the value of Param 1 in the event of additional interactions). The "Social - Launch" BHAV needs 3 values.

Unless, I'm mistaken: the first is Param 0x0000, the second will be the Literal number for the interaction for Sim A (from the Pie Menu functions of the social object), and the third will be the Literal value for Sim B (again from the Pie Menu functions of the social object) which should also happen to be the value of Param 1. :) Since you are only adding one interaction, there is no real need to check against the value of Param 1 and so you could probably just insert Param 1 directly into the "Social - Launch" BHAV as the third argument.


Whew! There may be mistakes that I didn't catch (in my post or in your packages) but hopefully not. Let's see where this takes us for now. :)

ok i tried my best to do what you described and i thought i had everything somewhat decent until the part with social launch interaction. i could not find the literal number for person A. that and i deleted everything you said unnecessary, so i probably deleted everything to do with echo. so i tried it out and you know what happened or i wouldnt be typing this :faceslap: so what do i do from here?

maybesomethingdunno
6th Sep 2011, 02:27 AM
In your "CT - Object Menu" BHAV, the False Target for node 1 is broken, as it leads to a nonexistent node. Do you see how the red False path line leads to a "?" ? It has that question mark because you have that node pointing to a nonexistent node 0x0009. The node 2 ("Add/Change Action String" BHAV) is orphaned since nothing leads to it. (Node 0 is an exception in that it does not necessarily need to have a node pointing to it since node 0 is automatically run, but if nothing points to a node is has that gray arrow pointing to the node indicating it is orphaned.) I think you may have deleted too much. You need a node which sets Temp 0 as a literal value. From Echo's "CT - Object Menu" BHAV, I would keep node 0 (0x0), 1 (0x1), 4 (0x4), 12 (0xC), 13 (0xD), 14 (0xE), 15 (0xF), and 16 (0x10) to keep the Age-related checks. You don't want the interaction showing up on Sims it shouldn't; the "CT - Object Menu" BHAV works as a Guardian BHAV. Then have the Temp 0 := Literal X and the "Add/Change Action String" node.


In your "CT - Object Menu Command" BHAV, you need the "Create New Object Instance" before the "Social - Launch Social" BHAV. The social object needs to exist before it can be have its interactions pushed onto a Sim. The "Interaction A" and "Interaction B" literals come from the Pie Menu Functions in your social object. "Feed on Sim" is your Interaction A and its literal will be 0x1 because it is 0x1 in the Pie Menu Functions. Likewise, "Be Fed Upon" is your interaction B and its literal value is 0x2 because it is 0x2 in the Pie Menu Functions.

deathealer
6th Sep 2011, 03:37 AM
In your "CT - Object Menu" BHAV, the False Target for node 1 is broken, as it leads to a nonexistent node. Do you see how the red False path line leads to a "?" ? It has that question mark because you have that node pointing to a nonexistent node 0x0009. The node 2 ("Add/Change Action String" BHAV) is orphaned since nothing leads to it. (Node 0 is an exception in that it does not necessarily need to have a node pointing to it since node 0 is automatically run, but if nothing points to a node is has that gray arrow pointing to the node indicating it is orphaned.) I think you may have deleted too much. You need a node which sets Temp 0 as a literal value. From Echo's "CT - Object Menu" BHAV, I would keep node 0 (0x0), 1 (0x1), 4 (0x4), 12 (0xC), 13 (0xD), 14 (0xE), 15 (0xF), and 16 (0x10) to keep the Age-related checks. You don't want the interaction showing up on Sims it shouldn't; the "CT - Object Menu" BHAV works as a Guardian BHAV. Then have the Temp 0 := Literal X and the "Add/Change Action String" node.


In your "CT - Object Menu Command" BHAV, you need the "Create New Object Instance" before the "Social - Launch Social" BHAV. The social object needs to exist before it can be have its interactions pushed onto a Sim. The "Interaction A" and "Interaction B" literals come from the Pie Menu Functions in your social object. "Feed on Sim" is your Interaction A and its literal will be 0x1 because it is 0x1 in the Pie Menu Functions. Likewise, "Be Fed Upon" is your interaction B and its literal value is 0x2 because it is 0x2 in the Pie Menu Functions.

did everything and i made sure none of the nodes in ANY BHAV had the "?" on it or the orphan thing. i put echo's object menu in there and saved nothing except the 0,1,4,12,13,14,15,16 nodes then added temp 0x0 := literal 0x0( or 0x1, forgot) and the action string. i put in the correct literals for the launch social and put it after create object instance in object menu command. i also changed the social launch social by making it the same thing as the one in ct command. i think thats all i did and still no working. if it helps it might be the ct object menu. but here they are. P.S. thanks for replying so quick. i posted, waited, and got my answer hahaha. but thanks.

maybesomethingdunno
6th Sep 2011, 05:19 AM
For what it is worth, I set Node 2 in your "CT - Object Menu" BHAV to have the True Target return False (so it shouldn't appear on the Active Sim as a self-interaction) and I let the False target proceed to the next node. Then I had Node 8 set Temp 0 := Literal 1 just in case.

In your "CT - Object Menu Command", I selected Node 0 and clicked on the "Insert via True" button. Then reselected Node 0 and changed it to be [prim 0x0002] Expression (Param 0x0001 == Literal 0x0001) with the True Target path proceeding to Node 1 and the False Target path returning False. Again, this was just a precaution.

In your OBJF, I removed the Action BHAVs for the Goal Check and Reaction Handler lines since I don't think those are necessary (I didn't see them in Echo's mod).

Then I noticed something major. Both of your packages have the same GUID in their OBJDs, meaning they conflict with each other. Rather than having to update the BHAV which spawns the social object, I merely changed the GUID in the OBJD for the social plugin. Then the interaction showed up for me in-game. The Sim routed, but I got "IK target animation cannot find bone on other object" error on the node which plays the Sim animation.

According to the Wiki, this means that the animation played by that node requires a specific cObjectGraphNode name to be defined in the CRES of the Stack Object, which in this case would be the social object. I don't know why it is giving this error since the operands on the node seem to be correct and I do not see a CRES in either the social object or the social plugin. Hopefully Echo will chime in and clear up any confusion.

deathealer
8th Sep 2011, 12:14 AM
For what it is worth, I set Node 2 in your "CT - Object Menu" BHAV to have the True Target return False (so it shouldn't appear on the Active Sim as a self-interaction) and I let the False target proceed to the next node. Then I had Node 8 set Temp 0 := Literal 1 just in case.

In your "CT - Object Menu Command", I selected Node 0 and clicked on the "Insert via True" button. Then reselected Node 0 and changed it to be [prim 0x0002] Expression (Param 0x0001 == Literal 0x0001) with the True Target path proceeding to Node 1 and the False Target path returning False. Again, this was just a precaution.

In your OBJF, I removed the Action BHAVs for the Goal Check and Reaction Handler lines since I don't think those are necessary (I didn't see them in Echo's mod).

Then I noticed something major. Both of your packages have the same GUID in their OBJDs, meaning they conflict with each other. Rather than having to update the BHAV which spawns the social object, I merely changed the GUID in the OBJD for the social plugin. Then the interaction showed up for me in-game. The Sim routed, but I got "IK target animation cannot find bone on other object" error on the node which plays the Sim animation.

According to the Wiki, this means that the animation played by that node requires a specific cObjectGraphNode name to be defined in the CRES of the Stack Object, which in this case would be the social object. I don't know why it is giving this error since the operands on the node seem to be correct and I do not see a CRES in either the social object or the social plugin. Hopefully Echo will chime in and clear up any confusion.

i tried it and i couldnt get it to show up in game so could you maybe post those files up for me please?

xSkyBirdx
8th Sep 2011, 01:31 AM
EDIT:
MSD, you were right, there was no way I was going to be able to make this from scratch; turns out I was way off with my first attempt lol. So I started with Echo's mod like you suggested and it took me a while, but I finally the pie menu to show up. Thanks again MSD; theres no way I would have been able to do this without your help and I really appreciate your patience and detailed explanations! :DD And Death, thanks to you too because I had to use the package you uploaded to figure out what the CT- Object Menu Command was supposed to look like.

But now onto the next problem. I found the BHAVs for savage in the EA code and I imported them into mine. I fixed all the places where it said unknown BHAV by importing the missing ones from the EA code, but still no luck. The interactions show up but neither sim does anything. :( I haven't even editted the BHAVs yet, so I don't know why they don't work... Anyone have an idea of what I'm doing wrong?

By the way: Before I imported the savage BHAVs, I just had some interaction BHAVs left over from echo's mod. When I tested it with those BHAVs, one of the sims just stood there (I had deleted references to wand animations) and the other was killed by flies (ie, it worked). So, it seemed like the CT stuff was fine... just some info in case it could help you figure out the problem.

UPDATE: I did find and fix a mistake. It still doesn't work, but it probably would have caused problems (there was one unknown BHAV that I didn't fix yet). I uploaded the newer one so you can test with that instead.

deathealer
8th Sep 2011, 10:52 PM
EDIT:
MSD, you were right, there was no way I was going to be able to make this from scratch; turns out I was way off with my first attempt lol. So I started with Echo's mod like you suggested and it took me a while, but I finally the pie menu to show up. Thanks again MSD; theres no way I would have been able to do this without your help and I really appreciate your patience and detailed explanations! :DD And Death, thanks to you too because I had to use the package you uploaded to figure out what the CT- Object Menu Command was supposed to look like.

But now onto the next problem. I found the BHAVs for savage in the EA code and I imported them into mine. I fixed all the places where it said unknown BHAV by importing the missing ones from the EA code, but still no luck. The interactions show up but neither sim does anything. :( I haven't even editted the BHAVs yet, so I don't know why they don't work... Anyone have an idea of what I'm doing wrong?

By the way: Before I imported the savage BHAVs, I just had some interaction BHAVs left over from echo's mod. When I tested it with those BHAVs, one of the sims just stood there (I had deleted references to wand animations) and the other was killed by flies. So, it seemed like the CT stuff was working fine... just some info in case it could help you figure out the problem.

did you just use echo's spellset pkg and make it look similar to mine? because mine doesnt work, i extracted your social launch social bhav into mine because it was the same as echo's and it did nothing. so would you like to take a look at mine, because i can fix your interaction problem if you can fix my CT problem. it's a mmutual relationship deal :deal:

xSkyBirdx
9th Sep 2011, 12:19 AM
Alright, I downloaded your file and I did all the things that MSD said to do and in my game it showed up in the pie menu, but then the same thing happened that MSD said. Here is the package after I edited it.

I only changed one of the GUIDs and I just made it one number higher, so your package might still end up conflicting with Echo's original mod or someone elses. To be sure, you should probably click the OBJD in each of the packages and go into plugin view and then click on "get GUID" and type your user, pw, and the name of the object and then do register. It will make sure that your GUIDs aren't the same as anyone else's so they don't conflict.

Also, if you want the interaction to only show up for plantsims, here is what you do. In your "CT- Object Menu," go to the node right before the last one (#8) and click insert via true. Make it into the BHAV that tests whether your sim is a plant sim. It's probably in globals somewhere; thats where the werewolf one was when I was making mine. I didn't do it for you because I didn't know if you saved that until last on purpose so it would be easier to test or something.

Hopefully that will be some help for you and sorry I have no idea how to make them animate right (obviously, since mine doesn't work either)

EDIT: Also, if you are trying to figure out what's wrong with mine, use the updated files I just uploaded (in my last post), because I fixed something else that was probably a piece of the problem.

deathealer
10th Sep 2011, 09:26 PM
Alright, I downloaded your file and I did all the things that MSD said to do and in my game it showed up in the pie menu, but then the same thing happened that MSD said. Here is the package after I edited it.

I only changed one of the GUIDs and I just made it one number higher, so your package might still end up conflicting with Echo's original mod or someone elses. To be sure, you should probably click the OBJD in each of the packages and go into plugin view and then click on "get GUID" and type your user, pw, and the name of the object and then do register. It will make sure that your GUIDs aren't the same as anyone else's so they don't conflict.

Also, if you want the interaction to only show up for plantsims, here is what you do. In your "CT- Object Menu," go to the node right before the last one (#8) and click insert via true. Make it into the BHAV that tests whether your sim is a plant sim. It's probably in globals somewhere; thats where the werewolf one was when I was making mine. I didn't do it for you because I didn't know if you saved that until last on purpose so it would be easier to test or something.

Hopefully that will be some help for you and sorry I have no idea how to make them animate right (obviously, since mine doesn't work either)

EDIT: Also, if you are trying to figure out what's wrong with mine, use the updated files I just uploaded (in my last post), because I fixed something else that was probably a piece of the problem.

Skybird, i appreciate your help a TON i can't thank you enough. but if you don't mind me asking, what was i doing wrong on mine?(what did you change to fix it?) but anyway i'm trying my best to get the animations working on mine as we speak so when i geet mine working maybe i can make you a file that you can just change the animation on. b ut were you trying the "savage" anim? cuz i was trying the bite neck/kiss of the vampire anim and i thought this: in game, they can only bite with a high enough social right? so maybe i need to add something else to the interaction BHAVS. but i don't know on that part. but i'll let you know when i finish.(might try echo's with editing)

UPDATE:

SkyBird: i'm clueless mate, i looked over several files with both interactions person A + B and couldn't find anything. i tried extractiong and adding several as well and no help. i sent Echo, yeah that famous person, a PM for some help because i did everything i could do. sorry i let you down man i thought i had it covered... :(

deathealer
10th Sep 2011, 11:16 PM
here is my file if you wanna look at it and make some changes SkyBird (or Echo if you read my PM). Good luck mate.

xSkyBirdx
10th Sep 2011, 11:46 PM
Did you figure out how to get the anims to work right?

deathealer
11th Sep 2011, 04:13 AM
Did you figure out how to get the anims to work right?

no but d you still have the file that you talked about several posts back about that when you clicked it one sim died? if i have that file i can probably get it to work

Echo
11th Sep 2011, 01:40 PM
here is my file if you wanna look at it and make some changes SkyBird (or Echo if you read my PM). Good luck mate.

Are you running your tests with testing cheats enabled? And assuming you are, are you getting an error? (If you're not, then please try turning on testing cheats and see what you get.)

Your attachment only includes the social object, not the plugin itself. Have you been able to confirm that the social is actually getting called from your plugin?

Also, it might be worth grabbing yourself a new GUID now, rather than later. The one you're using will almost certainly clash with another mod. ;)

deathealer
11th Sep 2011, 07:12 PM
Are you running your tests with testing cheats enabled? And assuming you are, are you getting an error? (If you're not, then please try turning on testing cheats and see what you get.)

Your attachment only includes the social object, not the plugin itself. Have you been able to confirm that the social is actually getting called from your plugin?

Also, it might be worth grabbing yourself a new GUID now, rather than later. The one you're using will almost certainly clash with another mod. ;)

no i haven't been using testing cheats but i will certainly try it. i only atttached my social object not the plugin because i think the plugin works fine, it shows up in the pie menu but i will attach them both with this post. and i will also change the guid of the social object if thats what you mean. here you can take a look at my old function and my new function(the old one just says Func, the new one says test1) plus my social plugin if you want to. both function files have the same guid on purpose, i copied the old one and tested with the new one.

EDIT: i just went and changed the guid for both the social object and plugin and tried with testing cheats and it worked, but i got an error and person a did not do anything but the whole vampire bite for person b ran through

Echo
12th Sep 2011, 12:55 AM
Could you attach a copy the error log file as well? That will be the thing which explains what went wrong. :)

xSkyBirdx
12th Sep 2011, 02:11 AM
but if you don't mind me asking, what was i doing wrong on mine?(what did you change to fix it?)
All I did was what MSD said in this post:
For what it is worth, I set Node 2 in your "CT - Object Menu" BHAV to have the True Target return False (so it shouldn't appear on the Active Sim as a self-interaction) and I let the False target proceed to the next node. Then I had Node 8 set Temp 0 := Literal 1 just in case.

In your "CT - Object Menu Command", I selected Node 0 and clicked on the "Insert via True" button. Then reselected Node 0 and changed it to be [prim 0x0002] Expression (Param 0x0001 == Literal 0x0001) with the True Target path proceeding to Node 1 and the False Target path returning False. Again, this was just a precaution.

In your OBJF, I removed the Action BHAVs for the Goal Check and Reaction Handler lines since I don't think those are necessary (I didn't see them in Echo's mod).

Then I noticed something major. Both of your packages have the same GUID in their OBJDs, meaning they conflict with each other. Rather than having to update the BHAV which spawns the social object, I merely changed the GUID in the OBJD for the social plugin. Then the interaction showed up for me in-game. The Sim routed, but I got "IK target animation cannot find bone on other object" error on the node which plays the Sim animation.
I think that the main problem was the GUIDs being the same. (I'm not really sure about the the other stuff was for, honestly.)

Could you attach a copy the error log file
Echo, if you could try to help me as well, I'd really appreciate it :)
Here are my files right now (the BHAVs are still just clones of the Savage interaction; I plan on editting them, but I haven't yet since they don't work as it is).
I also attatched an error log so you an try to see what's wrong.

Echo
12th Sep 2011, 09:35 AM
Hi SkyBird :)

The error you are getting is an odd one, certainly. Are you, by any chance, testing this code in a base game starter environment?

Echo

xSkyBirdx
12th Sep 2011, 09:45 PM
Thanks for the reply, Echo.
I have Uni, NL, OFB, Pets, Season, BV, and Happy Holidays Stuff Pack installed. And I'm not using that Any Game Starter thing if that's what you mean.

deathealer
14th Sep 2011, 11:11 PM
Could you attach a copy the error log file as well? That will be the thing which explains what went wrong. :)

here's the error log file, and i saw you ask skybird about an EP/game thing and if you need to know i have double deluxe and all other individual EPs. sorry this is late had internet problems.

xSkyBirdx
20th Sep 2011, 12:53 AM
Okay, I just found a big problem in my mod: the savage interaction I imported referenced a "Watch Fight" interaction that I hadn't imported or added to my pie menu functions/strings. I thought that after I fixed this it might work, but I'm not that lucky. There's another error now, which I have attached. Here is what I found when I tried my best to read the log. The log states that the error ("Invalid constant") occurs in the BHAV "Interaction- Person A- Fight (attack B)" in node 31. I don't know what the problem with this node is thopugh, because it appears to be the same as the one in the maxis code. (I am referencing the code from the objects package in my pets folder, group 0x7F66877C.) Can someone tell me what I need to fix?
:help::help::help:

Echo
20th Sep 2011, 12:50 PM
Deathealer, you're calling an "IK" animation. That's an animation which is meant to by synched up between two sims, and as such, is really quite tricky to use.

Try switching it out for a non-IK animation (I normally test this stuff using the 'hula' animation) and see if the rest of your code works. If it does, then you either need to pick a different animation or make sure that you have a valid IK target (other sim) playing the equivalent animation at the right time.

here's the error log file, and i saw you ask skybird about an EP/game thing and if you need to know i have double deluxe and all other individual EPs. sorry this is late had internet problems.

Echo
20th Sep 2011, 12:59 PM
Skybird, once again, your code looks correct at the point where the error log says it should be failing! Just as a sanity check, change the "Const 0x1003:0x00" to "Literal 0x01BC", and see if you still get the error. (The two values should be equivalent.)

I also need to check something, because we're dealing with social objects... Have you, at any point, saved your testing lot while the social object was in your downloads? Because if you have, then you need to either delete that lot and start testing on a new one, or change the GUID on your plugin object. Social plugins are global, so they get spawned when the lot first gets created. If you save, then you save the lot with that social plugin in a particular state, which may not work with your code changes the next time around.

The last thing I'd double check is that you haven't got multiple versions of this mod in your downloads. It sounds obvious, but it's caught me out more than once!

xSkyBirdx
21st Sep 2011, 02:47 AM
:D :D :D :D :D
Yay, I just got it to work!! Idk what the problem was, I changed the thing you said and I made a new tester family (even though I'm pretty sure I never saved it- it still opened to exactly 7:55 pm, just like when I saved it like a month ago...) Hooray!! Thanks so much, Echo & MSD! :lovestruc

(Next comes the part where I have to actually EDIT the BHAVs, though... uh-oh :blink:)

Death, here's what I've got so far, but idk if it'll help you at all, based on what Echo said.

EDIT: How do you change the autonomy/advertising for a social interaction?

deathealer
24th Sep 2011, 03:52 PM
Deathealer, you're calling an "IK" animation. That's an animation which is meant to by synched up between two sims, and as such, is really quite tricky to use.

Try switching it out for a non-IK animation (I normally test this stuff using the 'hula' animation) and see if the rest of your code works. If it does, then you either need to pick a different animation or make sure that you have a valid IK target (other sim) playing the equivalent animation at the right time.

tried it with the hula animation and it worked like a charm. so i changed it to something i liked better than a hula animation and it works now so i already edited the BHAVs like i wanted them when i first got this idea so thanks Echo. but i will probably try to figure out IK animations (one's with 2 sims right?) so i can make even better ones. so thanks echo and msd.

deathealer
24th Sep 2011, 03:57 PM
:D :D :D :D :D
Yay, I just got it to work!! Idk what the problem was, I changed the thing you said and I made a new tester family (even though I'm pretty sure I never saved it- it still opened to exactly 7:55 pm, just like when I saved it like a month ago...) Hooray!! Thanks so much, Echo & MSD! :lovestruc

(Next comes the part where I have to actually EDIT the BHAVs, though... uh-oh :blink:)

Death, here's what I've got so far, but idk if it'll help you at all, based on what Echo said.

EDIT: How do you change the autonomy/advertising for a social interaction?

i found out what my problem was and it was that i dont have any freakin clue on how to use an IK animation, like the vampire one but i dont know if your werewolf one is or not. so im glad you got yours to work and i might take another look at your final with my final and see if i like where im at or not. i just used the die-sickness anim for person B and a wink gesture for Person A, but i got what i wanted in the long run. so i dont see why you would need my file except just for looking at to compare what went wrong but i'll post it anyway. thanks MSD, Echo, and Skybird( for doing this social interaction project with me on the same page).

xSkyBirdx
24th Sep 2011, 05:05 PM
i found out what my problem was and it was that i dont have any freakin clue on how to use an IK animation, like the vampire one but i dont know if your werewolf one is or not. so im glad you got yours to work and i might take another look at your final with my final and see if i like where im at or not. i just used the die-sickness anim for person B and a wink gesture for Person A, but i got what i wanted in the long run. so i dont see why you would need my file except just for looking at to compare what went wrong but i'll post it anyway. thanks MSD, Echo, and Skybird( for doing this social interaction project with me on the same page).

Well I'm not really sure if mine was an IK interaction, does that just mean one for multiple sims? If so then I guess it is. But did you just start your interaction BHAVs from scratch? Because if you did, it will probably be easier to clone a Maxis one and then modify it like I am doing. I found the code for the vampire "Bite Neck" earlier- what you have to do to get to it is in filter resources search for "0x7fb098f7". Clone everything in that group and import it into your package and then change the group numbers to #FFFFFFFF. You can delete the TTAs and TTAB and anything else you already had in yours, though. Then make sure in your TTAB you make the interactions the Maxis ones. Hopefully that will make the animations line up write since they do work in the maxis code.

But for it it to work, you will probably have to change any time it checks to see if the sim is a vampire to is it a plant sim. Also find the part that changes person B into a vampire and get rid of that too. Well, you'll probably have to edit a lot more like make it increase water and make it so person B can't reject it, but at least the animations should work ok. At least thats what I'm trying to do. And it sounds like you already know to make all the other stuff work, so hopefully it won't be too hard. I haven't even editted mine yet... (when you click it it just does the exact same thing as savage which is obviously not how I wanted it) I don't know how to change the autonomy and I want to work on changing the relationship changes, but that BHAV has way too many variables and none of them are labeled so it's really confusing... well maybe I'll be able to figure it out once I spend more time looking at it. Good luck with yours I hope you can get the animations to work right!

deathealer
26th Sep 2011, 03:54 AM
Well I'm not really sure if mine was an IK interaction, does that just mean one for multiple sims? If so then I guess it is. But did you just start your interaction BHAVs from scratch? Because if you did, it will probably be easier to clone a Maxis one and then modify it like I am doing. I found the code for the vampire "Bite Neck" earlier- what you have to do to get to it is in filter resources search for "0x7fb098f7". Clone everything in that group and import it into your package and then change the group numbers to #FFFFFFFF. You can delete the TTAs and TTAB and anything else you already had in yours, though. Then make sure in your TTAB you make the interactions the Maxis ones. Hopefully that will make the animations line up write since they do work in the maxis code.

But for it it to work, you will probably have to change any time it checks to see if the sim is a vampire to is it a plant sim. Also find the part that changes person B into a vampire and get rid of that too. Well, you'll probably have to edit a lot more like make it increase water and make it so person B can't reject it, but at least the animations should work ok. At least thats what I'm trying to do. And it sounds like you already know to make all the other stuff work, so hopefully it won't be too hard. I haven't even editted mine yet... (when you click it it just does the exact same thing as savage which is obviously not how I wanted it) I don't know how to change the autonomy and I want to work on changing the relationship changes, but that BHAV has way too many variables and none of them are labeled so it's really confusing... well maybe I'll be able to figure it out once I spend more time looking at it. Good luck with yours I hope you can get the animations to work right!

i just got it to work just like the bite neck! i compared the maxis to mine and i remembered awhile back that my STO attributes on the pop-up wizard said person a for person a BHAV and vice versa, well i checked it on the Maxis and they were opposites. so i changed them to be like the maxis ones and my anims back to the vampire ones and then it worked! so my goal is complete.

i saw you mentioned autonomy? ive seen that in the OBJD before but what does it do exactly? if you fill me in maybe i can help.

maybesomethingdunno
28th Sep 2011, 08:56 AM
Good job on getting it to work, deathealer and xSkyBirdx! :)

Whether or not an interaction is autonomous is determined by the "Autonomy" value in the TTAB (http://www.modthesims.info/wiki.php?title=TTAB). Sims are generally driven by motives. When they need to pee, they will use a toilet because a toilet advertises a Bladder benefit. The fact that the toilet's interaction actually does something about the bladder motive is how the "Hey, my Sim knew toilets are for peeing" illusion works. You could have the "Read a Book" interaction be more attractive (i.e. offer a better Bladder benefit) to a full-bladder Sim and he/she may prefer reading over using a toilet (with disastrous results if reading a book doesn't do something about that bladder motive). Of course, such false advertisement is not illegal to Sims so you can certainly do so. ;)

How attractive an interaction is and for what reason is controlled by the Motives tab (also in the TTAB). You can specify an additional motive boost for a special "Type" attribute, corresponding with an attribute for the Sim. For example, you could declare an extra Fun boost for Serious Sims to give the appearance that Serious Sims enjoy the interaction more or you can have an interaction seem to be more or less attractive as the Sim ages (as if they are out-growing their childhood toys or learning to better appreciate an activity as they age).

Clicking the Help button in the TTAB window will give an explanation of the various settings. I still don't fully understand all the values myself though. :(

xSkyBirdx
1st Oct 2011, 02:02 AM
I tried doing that, but it wasn't working. I found out that the reason was that the CT menu BHAV had this node that was disabling autonomy:
"[prim 0x0002] Expression (Param 0x0001 (Autonomous? (1=true)) == Literal 0x0000)" (false if false)
Once I deleted it it worked fine ;)
I am still changing stuff because I haven't had much time to work on it lately, but I'm making progress :)
I did want to ask, though, if I used, for example, the BHAV that checks if a sim is a vampire, does it mean that the mod wouldn't work for anyone who doesn't have nightlife or would the game just ignore it (always return false)?

deathealer
1st Oct 2011, 05:57 PM
Good job on getting it to work, deathealer and xSkyBirdx! :)

Whether or not an interaction is autonomous is determined by the "Autonomy" value in the TTAB (http://www.modthesims.info/wiki.php?title=TTAB). Sims are generally driven by motives. When they need to pee, they will use a toilet because a toilet advertises a Bladder benefit. The fact that the toilet's interaction actually does something about the bladder motive is how the "Hey, my Sim knew toilets are for peeing" illusion works. You could have the "Read a Book" interaction be more attractive (i.e. offer a better Bladder benefit) to a full-bladder Sim and he/she may prefer reading over using a toilet (with disastrous results if reading a book doesn't do something about that bladder motive). Of course, such false advertisement is not illegal to Sims so you can certainly do so. ;)

How attractive an interaction is and for what reason is controlled by the Motives tab (also in the TTAB). You can specify an additional motive boost for a special "Type" attribute, corresponding with an attribute for the Sim. For example, you could declare an extra Fun boost for Serious Sims to give the appearance that Serious Sims enjoy the interaction more or you can have an interaction seem to be more or less attractive as the Sim ages (as if they are out-growing their childhood toys or learning to better appreciate an activity as they age).

Clicking the Help button in the TTAB window will give an explanation of the various settings. I still don't fully understand all the values myself though. :(

thanks for helpin me figure it out, but thats not what im here for. I am making a telescope and what i want it to do is when you use the interaction, it puts a "shard" in your inventory and once you have the shard you can do a custom interaction. i was looking at the buy potion interaction because i knew it had some kind of BHAV that added something to your inventory. So i looked at it and the main nodes i saw useful in the "add potions" BHAV were the create object instance and the expression one with the stack object stuff and the locals, literals. so i extracted the whole file and changed the object instance to my "shard" and changed the values of the locals, literals,etc so i would be sure they didnt conflict with any values from other BHAVs in the file. i loaded it up and it didnt work, so what im asking is how do you add an object to your sims inventory and add a node that checks for that item? i will attach my telescope, my shard, and the file i was using to adjust with just in case. if you dont mind can you help me with this?

deathealer
1st Oct 2011, 05:59 PM
here they are, i forgot to add them in previous reply.

maybesomethingdunno
2nd Oct 2011, 06:27 AM
xSkyBirdx: In base or Uni-only environments (i.e. pre-Nightlife), the game engine won't recognize the BHAV. It may or may not proceed how you would expect it to. I would think that post-Nightlife games would understand it and return false if the Sim is not a vampire (which would be impossible without Nightlife). But I'm not certain. Just in case (and for good programming), you probably should perform an EP check first. Here are some related posts:
Any EP check parameters? (http://www.modthesims.info/showthread.php?t=248207)
BHAV to perform an EP check? (http://www.modthesims.info/showthread.php?t=261393)
Single Post (http://www2.modthesims.info/showpost.php?p=3643270&postcount=2)


deathealer: I don't have much time tonight, but here's what I did from an old project:
[prim 0x002A] Create New Object Instance (GUID 0x--------, place: out of world (put new object id in Stack Object), Create object normally, fail if tile is non-empty: False, pass Temp 0 to main: False, move in a new Sim: False, copying design mode materials from object in Temp 5: False)
[prim 0x0033] Manage Inventory (Add Token And Instance Info of Stack Object (include contained objects), Category: visible non-memory, Inventory (singular): Neighbor: My person data 0x001F (neighbor id))

If you just want to copy/paste, here's the Wizard code for the 0x0033 BHAV: 13121F00100000000000000000000000.

In my surfing mod, there is a "Surfing - TEST" BHAV which has a check for the presence of the surfboard in the inventory to control if the interaction appears or not. Feel free to take a peek at the code. :)

deathealer
8th Oct 2011, 09:17 PM
xSkyBirdx: In base or Uni-only environments (i.e. pre-Nightlife), the game engine won't recognize the BHAV. It may or may not proceed how you would expect it to. I would think that post-Nightlife games would understand it and return false if the Sim is not a vampire (which would be impossible without Nightlife). But I'm not certain. Just in case (and for good programming), you probably should perform an EP check first. Here are some related posts:
Any EP check parameters? (http://www.modthesims.info/showthread.php?t=248207)
BHAV to perform an EP check? (http://www.modthesims.info/showthread.php?t=261393)
Single Post (http://www2.modthesims.info/showpost.php?p=3643270&postcount=2)


deathealer: I don't have much time tonight, but here's what I did from an old project:
[prim 0x002A] Create New Object Instance (GUID 0x--------, place: out of world (put new object id in Stack Object), Create object normally, fail if tile is non-empty: False, pass Temp 0 to main: False, move in a new Sim: False, copying design mode materials from object in Temp 5: False)
[prim 0x0033] Manage Inventory (Add Token And Instance Info of Stack Object (include contained objects), Category: visible non-memory, Inventory (singular): Neighbor: My person data 0x001F (neighbor id))

If you just want to copy/paste, here's the Wizard code for the 0x0033 BHAV: 13121F00100000000000000000000000.

In my surfing mod, there is a "Surfing - TEST" BHAV which has a check for the presence of the surfboard in the inventory to control if the interaction appears or not. Feel free to take a peek at the code. :)

What i am trying to do now is actually make the shard appear in my inventory, and i tried what you said and it freezes my game to where i cant even quit! Before i had a problem to where it would freeze but eventually load and about 995 of the shards would appear in my inventory. Im not really concerned about the intreraction yet, just the shard. What am i not doing? Im gonna attach this file AND the shard because i think some of the problem is the shard itself but i dont know what. The shard is Echo's wand but without his coloring and nothing else of my mod has anything to do with Echo's. Can you help?

maybesomethingdunno
10th Oct 2011, 06:30 AM
In your "Interaction-Summon Power" BHAV, does your SimPE indicate you are using a valid BHAV for node 1? In mine, it says "[global 0x05CA] [unknown BHAV] (???)." The Wiki entry on Globals (http://simswiki.info/wiki.php?title=Globals) indicates there is no such Global. (If you want a dummy/placeholder node, use [global 0x02F3] No-Op which doesn't really do anything* and always returns "True.") Always be sure to have valid nodes; I wouldn't assume that the game will always react or progress through a BHAV as intended when it reaches code it doesn't understand. (If the game cannot understand a node, how can it know if it should progress down the "True" path or the "False" path?)

Because your node 2 points back to node 1 (which points to node 2), your interaction is going to loop, constantly creating/adding shards as it performs the "Sub - Add Shard" BHAV with each cycle of the loop. If you have debug mode on (which you should whenever you are testing hacked objects or other kinds of mods), you may be getting a "Too many iterations" error. Rather than pointing back to node 1, set node 2 to return True to the end the interaction.

For the sake of "good programming practices," the "Create New Object Instance" node in "Sub - Add Shard" should probably return Error on its False Target, just so that it can signal a proverbial "red flag" if the object isn't created for whatever reason. :)


[* Okay, technically speaking, No-Op indeed does something. It simply compares if Literal 0 > Literal 0 and returns "True" for both the "True" and "False" paths. But functionally speaking, it doesn't really do anything. No values are changed and you are guaranteed a returned value of "True." ;) ]

deathealer
11th Oct 2011, 11:54 PM
In your "Interaction-Summon Power" BHAV, does your SimPE indicate you are using a valid BHAV for node 1? In mine, it says "[global 0x05CA] [unknown BHAV] (???)." The Wiki entry on Globals (http://simswiki.info/wiki.php?title=Globals) indicates there is no such Global. (If you want a dummy/placeholder node, use [global 0x02F3] No-Op which doesn't really do anything* and always returns "True.") Always be sure to have valid nodes; I wouldn't assume that the game will always react or progress through a BHAV as intended when it reaches code it doesn't understand. (If the game cannot understand a node, how can it know if it should progress down the "True" path or the "False" path?)

Because your node 2 points back to node 1 (which points to node 2), your interaction is going to loop, constantly creating/adding shards as it performs the "Sub - Add Shard" BHAV with each cycle of the loop. If you have debug mode on (which you should whenever you are testing hacked objects or other kinds of mods), you may be getting a "Too many iterations" error. Rather than pointing back to node 1, set node 2 to return True to the end the interaction.

For the sake of "good programming practices," the "Create New Object Instance" node in "Sub - Add Shard" should probably return Error on its False Target, just so that it can signal a proverbial "red flag" if the object isn't created for whatever reason. :)


[* Okay, technically speaking, No-Op indeed does something. It simply compares if Literal 0 > Literal 0 and returns "True" for both the "True" and "False" paths. But functionally speaking, it doesn't really do anything. No values are changed and you are guaranteed a returned value of "True." ;) ]

alright i fixed the shard problem and i got it to animate right! But now i need to work on the check for the shard with the custom interaction. i looked at your surfin code and is it the manage inventory one? if it is then i tried that one and it said stack number out of range, so i went in and looked at it again and added the "STI:=Literal 0" and the "set to next" but i didnt know what to put in the "set to next" one so i put in my shard GUID. I tried it and it still said stack number out of range. So what do i do from here?

maybesomethingdunno
12th Oct 2011, 05:35 AM
I admit my goof in my previous post. It seems my SimPE filetable was set to ignore EPs or something and thus it wasn't recognizing the Global BHAV you used. Hence the "unknown BHAV" issue. Sorry about that.

Can you attach your updated version so I can see exactly what you have done?

deathealer
12th Oct 2011, 11:27 PM
I admit my goof in my previous post. It seems my SimPE filetable was set to ignore EPs or something and thus it wasn't recognizing the Global BHAV you used. Hence the "unknown BHAV" issue. Sorry about that.

Can you attach your updated version so I can see exactly what you have done?

i added lightning to try to make my interaction a little more exciting but i really need some effects like the love potion or something, but anyway i attached the powerscope and the social plugin. i didnt attach the social interaction because i need the plugin working first and im pretty confident about the interaction. Here it is and good luck.

maybesomethingdunno
14th Oct 2011, 08:32 AM
Hmmm...okay. Just a few things:

1) Whenever you are making a multi-tile object, you should make sure you give each OBJD a new, unique GUID. I noticed the other telescope OBJDs have GUIDs of a different range than the one you gave the main OBJD and I just wanted to check. :)

2) Node 2 of your "Interaction-Summon Power" BHAV is not doing what you likely think it is doing. When you want to set a value, use must use ":=" (such as "Temp 0x2 := Literal 0x5" meaning "Set Temp 0x2 to have the value of Literal 0x5"). The double equal sign, "==", is an evaluation (such as "Is Temp 0x2 equal to Literal 0x5?"). Since variables seem to be initialized as zero by default, I got a "Animation speed cannot be zero" error as Temp 2 was not initialized as you had intended.

3) For some reason, at least some animations occasionally return "False." The Animate Sim node (node 3) of your "Interaction-Summon Power" BHAV has a return "Error" on its "False Target" path and my game ran into it (resulting in a "Undefined Transition" error as it should whenever a BHAV returns Error).

4) For your "Sub - Inventory Check (shard)" BHAV, I would recommend you delete nodes 0, 3, and 4. This will leave Node 0 as "[prim 0x0002] Expression (Stack Object ID 0x0000 := Literal 0x0000)" and node 1 as "[prim 0x0033] Manage Inventory (Set To Next Token Of GUID, ..." (which should return "True" for the "True Target" and "False" for the "False Target." I think that should be all that is necessary. Your node 4 has a "True Target" leading to an undefined node, 0x001F.

5) This is perhaps a bit nit-picking and I apologize. On your "Go To Relative Position" BHAV, have the "False Target" path return "False" rather than "Error." This way, if for example the action is canceled from the Sim's queue, the interaction will not throw an Error when the BHAV follows the "False Target" path on the routing node. The Sim will instead just end the interaction and will move on with its life. :)


I did not encounter a "stack number out of range" error. If you are still getting the error, please post the error log along with any of the .package files you have updated.

Here (http://www.modthesims.info/showpost.php?p=1568113&postcount=4) is a list of some base game effects if you are interested. It may not be complete and, of course, the EPs added many more.

deathealer
23rd Oct 2011, 07:00 PM
Hmmm...okay. Just a few things:

1) Whenever you are making a multi-tile object, you should make sure you give each OBJD a new, unique GUID. I noticed the other telescope OBJDs have GUIDs of a different range than the one you gave the main OBJD and I just wanted to check. :)

2) Node 2 of your "Interaction-Summon Power" BHAV is not doing what you likely think it is doing. When you want to set a value, use must use ":=" (such as "Temp 0x2 := Literal 0x5" meaning "Set Temp 0x2 to have the value of Literal 0x5"). The double equal sign, "==", is an evaluation (such as "Is Temp 0x2 equal to Literal 0x5?"). Since variables seem to be initialized as zero by default, I got a "Animation speed cannot be zero" error as Temp 2 was not initialized as you had intended.

3) For some reason, at least some animations occasionally return "False." The Animate Sim node (node 3) of your "Interaction-Summon Power" BHAV has a return "Error" on its "False Target" path and my game ran into it (resulting in a "Undefined Transition" error as it should whenever a BHAV returns Error).

4) For your "Sub - Inventory Check (shard)" BHAV, I would recommend you delete nodes 0, 3, and 4. This will leave Node 0 as "[prim 0x0002] Expression (Stack Object ID 0x0000 := Literal 0x0000)" and node 1 as "[prim 0x0033] Manage Inventory (Set To Next Token Of GUID, ..." (which should return "True" for the "True Target" and "False" for the "False Target." I think that should be all that is necessary. Your node 4 has a "True Target" leading to an undefined node, 0x001F.

5) This is perhaps a bit nit-picking and I apologize. On your "Go To Relative Position" BHAV, have the "False Target" path return "False" rather than "Error." This way, if for example the action is canceled from the Sim's queue, the interaction will not throw an Error when the BHAV follows the "False Target" path on the routing node. The Sim will instead just end the interaction and will move on with its life. :)


I did not encounter a "stack number out of range" error. If you are still getting the error, please post the error log along with any of the .package files you have updated.

Here (http://www.modthesims.info/showpost.php?p=1568113&postcount=4) is a list of some base game effects if you are interested. It may not be complete and, of course, the EPs added many more.

thanks a ton, that fixed ALL of the errors. i know this is, what, 1-2 weeks after your post? sorry about that, i already made the changes you posted the day you posted them. The only thing that i'm having trouble with is the anim speed. right now it goes like 4 sim hours for the anim to play all the way out, so how do i make this normal speed?(around a couple of sim minutes). Other than that everythings working exactly the way i want it to.

maybesomethingdunno
27th Oct 2011, 06:15 AM
The wiki entry should have all the info you need: http://www.modthesims.info/wiki.php?title=0x006A

I think there are two ways to edit animation speed.
If you have your operands like:
00 00 00 20 00 00 81 00
00 0A 00 00 00 FF 00 00

It is the operand with the 20 that controls speed. The 20 is the normal speed in forward direction (yes, you can have animations play backwards at different speeds too ;) ). Alternatively, you could have the speed in Temp2 if you are using the wizard (this is for object animations, but you can see a picture here (http://www.modthesims.info/showpost.php?p=1707099&postcount=3)). But I think this accomplishes the same thing.

Good job on getting all the errors fixed. :)

xSkyBirdx
29th Oct 2011, 08:29 PM
Hey guys, long time no talk ;) (I've been busy with school lately)
Well, I've been working on this again and wondered if one of you could tell me what was wrong with this. There's no error, it just doesn't do what it's supposed to. I'm attaching the package, and the BHAV I need help with is instance 1003 (Set Social and Relationship Change). I'm trying to make it so that I can adjust the relationship change separately depending on how high the relationship from person B to A is. Right now I thought I had made it so that if their relationship was over 40, there would be no change (so it's easier to test), but they still take a relationship hit either way. What am I doing wrong with the relationship test?
Thanks:)

Echo
2nd Nov 2011, 03:24 AM
At first glance it looks okay. Could you try changing both targets (true and false) to error on lines 0x2 and 0x4, then run the interaction in debug mode. Then find the error log and post it here? I'd like to know which sims it's operating on, and what values it's finding for the current relationships, and the error log can provide that information. :)

xSkyBirdx
19th Nov 2011, 10:55 PM
At first glance it looks okay. Could you try changing both targets (true and false) to error on lines 0x2 and 0x4, then run the interaction in debug mode. Then find the error log and post it here? I'd like to know which sims it's operating on, and what values it's finding for the current relationships, and the error log can provide that information. :)
I did what you said on both of the nodes and ended up with an error log for the werewolf (Person A) that said that the first local was still zero. However, I thought that maybe this was what was supposed to happen because the relationship check part is only supposed to be in affect for the Person B, and I guess the Person A check comes first. So, I put node 0x4 back to normal and left 0x2 and ran another test. Here's what I think is the relevant part of the error log.

Object id: 228
name: N002_User00742 - Morgana
Stack size: 7
Error: Undefined Transition.
Iterations: 12
Frame 6:
Stack Object id: 238
Stack Object name: xSkyBirdx_Werewolf_Interactions_Controller
Node: 2
Tree: id 4099 name 'Set Social & Relationship Change' version -32759 from Social_Fight_Attack_Werewolf
Prim state: 0
Params: Locals: -22 0
As you can see, this time the error log was for Morgana, my vampy test subject (Person B) as expected. For some reason, the first local (where the relationship is supposed to be stored) is listed as -22, even though before the test both of their STRs for each other were +100 and I had dragged both of their LTRs for each other to +60. I have no idea where that -22 is coming from.

On another, but possibly related topic, after I reset the error, Morgana took a relationship hit that brought her STR with the attacker to -2 (decrease of 102) and her LTR to -22 (decrease of 88), along with becoming furious. I'm assuming that the BHAV continued to node 0xD, where I have the adjust relationship global with the STR param as -6 and the LTR param as -2. So, the STR hit was 17x more than I entered and the LTR hit was 44x more..? I still haven't figured out how the magnitude of the hit is determined, though I do know that setting these to 0 does result in no hit at all. Do you know how exactly this works and whether this would effect what value is recorded when I try to set a local to whatever relationship?

xSkyBirdx
20th Nov 2011, 08:19 PM
Aha! I think I found the problem! I removed all the rivalry and becoming furious code that I had left in from the original BHAV because I wanted to make sure it wasn't interfering with my tests. However, even after removing it, the losing sim would still become furious with the winner. So, I looked through some of the other BHAVS to see where that was coming from, and there was some more furious code in with the memory and want satisfaction (thanks for being confusing, EA), so I got rid of that and tested it again- whee, it appears to work now! So, that was kinda stupid.. their relationships must have been being changed before it even got to the relationship check! Plus, now the relationship decrease is actually what I set it to... Anyway thanks for your help! I hadn't thought of setting errors like that to figure out what was going on, and that will definitely be useful in the future! :)