-
Posts
877 -
Joined
-
Last visited
Nexus Mods Profile
About DieFeM
![](https://forums.nexusmods.com/uploads/monthly_2023_12/Supporter_pill.png.ad698355fd0afaf65b3749d0c051c945.png)
Profile Fields
-
Country
Spain
-
Currently Playing
Fallout 4
-
Favourite Game
Fallout 4
Recent Profile Visitors
6141 profile views
DieFeM's Achievements
Experienced (11/14)
14
Reputation
-
If you don't find any other solution you can pass a formlist with all existing components to removecomponents with icount to -1
-
Place my items all over commonwealth
DieFeM replied to buzzudit's topic in Fallout 4's Creation Kit and Modders
You could attach a script to the base object of vanilla chems of your choice, so that it drops one of your chems right next to it. Scriptname MyChemSpawn extends ObjectReference FormList Property MyChemList Auto Mandatory int chancePerCent = 20 bool doOnce = False ; Do this once the parent cell loads, so you make sure it is attached to a cell, not thrown from the inventory Event OnCellLoad() ; Make sure to take the chance only once If(!doOnce) int chanceRoll = utility.RandomInt(0, 100) ; Randomly select a number between 0 and 100, ; if this number is under chancePerCent it will spawn some random chem from the list. if(chanceRoll < chancePerCent) int lastIndex = MyChemList.GetSize() - 1 int randomIndex = utility.RandomInt(0, lastIndex) ; Select a ramdom index from the list Potion randomChem = MyChemList.GetAt(randomIndex) As Potion PlaceAtMe(randomChem) endIf doOnce = True endIf EndEvent -
[SOLUTION] Bypass 128 Array Element Limit - No F4SE
DieFeM replied to niston's topic in Fallout 4's Creation Kit and Modders
If placeatme makes it slow, you maybe could use FindAllReferencesOfType which will also create arrays bigger than 128 elements, so you just need to use placeatme once to spawn as many of the objects (with aiCount param) which you will later add to the array with findallreferencesoftype. You just need to figure out the clean up, removing the spawned objects from the cell. Maybe you could create a type of object that removes itself with a certain event to avoid removing them in a loop. -
Did you try to load it in a new game? The brown face texture might be due to an error loading the face textures because it might have a set of textures loaded from the saved game that doesn't match the current mesh.
-
I'd say the timer should be outside of the distance conditional. Function PlayCustomSound() ; code of the function If Game.GetPlayer().GetDistance(Self) <= 1000 ; player is within 1000 game units to this reference RCA_JuggernogJingle.Play(Self) ; play the sound EndIf StartTimerGameTime(0.25, 555) ; restart the timer EndFunction That way it will continue looping the timer, even if you are more than 1000 units away, until it unloads.
-
If you look at WorkshopScript.psc you'll notice this property is marked as a constant ActorBase Property CustomWorkshopNPC Auto const Unfortunately this property cannot be changed during runtime. Edit: As the comment of this property points out, this property is meant to override the one in the workshop parent script, so it is probably not set in the workshop reference. You can only set that manually, in the CK, editing the script properties, in the object reference from the worldspace/interior, in the render window.
-
Let say you have the workshop reference as a property, like this: ObjectReference Property WorkshopRef Auto You can either replace ObjectReference with WorkshopScript, like this: WorkshopScript Property WorkshopRef Auto Or you can cast the ObjecetReference as WorkshopScript WorkshopScript CastedWorkshopRef = WorkshopRef As WorkshopScript Or you can just use (WorkshopRef As WorkshopScript) When you have a WorkshopScript object, you only need to assign the new ActorBase like this: WorkshopRef.CustomWorkshopNPC = YourBaseNPC or CastedWorkshopRef.CustomWorkshopNPC = YourBaseNPC or (WorkshopRef As WorkshopScript).CustomWorkshopNPC = YourBaseNPC There might be other methods, but I never needed anything fancier than that.
-
I never created a mod with MCM, but out of curiosity I've downloaded the demo plugin, and checked config.json, there's an ON/OFF that calls a function: { "id": "bEnabled:Main", "text": "Mod Enabled", "type": "switcher", "help": "Controls whether the mod is enabled. (demo for ON/OFF switcher control)", "valueOptions": { "sourceType": "ModSettingBool" }, "action": { "type": "CallFunction", "form": "MCM_Demo.esp|800", "function": "DoActionDemo", "params": ["{value}"] } }, I guess MCM will replace {value} with true/false depending on the option and passes it to DoActionDemo as argument.
-
Location akNewLoc and cells with no name
DieFeM replied to F4llfield's topic in Fallout 4's Creation Kit and Modders
My suggestion: Event/Function ToInitilaize() RegisterForDistanceGreaterThanEvent(Center, NPC, X) RegisterForDistanceLessThanEvent(Center, NPC, X) endEvent/Function Event OnDistanceLessThan(ObjectReference akObj1, ObjectReference akObj2, float afDistance) RegisterForDistanceGreaterThanEvent(Center, NPC, X) ;Equip hazmat endEvent Event OnDistanceGreaterThan(ObjectReference akObj1, ObjectReference akObj2, float afDistance) RegisterForDistanceLessThanEvent(Center, NPC, X) ;Unequip hazmat endEvent PS: RegisterForDistanceX registers to receive a single OnDistanceX event, so that you need to register again each time a distance event is received. -
Check the first example here: https://falloutck.uesp.net/wiki/RegisterForMagicEffectApplyEvent_-_ScriptObject Note that it registers a single event, so you'd need to re-register on every event to continuously checking for magic effects applied. For example: Event OnInit() RegisterForMagicEffectApplyEvent(Game.GetPlayer()) EndEvent Event OnMagicEffectApply(ObjectReference akTarget, ObjectReference akCaster, MagicEffect akEffect) ;/ do your thing /; Debug.Trace(akCaster + " applied the " + akEffect + " on " + akTarget) ;/ re-register for next effect /; RegisterForMagicEffectApplyEvent(Game.GetPlayer()) EndEvent
-
Game.GetPlayer() returns an Actor, but akReference is an ObjectReference, I'd say you need to cast the player to an ObjectReference: if akReference == (PlayerRef As ObjectReference) but there's another thing, akReference is not meant to be the Actor who equiped the object, but the reference of the object that was equiped by the actor. https://falloutck.uesp.net/wiki/OnItemEquipped_-_Actor akReference: The reference that the actor just equipped - if the reference is persistant. Otherwise, None.