-
Posts
635 -
Joined
-
Last visited
Everything posted by PJMail
-
Background: I want a craftable item the player can have in their inventory, AND assign to a quick Slot/Favorite (like a stimpak), that runs a script when used. Currently I have an Ingestible (ALCH) with attached MagicEffect that runs the script. Works great EXCEPT when the player has 'SetGhost()' enabled (see this topic). Note that you cannot attach a script directly to an ALCH type object. So, what I am looking for is an alternate Craftable Item that I can directly attach a script to so that when I 'select' it via its quick Slot number it silently runs the script. I am under the impression quick slots only work for Consumables and Weapons - or am I wrong on this? P.S. I want this to work without F4SE (like on an Xbox) so can't use Hotkeys. Anybody have a working idea that doesn't use a MagicEffect?
-
Cannot remove a Perk - what keeps a Perk 'active'
PJMail replied to PJMail's topic in Fallout 4's Creation Kit and Modders
Just thought I would give anyone interested an update on this. It appears the Perk - Actor association must be kept outside the Actor's information, as even resetting the Actor back to default (to the point where they loose all attributes - and clothes) - does not remove their perks. When the Actor is disabled they loose all Perks and Magic Effects, but they immediately return when the Actor is enabled. Once that association is stuck it cannot be deleted. I suspect deleting the Perk would resolve this on a restart, but Perks in Fallout4.esm can't be removed (even temporarily). As the ID of Companions never change there is no chance of breaking the link by deleting them. The perk re-appears when the game recreates them. Nasty. -
Cannot remove a Perk - what keeps a Perk 'active'
PJMail replied to PJMail's topic in Fallout 4's Creation Kit and Modders
Anyone know how to force a companion back to their initial CK state? A bit like a Cell reset effect? As they aren't a Reference you can't really delete and recreate them. -
Cannot remove a Perk - what keeps a Perk 'active'
PJMail replied to PJMail's topic in Fallout 4's Creation Kit and Modders
Yes, I tried that first. Didn't resolve the issue, but thanks for looking into this. -
Cannot remove a Perk - what keeps a Perk 'active'
PJMail replied to PJMail's topic in Fallout 4's Creation Kit and Modders
@LarannKiar - the only conditions on a Perk itself are level up conditions - and that won't cause it to go away. I can certainly add conditions on the invoking effect, but that horse has bolted and been 'dispelled' already. Altered Conditions on the Perk effects themselves would stop those effects - but the issue is many scripts and other item conditions look for the presence of the perk itself, not it's effects, so wouldn't solve anything. @niston - you are right, and back when I first wrote the mod - just stopping the passengers exiting was a simple and 'benign' solution (I thought). Clearly hindsight is a wonderful thing though and solving the problem your way would also fix the 'player as co-pilot' issue (which I also never considered an option back then so...). Anyway, there are a number of ways of stopping the problem occurring in the future - that is not the hard problem - trying to repair the damage though, that is the reason for this post... -
Cannot remove a Perk - what keeps a Perk 'active'
PJMail replied to PJMail's topic in Fallout 4's Creation Kit and Modders
Further to this, there must be some sort of 'invocation count' on a Perk, so that it is not removed unless no magic effects remain that add it (seems sensible). Also the problem only happens with Magic Effects that have a "Perk to Apply" (that is the Perk that sticks). And (so far) in the situation when the PA companion is on a Vertibird AND docked AND 3D unloaded - which my mod allows :pinch: In this situation, the Magic Effect ends without also removing it's associated 'perk to apply', so now it permanently has a positive 'invocation count' and can NEVER be removed. Checking the Companion when they are 3D unloaded shows they still have the perk, but NO active effects, just to confirm my suspicion. As the Perk is "PowerArmorPerk" this causes lots of issues for the Companion - apart from the PA buffs, lots of other quests/scripts/effects check for this perk to decide they are in PA... I checked Resaver and it doesn't seem to do much for NPC's or Perks. Edit: If I put some conditions on the MGEF in the Enchantment (EnchPA_Abilities), so that it is not allowed at the problem stage, the problem does not occur. Unfortunately this just mitigates the problem in the future - I cannot fix people's stuffed Companions... -
It seems if a companion is in PA and they get stuck (such that you leave them behind when you fast travel), when you return and get them to exit the PA they still have the Power Armor Perk (0x1F8A9). RemovePerk at the console has no effect. hasmagiceffect (for the MGEF 0x390c1 that adds the perk) returns 0. The spell that causes that magic effect (0x390c0) also returns 0 if you test for it. There is also an enchantment (0x3E579) that can add the perk but I don't know of any console command to test for it (it is not a 'spell'). Any ideas? Recycleactor has no effect. Thanks
-
Really interesting! Does all this work exactly the same for interior Settlements (Vault 88, Mechanists Lair)? I ask because boundaries etc are presumably applied differently (or at least trying to work out if all Interior Cells are covered)... I don't know if this is a related question, but what effects NPC resets (where they reset back to default outfits etc)?
-
You are no doubt correct - my reading of DamageObject had suggested it modified a mechanic different to what I was looking for (which was item health). Surprisingly I have resolved my issue - a case of don't believe everything you read:- Additem DOES accept a leveledItem and does exactly what I want (gives me an item with reduced health of the correct base object). Post answered!
-
Thanks niston, I will give it a try. I wonder why game scripts do things like DamageObject(9999)? Update: The following code has no effect. ObjectReference oEmptyCore = Self.PlaceAtMe(AmmoFusionCore) oEmptyCore.DamageObject(50) Debug.Trace("FusionCore "+oEmptyCore+" created. Health "+oEmptyCore.GetItemHealthPercent()+"%") Returned: [10/30/2021 - 08:36:10AM] - FusionCore [ObjectReference < (FF0036FB)>] created. Health -1.000000% Tried it on in-game fusion cores (with <100% health) - no change to health.
-
I was under the impression that damageobject worked with the 'destruction stages' (not that I know anything about that either) so avoided it. Do you know how the damage value actually alters the healthpercent? And PlaceAtMe will take a leveleditem, but creates an item at full health (even if the leveleditem is defined with reduced health).
-
Basically I want to create multiple items of given health to transfer to an existing container. The item must be based on an existing base Form. Basically adding 'worn' versions to a container. I know you can create such an object in the world (with a certain health) - but it is then a reference so you can't add more than one of it to a container (via additem). Or you can create a leveled list with one (using the "Extra Data" field to set Item Health), but Additem (or placeatme) does not accept LeveledItem Lists. There is also no way to modify an item's health% (you can only read it via getitemhealthpercent()). Am I missing something obvious?
-
Extra info - my test was faulty and I find I cannot reproduce this issue - so looks like an issue with the reporting user's setup. Also I now find they are on 1.10.50 and I forgot they use Scrap Everything (almost a reason to say 'you asked for it' - that mod is brutal). @Rasikko - the linked ref is on the Settlement mapmarker, so no safe place to put an 'onreset', but a useful bit of information. @Niston - Very interesting - I would never have guessed the encounter zone controls (or can stop) Cell resets. So easy to get strange effects then if your build boundary extends past that zone... What is that mod you referred to (that sets clearable locations to 100 years)? I will consider this issue something brought on by that users setup/mod list and unable to pursue it further... There is no way I can duplicate their setup so this will have to be one of those 'happens in somerare cases' sort of issue. Thanks for all the good info though!
-
@niston - Thanks for confirming this. It is what I had gone with as I already had a Perk on the Player (when they are onboard) so an easy fix. It appeared to work so I had my fingers crossed. One interesting quirk is you can't protect yourself this way - even with 'player' in the conditional on the same Perk. Shooting explosive bullets at my feet still kills me....
-
If you craft a 'fast travel' mat to move a settlement fast travel location, then wait for the cell reset (480 hours) via your preferred method, the linked ref change is lost. Also happens for my Vertipads (which move the 'FastTravelFlightLandingFurnitureLinkedRef' linked ref). News to me, but not you veteran FO4 wranglers out there I bet... My question? Best method to restore that link. I can add an 'ongamestart' to the script to fix it on game restart, but would prefer an event triggered by the actual cell reset. Any ideas? Updated: Only some settlements (modded ones?) Now thinking this is a mod induced bug, rather than a game one...
-
My Magic Effect is a 'fire and forget' with 0 duration so that probably explains why it is gone when the script starts. And I probably need to let each instance of the script run so it 'replaces' the consumed Ingestable. Oh well, simplest way is to move the 'AddItem(ingestable)' to the end of the script and hope noone has more than one of them... Unless someone has a better idea (or can configure an ingestable to replace itself without a script)...
-
[Actor] Flying and Floating
PJMail replied to Zorkaz's topic in Fallout 4's Creation Kit and Modders
I have certainly seen the reverse (eyebot bobbing around half submerged in the ground). Before I added eyebots as supported vertibird passengers I could get mine travelling quite high when I flew somewhere, however they did follow me down to ground level when I landed - though I do remember their 'hover height' not being the same until I fast travelled. This suggests it's hover height 'error' is limited. -
I have a 'potion' that triggers a 'magic effect' (which just runs a script) when consumed. If I hotkey the potion I can spam that key and get many simultaneous versions of that magic effect running. This is annoying as its script brings up a menu.... Is there an easy way to block the ME starting if there is already one active? The 'hasmagiceffect' condition does nothing. Is it possible the ME terminates once it launches the script - that would explain the condition failing? I don't want to put some sort of 'lock' in the script unless I can be sure it will be released if the script terminates unexpectedly (game script dumping etc). Surely the game has a nice method of stopping 'effect spamming'? Thanks
-
That is an interesting thought, I have not done much in that area so I will investigate - Thanks! Edit: Seems like I can't specify a condition using the 'source' of the explosion damage in an explosive damage reduction Perk for the NPC. I can choose a target condition on a 'mod weapon attack damage' player perk but that does not seem to effect the secondary explosive damage...
-
Strangely the 'onhit' event says the 'aggressor' is the player (0x14), the 'source' is the ID of the gun (not the explosive), and the 'projectile' is 'none'. So the onhit acts like I used the gun as a 'blunt instrument'... therefore no 'special logic' is possible, and 'ignore friendly hits' does not 'ignore' friendly 'hits'. Thank you Bethesda. I suspect you are right about only projectile 'hits' being ignored....
-
Just to confirm my observation. I have an NPC in the same 'friend' faction as me with IgnoreFriendlyHits(true) set, yet if they get caught by the explosive effect of my gun (with Legendary explosive bullets "0x001E73BA"), the 'onhit' event on their script fires (with me being the aggressor and the gun being the weapon) and they eventually die. If I aim directly at them there is no effect, I have to basically aim at their feet, which suggests it is the explosive effect that is not being 'ignored'. This happens if I do "sifh 1" in the console when they are select too, so it was not a faulty call to IgnoreFriendlyHits. Can anyone confirm that damage from explosions cannot be ignored? Does anyone have a fix? Is it possible to change the apparent 'aggressor' perhaps - or do explosions hurt even the aggressor? I once can across a mod that made the artillery explosions not appear to be caused by the player...