Okay, I've been getting better at simpe. But I haven't quite gotten my zombie hunter... to be able to kill zombies. I imagine I am doing something extremely wrong, but for the life of me, I can't figure out what.
Looking at your code, the first problem is that you modded the wrong BHAV: in short, you addeded the instructions to a "guardian" bhav, the one that checks if a sim can do the Socialites gesture (guardian BHAVs often has the word "TEST" in their name). That kind of BHAV only has to answer true or false so the corresponding "action" bhav will run (true) or not (false). If your code were working, the only result you could have would be that your zombie killer will go "kiss kiss darling" any zombie he meets... lulzy, but I guess not exactly what you're expecting
.
That couple of BHAVs (action and guardian) work more or less in this way, in their original form (and yes, I feel flattered
):
- (guardian): do this sim belong to family 0x7FDF (Socialites)?
- If yes ----> run action BHAV [result: TRUE]
- If not ----> do this sim has the fancy stuff object in inventory?
- if yes ---> run action BHAV [result: TRUE]
- if not ---> result: FALSE
In your case, this guardian BHAV only has to check if there's the object in inventory: true or false; nothing more, nothing less.
If the result is TRUE,
then the action BHAV is called, and performs its instructions. Usually those BHAVs have the same name of the guardian, minus the "TEST" word.
In this original BHAV, the instructions merely launch the social (which is an object, with its own GUID), and then it's this "social object" that comes to life and goes on, doing whatever its instructions dictate (all the bunch of animations and effects of the socialites' gesture).
The action flows more or less in this way:
- Guardian (TEST) BHAV
- result: FALSE
- nothing happens. End of the action.
- result: TRUE
- Action BHAV is called
- Action BHAV launches the Social with GUID 0xD4FC3DAD
- The Social (object with GUID 0xD4FC3DAD)
- The Social tells the sim to go in front of other sim, then do the animation, then make the other sim do a corresponding gesture, etc.
I know that this project (the zombie killer routine) should be indipendent, but at least in the early stages of work you could go on modding this routine (the socialites greet), so you can always know what's happening while you test it. If you're a newbie in modding probably this could be a good compromise for testing: a replacement of an already existing routine. If I'm not mistaken, I guess it's your original idea, too.
In conclusion, I would suggest you to experiment with those BHAVs: mod the guardian bhav so it only checks if the fancy stuff is in inventory, leave the action bhav alone (it only launches the social, whatever it is), extract the "Social - greet - kiss kiss darling" in the Object Workshop (it's under the "unknown" category) as a clone, with NO custom group ID, and then look at its parts: menu, Bhavs, constants, etc; those are probably the real things you'll have to mod.
I hope I made some sense.