Tishobi Posted July 18, 2008 Share Posted July 18, 2008 Well i'm working on the dark magic part of my mod now but running into a bit of a conflit with a NPC. Rather then have the "people" lock the doors to there sewer there in, i would like to place a type of "guard dog" (Creature) to guard instead. The creature would wait in the area the people are in till they sleep then wander to the ladder that leads into it. So far i tryed for 2 hours or about that. Had the mob attack the people then added a new faction with them in it and now only would attack myself. But no matter how hard i try in having a wander or travel to a>b b>a package, no matter the condition (getinpcfaction, getpcinfaction, getdisposition, getunconscious etc.) i cannot prevent the creature to stand and hold still. Every one leads to the same answer in it attacking regardless. I have even tryed reversing it. Adding the creature to player faction and do getinfaction the npcs faction which i decreased player disposition in as well. Or even Samefaction wont prevent either or the people or myself from being attacked. Even tryed follow in defense to one of the people, attack the person and the creature does not respond (even if programed to sakeepa dogs pack). Anyone got any clue how to set it? ScriptName GuardDog Begin OnStartCombat player if VictorTheDamned.GetSleeping == 3EndIfEnd Link to comment Share on other sites More sharing options...
Vagrant0 Posted July 18, 2008 Share Posted July 18, 2008 What you want isn't so much scripting as it is AI. Can you try explaining a bit more clearly as to what exactly you want to happen, be clear and specific. Do you want the dog to be aggressive to the player any time the player is in the same area, or what? Link to comment Share on other sites More sharing options...
Tishobi Posted July 18, 2008 Author Share Posted July 18, 2008 What you want isn't so much scripting as it is AI. Can you try explaining a bit more clearly as to what exactly you want to happen, be clear and specific. Do you want the dog to be aggressive to the player any time the player is in the same area, or what? The idea is in a cave, think of a U One side of the U has the ladder, the other has the room (beds, food etc.) There are 3 NPCs, Victor, Vera and Tak. All will be some kind of merchant. Lastly i have a creature in the corner of the room part of the U. During the day, shop hours (8-21), i have the creature in the corner (CultWatcherStartPack, Travel>Start loc, 0 Radius). They sleep from 21-6, eat from 6-8 and back again to shop. What i am trying to do is a travel pack to cavedoor xmarker, 0 radius and hostile. Anything that climbs down between the hours 2100-0600 will be attacked. Either by some kind of alteration to aggression rather then his default or change and off the citys faction into a "player hating but city loving" one or something along those lines. Link to comment Share on other sites More sharing options...
Vagrant0 Posted July 18, 2008 Share Posted July 18, 2008 Well, first off, you need to do some faction work. Create a faction with 50 disposition towards itself, and add all 3 NPCs and the dog to this faction. Then make that interior cell owned by that faction. Toggle "public space" or something like that under the cell ownership, this will make the cell function similar to how other shop cells function, in that when the merchants close down for the night, they will ask you to leave (provided you have a "continue if player is near" on their service packages). For the dog, you'll want to toggle "defensive combat" on all the packages other than the one you want them to be agressive with. On their agressive package, have "continue if PC is near" checked. Within the dog's AI, change the aggression settings to 25, and have atleast 50 energy. As far as controlling packages go, do it by time. If you want the dog to roam around, make it a wander package with a fairly large radius. For the sake of simplicity, you should only have 1 guard package. Make sure that you have pathgrids created for the cell, otherwise none of the actors will be able to move around within the interior. Test it like that, to see if the behavior is right. At this point, the dog shouldn't attack you, but should follow you around durring the guard package. As far as the setup you're using goes, is the player the only one who would be entering this cell when the dog is guarding (not counting companions)? Do you want those people to also be attacked by the dog (and possibly the merchants)? Or is it safe to say that only the player would be enountering this behavior? Link to comment Share on other sites More sharing options...
Tishobi Posted July 18, 2008 Author Share Posted July 18, 2008 ^^ Yes that is correct, the player would be the only one entering this building or the upstairs (Enter a house, there in the basement). I know a bit about AI Construction, them needing 3 primary things. A brain, a "road" and destination. Factions are pretty close to other citys, 3 of them (CityCastleFaction, CityGuard & CityFaction). All NPCs are tied to CityFaction only. This is what i did so far There basement and upper house (not much there for anyone anyway) are under there faction (CityFaction). NPCs are in that faction, the dog was too. I also created a faction specifically for the dog because while in that NPCs Faction he was attacking them. The NPCs already do kick the player out after there service pack completes (even without your changes). Now for the AI packs for the dog, your saying to have 2 packs. One:Travel to start loc, 0 radius (the corner) in defensive combat from the hours of 0600-2100 (similar to GuardDay[or night]Post starting packs)Two:Wander near ref, xmarker [doorref], say 800 and continue if PC is near from the hours of 2100-0600 but with a aggression of 25 for the NPC, wouldn't this effect his post pack or does the defensive combat apply to the PC as well as NPCs and Creatures (obvious that the npcs are under the same faction as the dog)? Link to comment Share on other sites More sharing options...
Tishobi Posted July 18, 2008 Author Share Posted July 18, 2008 On a new note, with all of the above you asked. The dog will not attack unless its aggression is set as 56 or higher, 56 = about 5 yards but even in its defensive combat pack if player gets to close it still attacks. Link to comment Share on other sites More sharing options...
Vagrant0 Posted July 18, 2008 Share Posted July 18, 2008 I'm saying create a faction which works just for those who are going to be in the cell, this is why we're setting them up as owners of the cell. This is done to make the dog use what sort of trespass AI they have, and really has more benefits for overall appearance than anything since the dog's disposition toward the player would be easier controlled, even in the case of a player with high personallity. Now that I think about it, it would probably work best if the cell wasn't set to public, as long as the shops still work. Having all 4 on the same faction also allows them to make use of "allow special combat" which prevents them from hurting eachother. As far as defensive combat only, this prevents the dog from attacking anyone while that package is in place, unless first attacked. Without this, he would attack anyone he has a disposition lower than 25 (with the suggested agression settings) with. This might have been why he was attacking his owners. The reason why I didn't have you going further than this, making it so that his disposition toward the player is always below that when guarding is so that you can still test out all the other behavior related to this without being attacked. The easiest way to do this would be with another faction that has a negative disposition to the player faction. However this faction will be added to, and removed from the dog through scripting based on packages. And yes, that is why I said 25 for agression, it's low enough to prevent most accidental attacks, but high enough that it should still work when you want it to. Agression is the disposition point where things will attack you. 100 will always attack you, below 5 will rarely or never attack you. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.