Telyn Posted February 24, 2011 Share Posted February 24, 2011 Thanks for reading. I've been looking at AI tutorials, but all the ones I have seen are concerned with creating new NPCs, and generally focus on combat behaviors. The mod I wish to make would be to change the behavior of existing NPCs. I would greatly prefer not to make any new NPCs since what I want to do shouldn't need any and it could cause problems. Basically, I just want existing NPCs to react to certain environmental conditions around them which cause them to have a chance of going to their home, shop, or if they have neither, any nearby building they have permission to enter to get away from it. I know that there is a mod which causes them to take the crossed arms posture when it rains, so this should be possible. I've found references in the game to beggars seeking shelter when it rains, though I have never seen them actually do that in game. I just can't find a tutorial on how to apply a behavior to existing AI packages as a mod. I do not want to change game files directly, just override/extend behavior. Any links would be deeply appreciated. Couldn't find any tutorial related to this in the wiki, but I might have been searching on the wrong terms. Link to comment Share on other sites More sharing options...
Striker879 Posted February 24, 2011 Share Posted February 24, 2011 (edited) You may already have seen this but here's a link to the Construction Set Wiki Portal for Actor Behavior. There's quite a bit of info in the wiki but sometimes it's hard to find what you're looking for. Search is good when you know what they call something but it can be a chore searching through pages manually when you don't know the right 'handle' for something. Good luck. Edited February 24, 2011 by Striker879 Link to comment Share on other sites More sharing options...
Telyn Posted February 24, 2011 Author Share Posted February 24, 2011 Thanks so much. I was inspired to try this by the other thread. I had looked at that section but couldn't find a tutorial that affects vanilla npcs. How did you get your actors to respond to the weather? I've read the conditions section and I can see the tags. Did you change those individual npcs one by one? I haven't found any tutorials on that site yet that apply to what I want to do, but I am looking through the scripting section now. Thanks for the luck wish. I am going to need it. Never tried anything this ambitious since Sims II and I had a lot of help with that. Link to comment Share on other sites More sharing options...
Striker879 Posted February 24, 2011 Share Posted February 24, 2011 (edited) So far my modding has been pretty modest, mostly adding extra NPCs to my houses and giving them 'lives'. If you look at any NPCs in the Construction Set (double click one to bring up their properties dialog) you'll see an AI button. Click it and you get the AI Object dialog with the AI Package list near the bottom. Right click one of the listed packages (let's say an eat package) and select edit you get another dialog called AI Package. There's a section of flags that can be selected at the top and a group of tabs (Schedule, Conditions, Location & Target) for the lower section. On the Conditions tab you can edit an existing condition if one is already defined or create/add your own with the New button at the bottom left. If you're creating a new one when none existed before this will open up a drop-down selection box that has all the available conditions listed (e.g. IsRaining). In the table above that you'll see columns for Target, Function Name, Function Info, Comp, Value and an un-named column. Target in this case will be no (I've not needed to use that so far) IsRaining for Function Name, nothing in Function Info (controlled by what you assign with the Function Parameters button, bottom centre ... again something I've not yet used), == or whatever you select from the Comparison drop down to control the logic (equal to, greater than etc.), Value that you set using the box bottom right that the logic will check against (for true or false or quest stage etc.) and a check box bottom extreme right to toggle AND or OR so that you can cascade through different functions with a logical AND or OR (a bit past the depth I've required so far as well). The resources I've linked and the tinkering I've done getting my NPCs to do what I'm looking for is the extent of my limited knowledge on NPC AI, but I do know I've only scratched the surface of what you can do with just the vanilla functions provided (not getting into OBSE or writing your own scripts at all). What is possible with those tools is far beyond my limited vision as of yet. Good luck on your journey into this vast new land, and don't curse me too much when you get stuck in the occasional mucky spot. :tongue: Edit: Here's a link I remembered about for NPC creation that gets into the basics for AI from the CS Wiki. Edited February 24, 2011 by Striker879 Link to comment Share on other sites More sharing options...
Recommended Posts