Jump to content

lasere200

Members
  • Posts

    51
  • Joined

  • Last visited

Nexus Mods Profile

About lasere200

lasere200's Achievements

Contributor

Contributor (5/14)

  • First Post
  • Collaborator Rare
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. In the "LootSafeGoodspringsSchoolhouse" there's 100 caps that you don't actually see in the safe. How is this maddening magic achieved?
  2. Well, I managed to solve it with GetRefCount. I don't know why it took me so long to find it. Cheers.
  3. Thank you for the answer. Unfortunately I don't see anything that can help me. Maybe I'm just bad. I am trying to get the ammo count from a single ammo reference, dropped in the gameworld. GetClipSize requires a weapon to work, as far as I can tell and as such I "suppose" is of no use to me. If you drop ammo in the gameworld when hovering over it you see the count in the ui. There's a single reference though and I want to get that same count through scripting. Edit: https://ibb.co/S6myX09 All ammo base objects have "Clip Rounds" (check the image). That's what I am trying to get from an ammo ref in the gameworld, not in a container. Or just use scripting to activate the ref as to receive all the Rounds not just one as it happens with ammoRef.Activate Player 0/1
  4. As the title says, I need to get the "Clip rounds" value of an ammo reference dropped on the ground. Basically ammo in the gameworld is either dropped by the player or existing as a reference of the base ammo objects. The problem is that if I use Activate to pick it up I only get a single bullet regardless of how many bullets there are. The Ammo dialog has a clip rounds field and this description: Clip rounds: The number of rounds of ammo the object contains when placed in the world. Using the "Count" value on a placed reference of the ammo overrides this number and uses the count instead. This is the value I need If there's some other way to use a script to activate the reference as to pick up all the bullets, I'd be interested in that too.
  5. So I made it work using your suggestion but it has some big shortcomings right now but it's still a big step in the right direction. Made a perk that adds an ability with a cloak/continuous/self magic effect to the player. The cloak applying effect is a spell (script/concentration/contact) that looks like this: Scriptname ALEnhKeywordEffectScript extends activemagiceffect Actor Property Player Auto Keyword Property ALEnhKeyword Auto mandatory Perk Property ALEnhCloakPerk Auto mandatory Event OnEffectStart(Actor akTarget, Actor akCaster) While (Player.HasPerk(ALEnhCloakPerk)) debug.trace("hep") akTarget.AddKeyword(ALEnhKeyword) EndWhile EndEvent The only thing I change from the default value is the magnitude of the cloak effect in the ability window (not the magic effect window). It seems to control the range (not any Area setting) Right now my conclusion is that the cloak applying effect only works on enemies that are alive. So if I kill a rat, out of effect range, it works. The keyword is applied to the corpse when I come in range and the corpse is automatically looted. It doesn't work on containers and corpses that were already dead (like the dog and raider dead near the sanctuary bridge). I need something like this to keyword containers too.
  6. This is my main script and along with the detection script from above, my entire mod. I use two keywords one for looting, one for detection. The looting keyword is on all the items I want to loot, all containers and NPCs while the detection keyword is on all the NPCs. The only in game issue that I haven't been able to fix is removing the keyword from the items I loot from containers. Because of that when I drop them I automatically pick them back up once. Since they are being looted from the open world the second time the keyword actually gets removed. Being able to keyword cotnainers and NPC some other way could make a big differece. ScriptName ALEnhEffectScript extends Activemagiceffect ;-- PROPERTIES ---------------------------------- Actor Property Player Auto float Property ALEnhRange Auto Form Property AmmoFusionCore Auto Form Property PowerGenerator01 Auto Form Property WaterPurified Auto FormList Property ALEnhActivatorList Auto FormList Property ALEnhBottleList Auto Keyword Property ALEnhKeyword Auto mandatory Keyword Property BobbleheadKeyword Auto mandatory Keyword Property PerkMagKeyword Auto mandatory Perk Property ALEnhPerk Auto ;-- VARIABLES ----------------------------------- GlobalVariable Property ALEnhDetected Auto GlobalVariable Property ALEnhLockpicking Auto GlobalVariable Property ALEnhStealing Auto ;-- EVENTS -------------------------------------- ;---- Start ------------------------------------- Event OnEffectStart(Actor akTarget, Actor akCaster) While (Player.HasPerk(ALEnhPerk)) ObjectReference[] Loot = Player.FindAllReferencesWithKeyword(ALEnhKeyword as Form, ALEnhRange) If (Loot.length != 0 || Loot != None) int x = 0 While (x < Loot.length) If (Self.CheckIfReferenceCanBeProcessed(Loot[x])) ;------ Bodies and Corpses ---------------------- Actor kActor = Loot[x] as Actor If (kActor != None) If (kActor.IsDead() == True) If (!Loot[x].IsActivationBlocked()) LootContainerItems(Loot[x], ALEnhKeyword) EndIf EndIf EndIf ;------ Activators ------------------------------ ElseIf (ALEnhActivatorList.HasForm(Loot[x].GetBaseObject()) || Loot[x].HasKeyword(BobbleheadKeyword) || Loot[x].HasKeyword(PerkMagKeyword)) If (Loot[x].Is3DLoaded()) If (Player.WouldBeStealing(Loot[x])) If (ALEnhStealing.GetValueInt() == 1) If (ALEnhDetected.GetValueInt() == 0) Loot[x].Activate(Player as ObjectReference, False) EndIf EndIf Else Loot[x].Activate(Player as ObjectReference, False) EndIf EndIf ;------------------------------------------------ ElseIf (!Loot[x].IsActivationBlocked() && Loot[x].Is3DLoaded()) ;------ Locked Containers ----------------------- ObjectReference kContainer = Loot[x].GetContainer() If (kContainer != None) If (KContainer.IsLocked() == True) If (ALEnhLockpicking.GetValue() == 1 as float) If (Player.WouldBeStealing(Loot[x])) If (ALEnhStealing.GetValueInt() == 1) If (ALEnhDetected.GetValueInt() == 0) Loot[x].Activate(Player as ObjectReference, False) Utility.Wait(2 as float) EndIf EndIf Else Loot[x].Activate(Player as ObjectReference, False) Utility.Wait(2 as float) EndIf EndIf EndIf ;------ Unlocked Containers --------------------- Elseif (Player.WouldBeStealing(Loot[x])) If (ALEnhStealing.GetValueInt() == 1) If (ALEnhDetected.GetValueInt() == 0) LootContainerItems(Loot[x], ALEnhKeyword) EndIf EndIf Else LootContainerItems(Loot[x], ALEnhKeyword) EndIf ;------ Empty Bottles --------------------------- ElseIf (ALEnhBottleList.HasForm(Loot[x].GetBaseObject())) If (Player.GetItemCount(WaterPurified) + Player.GetItemCount(ALEnhBottleList as Form) < 10) If (Player.WouldBeStealing(Loot[x])) If (ALEnhStealing.GetValueInt() == 1) If (ALEnhDetected.GetValueInt() == 0) LootOpenWorldItem(Loot[x], ALEnhKeyword) EndIf EndIf Else LootOpenWorldItem(Loot[x], ALEnhKeyword) EndIf EndIf ;------ Fusion Cores ---------------------------- ElseIf (Loot[x].GetBaseObject() == AmmoFusionCore) ObjectReference PowerGenerator = Game.FindClosestReferenceOfTypeFromRef(PowerGenerator01, Loot[x], 128 as float) If (Player.WouldBeStealing(Loot[x])) If (ALEnhStealing.GetValueInt() == 1) If (ALEnhDetected.GetValueInt() == 0) If (PowerGenerator != None) Loot[x].RemoveKeyword(ALEnhKeyword) Loot[x].Activate(Player as ObjectReference, False) Else LootOpenWorldItem(Loot[x], ALEnhKeyword) EndIf ElseIf (PowerGenerator != None) Loot[x].RemoveKeyword(ALEnhKeyword) Loot[x].Activate(Player as ObjectReference, False) Else LootOpenWorldItem(Loot[x], ALEnhKeyword) EndIf EndIf ;------ Open World Items ------------------------ ElseIf (Player.WouldBeStealing(Loot[x])) If (ALEnhStealing.GetValueInt() == 1) If (ALEnhDetected.GetValueInt() == 0) LootOpenWorldItem(Loot[x], ALEnhKeyword) EndIf EndIf Else LootOpenWorldItem(Loot[x], ALEnhKeyword) EndIf ;---- End --------------------------------------- EndIf x += 1 EndWhile EndIf EndWhile EndEvent ;-- FUNCTIONS ----------------------------------- bool Function CheckIfReferenceCanBeProcessed(ObjectReference akItemReference) return !akItemReference.IsDisabled() && !akItemReference.IsDeleted() && !akItemReference.IsDestroyed() EndFunction Function LootContainerItems(ObjectReference akContainer, Keyword akKeyword) akContainer.RemoveKeyword(akKeyword) akContainer.RemoveItem(akKeyword as Form, akContainer.GetItemCount(akKeyword as Form), True, Player as ObjectReference) EndFunction Function LootOpenWorldItem(ObjectReference akItemReference, Keyword akKeyword) akItemReference.RemoveKeyword(akKeyword) Player.AddItem(akItemReference as Form, 1, True) EndFunction
  7. FindAllReferencesOfType only accepts base objects or form lists as arguments, not actual "types", or at least that's what I gather from it's Creation Kit page. How would I go about adding keywords via script as you said? Is it possible to do it through Quest Aliases? I've seen you can assign keywords to them. All I am interested in is keywording actors and containers - and I saw that I can choose to search in the loaded area for actors only and even with GetIsObjectType set to "Container" as a type. Here is my mod. It works and it terms of gameplay there are very few quirks but the compatibility is very very low since I am modifying 5000 records just to add a single keyword. https://bethesda.net/en/mods/fallout4/mod-detail/1922946 Here is the F3NV version which was a lot smoother and is what I am aiming for: https://www.nexusmods.com/newvegas/mods/42631/?
  8. Hi, I've come across some roadblocks with my mod and I am looking to solve them but I just can't on my own. Help would be greatly appreciated. 1. I currently handle player detection by keywording all NPCs in the game, finding them via FindAllReferencesWithKeyword with a 4096 range and using IsDetectedBy on each of them. Obviously this leads to a lot of conflicts. Is there a way to get if the player is detected or not (for purposes of stealing) without modifying NPC records and if possible without F4SE? ScriptName ALEnhDetectedEffectScript extends Activemagiceffect ;-- Properties -------------------------------------- Actor Property Player Auto float Property ALEnhRange Auto GlobalVariable Property ALEnhDetected Auto Keyword Property ALEnhDetectedKeyword Auto mandatory Perk Property ALEnhDetectedPerk Auto ;-- Variables --------------------------------------- ;-- Functions --------------------------------------- Event OnEffectStart(Actor akTarget, Actor akCaster) While (Player.HasPerk(ALEnhDetectedPerk)) ObjectReference[] Actors = Player.FindAllReferencesWithKeyword(ALEnhDetectedKeyword as Form, ALEnhRange) If (Actors.length != 0 || Actors != None) int x = 0 int d = 0 While (x < Actors.length) Actor kActor = Actors[x] as Actor If (Self.CheckIfaActorCanBeProcessed(Actors[x])) If (kActor != None) If (kActor.IsDead() == False) If (Player.IsDetectedBy(kActor) == True) d = 1 EndIf EndIf EndIf EndIf x += 1 EndWhile ALEnhDetected.SetValue(d as float) Else ALEnhDetected.SetValue(0 as float) EndIf EndWhile EndEvent bool Function CheckIfaActorCanBeProcessed(ObjectReference akItem) return akItem.Is3DLoaded() && !akItem.IsDisabled() && !akItem.IsDeleted() && !akItem.IsDestroyed() && !akItem.IsActivationBlocked() EndFunction 2. I am using this same method to to find containers around the Player. I have keyworded all the containers in the game and I am using FindAllReferencesWithKeyword. Is there a way to do this without without modifying records? Somehow use their type? 3. After I get the container this is what I use to loot it. I am looking to modify the function below to remove a certain keyword from the items I am picking up (which as far as I can tell means removing the keyword from the base object and adding it back after having looted). Also if there is some OnItemAdded on the Player solution to this I'd love to know about it, I don't know where to start. Basically it would need to check on every item added if it has a certain keyword and delete it (from the the added form not the base object) Function LootContainerItems(ObjectReference akContainer, Keyword akKeyword) akContainer.RemoveItem(akKeyword as Form, akContainer.GetItemCount(akKeyword as Form), True, Player as ObjectReference) EndFunctionThank you. Edit: What would solve 1 and 2 would be something like FindAllReferences. I wouldn't mind filtering all the references via scripting because it wouldn't require to modify npc and container records anymore.That's the dream.
  9. Ever go into VATS only to find out you didn't have enough AP to fire a shot? A simple counter of available VATS shots makes the game a lot more fluid and enjoyable. I made one for Fallout New Vegas but with very little programming and modding experience it's been impossible for me to replicate it in Fallout 4. I haven't checked the Nexus for a while and seeing this new HUD Framework I though that it might be possible/easier to do nowadays. It should be a single digit that can be positioned anywhere and have some conditional formatting in order to stand out when low on VATS shots available. 0 - flashing red 1 - red 2 - yellow 3+ - green 9+ - invisible (maybe for Gun-Fu a double digit counter would be useful but I don't really know if you can reach more that 9 shots in VATS) The formula - Available AP / Modified VATS Weapon AP Shot Cost with the result rounded down (Modified because it should account for any VATS AP cost reduction available to your character) In terms of actual gameplay it is most useful when on low AP as it prevents you from wasting time and momentum by going in VATS without having the required AP to shoot. With this counter you just wait for the 0 to turn into 1, go in VATS and shoot. If you're also using a mod that disables the many VATS cameras it makes for really neat gameplay. I really hope to see this made by someone. Thanks. Edit: Just to be clear - the counter should be visible outside of VATS.
  10. I am looking to modify the interface, add a certain counter to it. Can someone please explain in short how are variables passed to text fields? I have everything set-up, I just don't know where the link between the game variable and the swf file is made.
  11. Yeah, unfortunately i'm adding a keyword to all npcs and all containers plus a few other items so that's pretty rough it terms of compatibility it seems.
  12. As I have been warned I have compatibility issues with my mod because in order to add a single keyword to different stuff, I store the entire record in the mod. I am just looking to change the keyword count and add a keyword and I don't want to save anything else as override info. Can I do that?
  13. I want to activate via a script items in the game world and single object references like ammo boxes that have a count higher than one only add a single item on ObjectReference.Activate(player) Is there a way to activate them so that I get all the items?
  14. I've got an object reference array. How do I differentiate between containers and normal items?
  15. I don't know what you're trying to do, but you can look at my scripts here. :D I guess that was what I was trying to do. Thanks for saving me a lot of trouble. I'll just tune yours to my liking. Thanks a lot. I looked on the Nexus on Bethesda and nothing.
×
×
  • Create New...