Jump to content

vkz89q

Members
  • Posts

    203
  • Joined

  • Last visited

Everything posted by vkz89q

  1. Yes. I did two tests: Test1: I forgot to fill Property stimpak and it was Empty and returned 29. Test2: I filled Property stimpak with Stimpak and it returned 10 and worked right.
  2. Check my last reply from last page, maybe it will help you. Edit: Also make new game without your mod active, use console to cheat whatever you need, map markers, items etc, save. Then never lose that save. Enable your mod and test on that save everytime. I know companions make some events return player. For example, Event OnDying(actor akKiller), if companion kills someone and you check who is akKiller, it's player, not companion. Current companions kills are "player made" kills atleast. But the item count should work. It might be older version of your script running on that save.
  3. Ok, I just tried this on my custom companion reference alias in quest: Scriptname XX:StimpakTest extends ReferenceAlias Potion Property Stimpak Auto Const Event OnEnterBleedOut() StimpakCheck() EndEvent function StimpakCheck() int stimcount = 0 Actor tempActor = Self.GetReference() as Actor stimcount = tempActor.GetItemCount(Stimpak) Debug.Notification("stims:"+stimcount) EndFunction I gave my companion 10 stimpaks and I had 4 in player inventory. First result says 29. Then I noticed I forgot to FILL the stimpak Property, so it was empty and took random item to count on. Then I filled the property and the result was 10 every time. Test on clean save and make sure your Properties are filled right.
  4. Hmmh, well I'm using something similiar.. I have npc with ton of ammo and player can't pickpocket him. Then, when he dies, I remove that ammo and put small amount instead so player won't loot 1000+ ammo. I'm doing this just because my npc is useless if someone is using mod with "NPCs use ammo" for common weapons. Here is my script and it "just works". The npc has ammo between my min and max ints. Scriptname XX:xxxxx extends ReferenceAlias Event OnDying(Actor akKiller) Actor tempActor = Self.GetReference() as Actor int ammoCount = tempActor.GetItemCount(AmmoToRemove) tempActor.RemoveItem(AmmoToRemove, ammoCount) int newCount = Utility.RandomInt(RandomMin, RandomMax) tempActor.AddItem(AmmoToRemove, newCount) EndEvent Ammo Property AmmoToRemove Auto Const Int Property RandomMin Auto Const Int Property RandomMax Auto Const Try using referencealias again, and try get count from Actor tempActor = Self.GetReference() as Actor ? You kinda do that with the actor array anyway but.. I dont know. And here comes to final question, are you testing on clean save? Save that is made before that script was in that save? If not, do that. Edit: Anyone wondering, yes, I found the "teammatedontuseammo" keyword later. Not sure if it works on hostile npcs tho.
  5. Have you tried Debug.Trace instead of Debug.Notification? I found that sometimes Notification gives strange numbers but trace always works correctly.
  6. Yeah, I simply needed to detect when NPC gets in ragdoll state(knocked down from sniper push perk for example) and then when he is not ragdolling anymore. I got mine working like this: RegisterForAnimationEvent(Fighter, "enterfullyragdoll") RegisterForAnimationEvent(Fighter, "ragdollandgetup") RegisterForAnimationEvent(Fighter, "defaultrefpose") RegisterForAnimationEvent(Fighter, "getupstart") I registered for these in Event OnCombatStateChanged, and then unregistered when combat state is 0. Then simply doing: Event OnAnimationEvent(ObjectReference akSource, string asEventName) ;RAGDOLLING if (asEventName == "enterfullyragdoll") Debug.Notification("D:enterfullyragdoll") AreWeRagdolling = 1 elseif (asEventName == "ragdollandgetup") Debug.Notification("D:ragdollandgetup") AreWeRagdolling = 1 ;NOT RAGDOLLING elseIf (asEventName == "defaultrefpose") ;Debug.Notification("E:defaultrefpose") AreWeRagdolling = 0 elseIf (asEventName == "getupstart") Debug.Notification("E:getupstart") AreWeRagdolling = 0 endIf EndEvent I had a problem finding good enough AnimationEvents to detect when npc gets up from ragdoll. "getupstart" works good enough. So I'm lucky I found what I needed. I tried ton of different animation events and many of them never fire events. For example, I wanted to register for animation event where my npc reloads weapon. Never got it working. Or when he starts running, never got that working either. Or swimming. It's possible I didn't try all the possible animations but still find it weird they have listed animation events in CK -> gameplay -> animations but they don't work. I got my script working good enough so it's all good now.
  7. I don't know answer to your question, but something I noticed while playing a LOT with animevents: Most of them do not send event, ever. So you have to figure which works and which doesn't. Maybe I did something wrong, but I registered for several animations with debug msgs, and most of them never sent event. I use this on npc, not player, maybe that's why. Also, you need to re-register everytime 3d gets un-loaded/loaded, which can randomly happen on a npc if he is too far away or player fast travels etc. I did find enough animations to play with, but it was pain to test which work and which doesn't.
  8. Hello. I have a magic effect that mimics vanilla effect "shoot enemies in the fusion core and they explode + the PA user jumps out of pa". I'm using this for non-player npc and it works fantastic, except for one part. I need to remove the fusion core from the guys PA frame. Only thing I got to work is: ObjectReference Cont Victim.SwitchToPowerArmor(None) ; victim is the guy wearing PA ; and now he jumps out of it Cont = Victim.GetLinkedRef(LinkPowerArmorKeyword) ; i have test almost all PA related keywords for this while the guy is wearing it and all return none; works fine AFTER he jumps out of it Cont.RemoveItem(FusionCore) And that WORKS. But, I want to get Ref to that PA when he is wearing it. Now, I have tried lots of keywords etc and functions but I just can't seem to figure how to get that PA ref while the guy is using it. In the vanilla script they have script at Armor: ArmorPoweredFramexxx and it has(on every power armor frame): akSender.RemoveModFromInventoryItem( GetBaseObject(), PA_FusionCore01 ) Which works WHILE the guy is in PA, but I can't figure how to get that BaseObject() in magic effect script. Any ideas? Like I said, works fine to get that ref when guy jumps out of the PA, but I need it while he is wearing it.
  9. Noticed this too earlier. Actors usually "snap" to their first travel destination. You can propably fix it by giving him/her another travel destination first. Even then they can snap in places if you sleep/wait in chair. Dirty fix I did for my actor: Scriptname XX:BlockTravelAtInit extends Actor Const Event OnInit() Self.SetUnconscious() Utility.Wait(5) Self.SetUnconscious(false) Debug.Notification("SetUnconscious on and off") endEvent I tried same on reference alias and it still snaps to first travel destination, so yeah no idea whats the right way to do it. I use this only on one unique actor, so it's good enough for me.
  10. HC_managerScript controls antibiotics spawn chance between 0 and 100. Why and when? No idea. The global is indeed 100 by default. Even if you change that global, the manager will still chance it between 0 and 100. Maybe you need to be ill for them to spawn? Not sure.
  11. In creation kit : Audio -> Sound Descriptor -> OBJWorkshopGeneratorSmallLPM and lower the Static Attenuation.
  12. Are you filling aliases in right order? For example, if you want to spawn weapon in container, you must fill that container alias first, then the weapon. Otherwise theres nothing to put the weapon in when the quest starts, it still works if you have "optional" flag in the aliases and allow repeated stages, but need to do the stage 2 times. (Because now the container alias is filled). Simply go to alias tab in your quest, select your container(don't open it), and press LeftArrow and put it higher in the list. Sorry, if you already done all this, can't check the file now. I could be wrong of course, but I had same problem with quest that had npc and location. I had to put location first, otherwise the quest failed to start. Also, if you need help to NPC to use the legendary weapon, check quest named "AspirationalItems". You can pretty much do it like it's done for Tinker Tom's unique weapon. Tested it and it works. Don't forget to give the npc ammo too.
  13. Hmm, the problem could be that like most dialogues, it has flag Actor Behaviour pause or end on combat. The problem could be his friends. They are still alerted by you, and the npc you try to talk has "helps friends and allies" and won't actually do the conversation more than first line. Maybe you should try does the conversation/force greet work on non-hostile npcs first. Also give the force greet big enough distance, like 1000 or so, should help getting it started. Maybe there is a vanilla quest that could hep, can't think of any now, that has first hostile guys and then starting dialogue with the same guys. There are things like gunners on bridge that ask for money to pass, but they are NOT hostile at first if you check them on Vats. I guess it could also be done with a bit more advanced script. Like using GetAllCombatTargets on player to array, then cycling trough all of them and making them all non-hostile. Just need to make conditions when you manipulate the targets so not random Mirelurk get's on the way. (Not sure actually if GetAllCombatTargets work on player) Also, you should be able to use Distance, if you put ReferenceAlias player and ReferenceAlias npc on your properties(First add them in Quest aliases tab). Then just: ReferenceAlias Property PlayerRef Auto Const ReferenceAlias Property NpcRef Auto Const Event OnInit() RegisterForDistanceLessThanEvent(PlayerRef, NpcRef, 150.0) ; Must register for it to work at all endEvent Event OnDistanceLessThan(ObjectReference akObj1, ObjectReference akObj2, float afDistance) Debug.Notification("distance less than 150") ; You can do your things here ; Also you need to re-register here, otherwise it only works once ; Better do some good conditions here, otherwise it gets spammed everytime distance is less than 150, but only if you re-register. Utility.Wait can be handy. ; If you dont re-register, the event is done and wont fire again. RegisterForDistanceLessThanEvent(PlayerRef, NpcRef, 150.0) endEvent I'm using something similiar on Quest script, but I believe it should work fine on ReferenceAlias too. edit: I don't know what those colours are in the code block, just ignore them, lol. If you want to check distance in if statement for example, you can do this: Scriptname xx:xxxxx extends ReferenceAlias ; put this on your npc you want to forcegreet Event OnInit() ; please note, this is not very useful on OnInit event, since it only works once. I think simply registering for distance works better, unless you find a good event to use this on. Actor mySelf = Self.GetReference() as Actor Actor Player = Game.GetPlayer() float mindistance = 500 ; or whatever you want float distance = mySelf.GetDistance(Player) if (distance <= mindistance) ;do your things endif EndEvent Timer event can work but simply registering for distance should be easier and better.
  14. Okay, so I tried different scenarios: Putting my quest which holds the override package to priority 10 -> everything still works. Stopping the quest and put the override package straight to my companion actor -> everything still works. I also tried messing with flag "Treat as player companion" in package, no effect, everything still works. It's something in the vanilla package that's overriding the distance, and it get's override by any Combat override package. The vanilla follower combat override packages don't seem to be in effect normally, since they have conditions that you need to manually toggle by ordering companion to stand still. So it must be something in the normal follower package, maybe it's travel target radius that has been set to player and 0. Well, whatever it is, I'm happy I can get my packages to work without touching vanilla packages. Maybe they indeed have some hidden normal combat package that gets override by anything if you use any other in combat override list.
  15. Okay, made proper package and list and put them on a quest thats 1 priority higher than Followers quest. Everything works perfect and I already made several follower packages for my companion, thanks again :)
  16. I just re-read your message, tried doing empty package with nothing but my combat style, put that in "FollowersCompanionCombatOverrideList" as first entry and guess what, It's WORKING! She happily melees enemies while my map marker shows 40+ units. I guess I got confused since normally followerscompanionoverridelist only has hold postion packages, which are not used until you toggle them and I played with the distances on followers normal package. Yes, now I understand what they do, override normal packages in combat. I'm just wondering why using hotkeys to change companion following distance from close,medium,far has no effect on combat? But anyway, THANKS a lot, this really made me happy to see it working. Now I just need to make proper Override list for my companion :smile:
  17. Yes, I'm using holotape to switch combat styles. I have quite few in there and I can see them work differently. I have one melee only, one ranged only, several melee/ranged(pulls melee weapon in close range) with different offensive and defensive styles to cover more etc.. only just this melee doesn't work quite right. I took a look at melee vanilla combat styles, but none of them are only melee, meaning they have a bit of ranged multi too in equipment score, which means they will pick and switch to gun if target is too far away to melee. Maybe it's just not intented to do melee only on companions. Another way to "force" melee is take all weapons out of companion and press T to equip melee weapon, but still flees if too far away from player(even with ranged or vanilla combat style). Actually, I think they might try get closer to player even with ranged weapons, it's just harder to notice since they can walk backwards and shoot at same time. I guess I need to test on vanilla companion next and see what they do and manually equip them with melee weapon.
  18. Thanks for your reply. I just re-tested everything. I tried every melee setting in the combat style. Avoid threats from 0-1. No effect. Defensive multi 0 or 1, no effect. Close range dueling, flanking and charging. No effect. Tried settings like fallback multi from 0 to 1 and no effect. I tried "long range" tab too and tested everything from 0 to 1 and no difference. Well, I can see them work. Flanking vs dueling is very different,high defensive multi=she blocks almost every incoming hit, just when I step 20 units away from her, combat stops lol. I tried messing settings with follower follow package too, min/max distance, dynamic goal on/off, no effect. I can see the following radius increase outside of combat, but still = no combat unless player is 20 units or less. I tried even combat style that allows her to shoot things, but took away her weapon and only gave her melee weapon. Same thing, runs away if too far away from player. If i give her weapon that can shoot, she starts murdering things. I guess it's rip dream of melee only combat style. Its just so meh, when she steps 21 units away from player and starts running away from enemies, usually getting shot in the process.
  19. Hi everyone. I'm working on a follower mod with lot of customization. One of the options is to change combat styles on the fly. I have hit a problem with melee only styles. My melee only style has equipment scores of 10 for melee and 0 for ranged. That means she never shoots everyone. Works like I want. I have this problem with range. I use quest to put quest marker on my companion, and I noticed that if companion is more than 18-20 in game compass units from player, she will not fight melee anymore. Instead she will run "backwards" and taunt enemies until player steps to around range 18-20 units from companion. Ranged styles do not have this problem, she can shoot even when player is 30-40+ units away from companion. I have tried everything I can think of, I made a script that gets her combat target and then force start combat with the target, but that does nothing, she will taunt and run until player steps closer. I have tried tweaking follower follow distance but that doesn't seem to matter if she is in combat. I have also tried changing every game setting related to distance + follower, teammate, etc. Nothing has effect. Only way that I seem to get to work is this: have a script that silenty dismisses her when combat starts and recruits her when combat ends, but seems bit "dirty" way to do it. For example you lose all Inspirational perk bonuses(I could make new one that works in this mode I guess) and can't command or trade with her, not a huge problem in combat but still, there has to be better way. At this point I'm starting to wonder if the distance is hard coded in the engine. I have checked companion scripts, game settings, ai packages, global variables, but can't find a way to change it. Anyone has ANY idea where this distance could be tweaked?
  20. You most likely need to stop combat with script, make the actor who you want to forcegreet non-hostile and evaluate his package. Then when conversation ends you can turn him hostile again and force start combat with script. Have you done console command "sqv quest number" to see if the alias fills too?
  21. Well, there is magic effects named RestoreHealth for food, stimpaks and generic. Then there is water drinking spell and food items have those magic effects too. So when you use food, it does the magic effect. I guess you could copy all those effects, so you have 2 instances of each effect. Then give original effects condition isincombat == 0 or similiar and then the new effects, remove the healing effects, and instead use script and event OnEffectStart that says "Can't eat/drink in combat" or similiar. So, you would have the original food with original effects that have condition isincombat==0 and the new effect(s) that display msg with condition(s) isincombat==1. Interesting mod idea. Maybe there is easier/better way but I think this one would work nicely. Just need to find every food, chem, water etc that can heal player. Not too hard when you find the magic effect and click "use info" in CK. Possible problem is that it would consume the food and just display the message. Like you said, you could just give the item back in the script but not sure if there is better way. Edit: AddItem function actually has silent option. So the msg "xxx added" will not display. Pretty cool. Original game does something similiar on survival, like you can't sleep or use water pump if you are in combat, I believe. No idea how that is done.
  22. Hmm, is it gonna be normal ghoul or feral ghoul? Feral ghouls can't use weapoins I think but normal ghouls yes, it could be weapon too. I don't think you can drag radscorpions spell to weapon tho. I think easiest way is to just make new ghoul. Pick any ghoul you want from base game, give it new name, click ok, it asks if you want to make new form, say yes. Then open that new form, give it name you want, go to spelllist. place radscorpion poison there and place that actor in your dungeon. I don't know if radscorpion effect is gonna work like that on ghoul, because I think radscorpion only poisons with it's stinger? Not sure. You could make a new magic effect and spell looking at radscorpion poison as your guide. If it's just normal ghoul who can use weapons then you propably can just give him legendary with poison effect.
  23. Propably make poison magic effect, then make spell that uses that effect, then make script that gives that spell to that specific ghoul. AddSpell should work in quest alias? You said it's gonna be named ghoul, so are you planning to name it with script since you said you are not gonna make new kind of ghoul? If so, you could add that spell in same script you change that ghouls name. How to do this, well you could check radscorpion poison spell and magic effects for the effect itself.
  24. Yeah, it's really easy to miss something small. I just had Cait dialogue open all time and made my quest step by step. Test after every affinity scene. Slow and tedious. Just made some placeholder dialogues like "blabla" etc and filled those later when everything was working. Basically just manually copied Cait and later modifed amount of responses etc when they worked. Remember to SAVE every 5min or so, because CK just loves to crash when you have multiple quests open. Also sometimes you don't see all changes until you close and reopen quests. Like I said, slow and tedious. But once you get it done it becomes really easy to modify how you want. I didn't find any guides about affinity so basically only way to do it is to look at vanilla companions. Get mod that removes affinity like/dislike etc cooldowns and console command chems or whiskey to you and make your companion hate/love them. Very fast to test affinity "natural" way.
  25. Hard to say. Could be many things. Double check your conditions. Make sure all affinity scene endings set quest state correctly. For example friendship ending sets quest state to: "Friendship scene done". Debug with console. Click your companion and after affinity scene and type "getav Ca_wantsToTalk" and check it's 0 after conversation. Tripple check everything using vanilla companions as example. There's propably some small thing you are missing. If you used vanilla companions as example, make sure all variables, properties and scripts point to your companion. Make sure quest priorities are set like vanilla companions. Test with clean save. Are you following any tutorials from youtube? Some of those tutorials do things bit bad, missing stuff. That means they can break dialogues pretty easily. Just something I noticed when I started working on my mod. If nothing else helps, check everything step by step as using vanilla companion as example. Every reply, every script, everything. IF even that doesn't help, I guess you gotta have someone check your file or redo everything. I used vanilla companions as example and every scene works.
×
×
  • Create New...