-
Posts
84 -
Joined
-
Last visited
Everything posted by mfree80286
-
GetFormFromFile and ForceRefTo Events?
mfree80286 replied to ThoraldGM's topic in Fallout 4's Creation Kit and Modders
Have you considered using is3DLoaded and a boolean together in a little function that uses a while loop to wait until the object returns true, then moving? Could TryToEnable the landing point reference instead... Or, add properties to the script that implicitly declare those landing points. You don't have to do anything with them, you just have to have a property with the objectreference in it. https://www.creationkit.com/index.php?title=Persistence_(Papyrus)- 15 replies
-
- getformfromfile
- forcerefto
-
(and 8 more)
Tagged with:
-
Final set of changes and I think it's done. Probably. Changed the MISC bowling pins to new MSTT bowling pins with same keyword attached. Why? Because you could take the MISC ones and that doesn't trip the trigger volume on removal. With the moveable static bowling pins, you can't screw up... you get the 'neg vol' pins out of their trigger volumes and they disappear; and as long as the remaining two pins are in the 'pos vol' trigger boxes, you'll have 10 tokens in the container and the last change to that number will activate the puzzle controller and light/bell/unlock door.
-
Eeee! First success! It's still being a little weird... I've tried to idiotproof the negative volume scripts by disabling the puzzleitem object when it leaves the trigger volume, but some stay and don't trip their volumes... but others make up by doing so twice. In the end, the 7/10 split was done, the newly complicated positive volume scripts work fine (they init a token, remove it if the pin is taken as it shouldn't be, but added back when it's replaced, but then trips and stops checking) All these new 'tripped' bools are blocks for the script re-running since we're looking for one-shots here. This is why I'm disabling the bowling pin when removed from the negative volumes, can't screw up a trigger script by replacing and re-removing items if they're gone. Scriptname EFTH_ItemInTriggerNeg extends ObjectReference ObjectReference property PuzzContainer auto Keyword property PuzzleItemKeyword auto Form property PuzzToken auto Bool VolumeTripped = false event onTriggerLeave (ObjectReference akTriggerRef) if VolumeTripped == 0 if akTriggerRef.hasKeyword(PuzzleItemKeyword) PuzzContainer.AddItem(PuzzToken,1,true) VolumeTripped = 1 akTriggerRef.disable() endIf endIf endEvent Positive volume will check for removal, since it's a valid puzzle status, but starts off 'solved', removes the token if you take the pin, and replaces the token in the container when you put the pin back, then stops checking status Scriptname EFTH_ItemInTriggerPos extends ObjectReference ObjectReference property PuzzContainer auto Keyword property PuzzleItemKeyword auto Form property PuzzToken auto Bool VolumeTrippedOut = false Bool VolumeTripped = false event onInit() PuzzContainer.addItem(PuzzToken,1,true) endEvent event onTriggerLeave (ObjectReference akTriggerRef) if VolumeTripped == 0 if akTriggerRef.hasKeyword(PuzzleItemKeyword) if GetTriggerObjectCount() == 0 PuzzContainer.RemoveItem(PuzzToken,1) VolumeTrippedOut = 1 endIf endIf endIf endEvent event onTriggerEnter (ObjectReference akTriggerRef) if VolumeTripped == 0 if VolumeTrippedOut == 1 if akTriggerRef.HasKeyword(PuzzleItemKeyword) if GetTriggerObjectCount() == 1 PuzzContainer.AddItem(PuzzToken,1,true) VolumeTripped = 1 endIf endIf endIf endIf endEvent The container got redundancy, basically. I was unsure if token additions or removals were being tracked through ALL conditions, so I'm just checking separately on all. It's a simple item count check that trips the puzzle as solved when matched, so it doesn't matter which method catches it, it only matters that it's caught. Scriptname EFTH_Puzzle02Container extends ObjectReference ObjectReference property PuzzController auto Keyword property AllowedItem auto Bool CodeTripped = false Event onInit() AddInventoryEventFilter(AllowedItem) endEvent Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer) if CodeTripped == 0 if (self.getItemCount(AllowedItem) >= 10) PuzzController.activate(game.getplayer()) CodeTripped = 1 endIf endIf endEvent Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) if CodeTripped == 0 if (self.getItemCount(AllowedItem) >= 10) PuzzController.activate(game.getplayer()) CodeTripped = 1 endIf endIf endEvent Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer) if CodeTripped == 0 if (self.getItemCount(AllowedItem) >= 10) PuzzController.activate(game.getplayer()) CodeTripped = 1 endIf endIf endEvent No solid clue why some neg volumes didn't detect their pins being removed... I may have to change the negative volume script to check for it's specific placed object reference rather than the puzzleitemkeyword...
-
The bigger problem with the 10 volume puzzle is that if you akwardly move a pin through more than one volume it still affects the total, in this case dropping the count and for some reason not raising it. That portion of the code got replaced in testing, this is that script currently; Scriptname EFTH_Puzzle02Container extends ObjectReference ObjectReference property PuzzController auto Keyword property AllowedItem auto Event onInit() AddInventoryEventFilter(AllowedItem) endEvent Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer) if (self.getItemCount(AllowedItem) >= 10) PuzzController.activate(game.getplayer()) endIf endEvent So, unless I can find another set of functions to pick on and try to get the 10 volume puzzle working, I'm going to cut it to two pins and a simple check for two trigger entries against pin objects. EDIT: Derp. Like removing the ontriggerenter events from the negative volume script, the ontriggerleave parts from the positive volume script, and put a one-shot bool in both....
-
Alright, untested new method for the full bowling pin puzzle. 1 - the trigger volume. There are two scripts available for a volume now; Scriptname EFTH_ItemInTriggerPos extends ObjectReference ObjectReference property PuzzContainer auto Keyword property PuzzleItemKeyword auto Keyword property PuzzToken auto event onTriggerEnter (ObjectReference akTriggerRef) if akTriggerRef.HasKeyword(PuzzleItemKeyword) PuzzContainer.AddItem(PuzzToken,1,true) endIf endEvent event onTriggerLeave (ObjectReference akTriggerRef) if GetTriggerObjectCount() == 0 PuzzContainer.RemoveItem(PuzzToken,1,true) endIf endEvent Scriptname EFTH_ItemInTriggerNeg extends ObjectReference ObjectReference property PuzzContainer auto Keyword property PuzzleItemKeyword auto Keyword property PuzzToken auto event onTriggerEnter (ObjectReference akTriggerRef) if akTriggerRef.HasKeyword(PuzzleItemKeyword) PuzzContainer.RemoveItem(PuzzToken,1,true) endIf endEvent event onTriggerLeave (ObjectReference akTriggerRef) if GetTriggerObjectCount() == 0 PuzzContainer.AddItem(PuzzToken,1,true) endIf endEvent Basically you have a positive and negative version... both work the same as far as detection goes (only the bowling pin item) but now add or remove a special keyworded puzzle token MISC item from a 'magical' container, when they are in or out of the trigger volume. Pos is for the volumes that 'want' pins, Neg is for the volumes that should be empty. Then, you have the hidden token container, and it's script; Scriptname EFTH_Puzzle02Container extends ObjectReference ObjectReference property PuzzController auto Keyword property AllowedItem auto Event onInit() AddInventoryEventFilter(AllowedItem) endEvent Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) if (aiItemCount == 10) PuzzController.activate(game.getplayer()) endIf endEvent This works like the bear puzzle, except it watches for 10 token items to be present representing that the 10 trigger volumes have all been manipulated correctly. Then it activates the control marker, which has this script, slightly modified from original, as well as the bear-style doorcontroller script. Scriptname EFTH_IndicatorLightScript extends ObjectReference ObjectReference property IndicatorLight auto Sound property RingBell auto bool ScriptActivated event onInit() ScriptActivated = 0 endEvent event onActivate(objectReference akActionRef) debug.trace("LightController recieved activation from " +akActionRef) if (ScriptActivated == 0) ScriptActivated = 1 IndicatorLight.PlayAnimation("Green") int instanceID = RingBell.Play(IndicatorLight) endIf endEvent Major change there is to ring a bell when the light is activated, since this is portable script and further down the line, doors/lights will happen outside the player's sightline. Will see if this all works in a couple hours, but if you see any obvious screwups, commentary is greatly appreciated.
-
Here's the end result for the picture cycler scripts. They ended up so simple.... changed up the math a little bit since I'm watching the stage and not the percentage, percentage is now in decrements of 10 and the last stage does not go to zero; using a starter HP of 99 and reducing by 10 still puts every click within the next destruction stage's percentage range. This was the original test cycler (moving through 4 vanilla painting NIFs) And this is the end product color cycler (start/end on white, moves through 6 colors) Because of the need for a start and end (reset) stage, 7 is the limit for different NIF aspects. That kills this method for alphanumerics, but it's absolutely elegant for any MSTT that needs no more than 7 swaps. And the NIFs are not limited to those taking the same position, it's probably going to center the new NIF on the same reference coordinates as last and it should center on the NIF's center point.... move the center point, move the NIF. You could produce with this an animated dial with up to 7 positions, shift an object around on a table up to 7 places... Anyhow, lots of possibilities. But I still need to figure out how to get the same effect with 10 and 26 swaps. Started to think of a hybridized model where there are two MSTTs that swap using the enable/disable mechanism; instead of resetting on the last stage, self.disable() and swap.enable() and start counting stages on the swap instead. Doing that with 2 MSTTs would cover numerals, doing it with 4 would cover the alphabet (26 chars, 28 slots). Also need to make some icon based cycling NIFS, but I don't know what kind yet. Could also make frameless patterns that roll or change to make an image when all are correct, a sort of jigsaw puzzle. Also need to write a detection script and make sure I don't run into the activation snafu again. Oh, and the bowling pin puzzle. One trigger volume is one thing, wrangling ten is something else.
-
Good news! The setup as described above works perfectly, as intended. No issues there. Now it's down to figuring out the bowling pin puzzle, and actually making the real picture cycling 'machines'. I do still need to know if there's a better swapping solution than the destruction stages (since limited to 8), or simply placing single picture objects overlapping and enabling only one at a time. That seems ripe for a performance hit...
-
Ok, next issue to tackle. What I'm about to post *has* been modified and not tested yet. This is for the cycling pictures... This is an unnamed reference of EFTH_PictureFrameMSTT_TEST02. It's base object is set up with destruction data as follows; Attached to the reference is this script: Scriptname EFTH_PictureCycleReset extends ObjectReference Event OnDestructionStageChanged(int aiOldStage, int aiCurrentStage) int CurrentStage = self.getCurrentDestructionStage() if (CurrentStage > 4) self.clearDestruction() endIf endEvent Previously I'd tried both clearDestruction and self.reset() with no change in behavior. Next to the frame, is unnamed ref of base object EFTH_RedButton01. This ref has two scripts attached; 1 - Default1StateActivator (vanilla, for the button press anim) 2 - EFTH_PictureButtonTest; property TargetedItem is set to the TEST2 picture frame ref above. Scriptname EFTH_PictureButtonTest extends ObjectReference Objectreference property TargetedItem auto Event OnActivate(ObjectReference akActionRef) TargetedItem.DamageObject(25.0) EndEvent What's supposed to happen here, is that the picture starts with 99 hit points and basically just sits there. Pressing the button once damages the picture by 25 points, resulting in 74HP, which is 74.7% and thus below the 75% threshold for setting destruction stage 2. When stage 2 is set, the NIF is swapped to the second prewar picture frame. Another press takes 25HP, same deal with HP and percentages, stage increments, NIF changes. To the player, this appears to change the picture with every press of the button. This obviously can't go on forever; stage 4 is the 'last' stage and stage 5 is hit when HP reaches 0, and swaps to the same NIF used in the starting stage. When the script on the picture detects the stage changing, it's supposed to check for stage greater than 4, and if so, clear the destruction. It's not clear from documentation what this actually means, but I can tell you that so far, none of my attempts have actually reset the picture... it gets to the last stage and stops changing. The above code has not been tested yet and *may* function... testing will need to be done, but there are overarching questions. QUESTION: Does anyone out there know what aspects of the MSTT's destruction data are actually 'cleared up' by clearDestruction()? Does it reset JUST the stage and leave the hit points, or does it set everything back to it's original condition?
-
w00t! The bear puzzle now works as intended. That leaves the remaining problems of: 1 - assembling ten bowling pin trigger volumes in an array and figuring out how to get *them* to activate remote scripts properly, or rewire the whole thing to avoid that issue, and... 2 - figuring out how to properly reset the cycling pictures, as the reset() command doesn't seem to do anything at all. The cycling pictures are going to pose a problem later too, as it seems there's a maximum of 8 damage states available. That's fine for the testing, it's fine for the color pictures (aqua, blue, green, violet, red, yellow, white == 7, plus 1 for the start state). But the numeric pictures will need 10 states and alphabetic would need 27. If there were another easy way to swap object references, or material swaps, or even NIFs like the damage cycle does...
-
Well, you've got a big sign in front of you that effectively says 'Feed The Bears!', player better realize that means food :smile: p.s. the walls have changed since I took that screenshot, turns out there's an entire series of 'concbrick' series of building parts that have no collision mesh on them whatsoever. What a surprise to playtest, back up to get a good screenshot framed (which I never got), and back directly through a wall into the void... swapped everything for plain brick, which is sad because these walls looked good. Suppose I could co-opt the texture but the brick wall fits the story a bit better anyways.
-
On the picture cycler (seems a better name for it), I didn't realize until just now I'd forgotten to add the cycle script to the picture with the button. Come up with something a little different though, think this will work as planned? Scriptname EFTH_PictureCycleReset extends ObjectReference Event OnDestructionStageChanged(int aiOldStage, int aiCurrentStage) if (aiCurrentStage > 4) self.reset() endIf endEvent Remember, all the button does is damage the picture object by 25 points... I'm changing up the stages so it starts at 1 with 100% of 99 points and steps up each stage at a 25% step. Stage - post-click HP - stage percentage - enacted percentage 1 - 99 - 100% - 100% 2 - 74 - 75% - 74.7% 3 - 49 - 50% - 49.5% 4 - 24 - 25% - 24.2% 5 - 00 - 0% - 0% (since I'm checking for stage > 4, immediately on reaching 5 the object should reset)
-
Alright, so here's where we are; Scriptname EFTH_Puzzle01Control extends ObjectReference ObjectReference property DoorController auto ObjectReference property LightController auto Keyword property AllowedItem auto Event onInit() AddInventoryEventFilter(AllowedItem) endEvent Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) if (aiItemCount > 0) DoorController.activate(game.getplayer()) LightController.activate(game.getplayer()) endIf endEvent Going to set AllowedItem to KYWD ObjectTypeFood, just to finish out the desired functionality. Too bad I can't actually test this out until this evening...
-
Yup. That's partially why this has been so confusing, all the activation handoff code has been present since day 1, but behaves in a (seems to me) inconsistent manner. Let's focus back on the bear puzzle, since it was changed the most and is now completely nonfunctional, but *looks* like it should work fine. In the bear; properties DoorController == EFTH_PZ1_DoorController (XMarker), LightController == EFTH_PZ1_LightController (XMarker). No other linkages present for references. Scriptname EFTH_Puzzle01Control extends ObjectReference ObjectReference property DoorController auto ObjectReference property LightController auto Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) if (aiItemCount > 0) DoorController.activate(game.getplayer()) debug.trace("DoorController called active by" + self) LightController.activate(game.getplayer()) debug.trace("LightController called active by" + self) endIf endEvent in EFTH_PZ1_DoorController; properties ControlledDoor == EFTH_PZ1_ExitDoor (BldWoodPDoor01), no other linkages present Scriptname EFTH_DoorControlActivator extends ObjectReference objectReference property ControlledDoor auto Event onActivate(ObjectReference akActionRef) debug.trace("DoorController recieved activation from " +akActionRef) ;ControlledDoor.Activate(game.getplayer()) if (ControlledDoor.isLocked()) ControlledDoor.unlock() ControlledDoor.setOpen() endIf endEvent Note that I'm no longer trying activate or using a script in the door object, I'm just checking for locked condition before unlock/open. in EFTH_PZ1_LightController; properties IndicatorLight == EmergencyLightAnim01 0700645C, no other linkages for ref Scriptname EFTH_IndicatorLightScript extends ObjectReference ObjectReference property IndicatorLight auto bool ScriptActivated event onInit() ScriptActivated = 0 endEvent event onActivate(objectReference akActionRef) debug.trace("LightController recieved activation from " +akActionRef) if (ScriptActivated == 0) ScriptActivated = 1 IndicatorLight.PlayAnimation("Green") endIf endEvent All that was changed here is an attempt to avoid changes to the light state (set green anim once and leave it alone) with possible errant activations. Change in behavior? Nothing happens at all. Door's locked inaccessible and stays that way, no matter how I stuff the bear. Light never plays anim (turns green). So... not passing activate()? If I use the activate parent link, everything fires when I open/close the bear's inventory unless I use that vanilla doorUnlockOnActivate script in the door itself, and I can't leave the door usable after that. Ignore the other two puzzles until I can get this one working, I have a feeling they'll fall in line once the issue's fixed with this one.
-
This is the script in the trigger volume (it's not quite there with onTriggerLeave but this was made to demonstrate first) Scriptname EFTH_ItemInTrigger01 extends ObjectReference ObjectReference property PuzzControllerAct auto Keyword property PuzzleItemKeyword auto event onTriggerEnter (ObjectReference akTriggerRef) if akTriggerRef.HasKeyword(PuzzleItemKeyword) PuzzControllerAct.activate(akTriggerRef) endIf endEvent event onTriggerLeave (ObjectReference akTriggerRef) if GetTriggerObjectCount() == 0 PuzzControllerAct.activate(akTriggerRef) endIf endEvent PuzzControllerAct is a reference to the control marker. This apparently does not properly pass activate()...
-
This is a compilations of screenshots made during testing, showing that the L_TRIGGER collision layer on the trigger volume, with scripting to check for the pin's keyword, does activate with the pin present, and not the player. The 'test light' (subway light) is scripted directly from the trigger volume reference, to enable when activated. Ignore the green light, that's still tied to the control marker which is still using an activate parent link to the trigger volume and fires when anything touches that volume. So what I need to do is figure out how to activate the control marker from the script in the trigger volume. Does that need registerForRemoteEvent, or is there a link ref w/keyword that I'm unaware of?
-
Alright, some changes and testing and here's what I've found. 1 - I apparently have not enabled debugging logs, because all the debug.trace I added did nothing. 2 - (bowling pin puzzle) I hedged my bets previously and added a light that is enabled only when the trigger is set off. Grabbed a pin and waved it through the trigger volume, and the light flashed on every time and off when it was out. Light stayed off when I hopped on the table, so that part's working properly, and that narrows the issue down to having trouble passing activations around properly. 3 - (bear container) Changed this quite a bit to not use the door's activation script at all, just check that it's locked before unlocking/setopen, and similar with the light script (added boolean set onInit 0, and set 1 when running the activation script, and only run the routine if boolean is 0, i.e. once). Cut the activateparent links. And... nothing worked. Again, can't seem to properly activate an external reference from a script. 4 - (painting damage NIF swap) put in a proper switch, switch works... through one cycle. The painting is apparently not resetting to stage 0, not clearing the damage. Need to study other methods of "making it healthy" so the cycle repeats on demand. So most of my issues come down to activating an external reference so it runs it's scripts. What am I missing?
-
Thank for looking at my woes.... The CK has a strange notation to it, it's saying that the collision layer defines what trips the trigger, but then gives an example that seems to match up with the default setting. That's why I mentioned L_TRIGGER, because the static *does* definitely trip collision. My issue is, so do I... and that's probably the fault of the activate parent link. And through all these that's a common issue... ...what I'm missing, is what the proper way of getting an activation of another object to happen from a scripted event actually is, because activate parent links I'm sure simply pass one object's activation up the chain to the next one regardless of what I have in the script. Which is strange as to why the first item (the container>door puzzle) would work at all with parent links. I'm fuzzy on this part of the concept and can't seem to see through it, because it seems to me that even without a parent link, calling a reference directly with activate() should activate it. What's correct to pass in activator(), or does it matter? I've used game.getplayer(), I've used 'self'. doesn't seem to make a difference because I'm not using that info in the next script. EDIT: Oh, and since you RT'd the link I figure I'd better note what the 'look and feel' is supposed to be from these things. 1 - There's a sign on the ground that says 'don't feed the bears' except don't is marked out. There's a teddy bear on a table, you check it out and it's a container. You drop some food in, close, and green light appears on the door next to it, which is now unlocked and opens automatically. 2 - There's a table on the floor with ten bowling pins standing set up, and an arrow pointing towards them that says "Seven Ten Split". You carefully remove all the pins that would have been knocked down in a seven/ten split, leaving those two pins on the table in their proper locations (there are black squares). Once the configuration is right, a green light appears above a door, that unlocks and automatically opens. 3 - That one is a piece of a larger setup, but here's a concept. You enter the room that the last puzzle unlocked. On the wall is a grid of four picture frames with four buttons. You notice that when you press the button next to a frame, the picture in the frame changes color... white, red, green, blue. You notice there's a little mark under one, and the carpet in this room is four different colors. The mark corresponds to the door... so you press the buttons to change the colors on the frames until they match the carpet. When it's right, you hear a bell, head out to the hallway and notice a new door has a green light and has unlocked and opened. Alternately, #3's frames could cycle a partial or full alphabet and a row of them could correspond to a keyword you'd picked up or deciphered elsewhere in the mod. Same result, get it right and another door unlocks w/green light indicator.
-
Item number three, the easiest yet because this mostly works... I've made a moveable static object using the prewar painting 01 NIF. This object has damage settings; it starts with 100 points at stage 1, and every 25% loss moves into the next stage and swaps for the next prewar painting NIF (02, 03, etc) just to have visible proof that it's working. There is a script that watches the damage stage and when it's greater than 4 (i.e. enters stage 5 at 0% health remaining), clears the damage which therefore returns to stage 0 and starts over. Setting self-damage to 10 points per second on one of these, doesn't actually start self-damaging and cycling until you go up and strike the object. That I can live with since it's a test, but wonder why self-damage doesn't initiate even though I've given the object a script that watches event onInit and issues self.DamageObject(10.0). The other test object is identical except there's no self-damage, damage is keyed to a damageObject call attached to onActivate on an external switch. I ran out of testing time yesterday and had accidentally picked a nonfunctional switch... but the idea is to press a button, which damages the painting enough to move to the next stage and swap NIFs. Endgame here is to create NIFs with custom pictograms, letters, or numbers that would cycle through when the button is pressed, eventually to where the player selects the correct ones in a string or grid of these objects, and unlocks the puzzle. Mostly looking for caveats here and why the start and reset would malfunction on the first test painting, since auto-cycling might be used in one or two of these puzzles. I have yet to test the second one with a 'good' switch.
-
Item number two: A little easier to deal with since this isn't fleshed out yet and I'm hunting for how exactly to do it. I have a test fixture for a puzzle that will eventually be expanded into something more complex, but I want to get this part working singly first so I know what I'm doing. - there is a trigger box set above a pad (just texture) on a table. This trigger box has an L_TRIGGER collision boundary, and a script that watches for OnTriggerEnter and/or OnTriggerLeave, and calls activate on a control marker like the above puzzle, but only after checking that the object that tripped the trigger contains a specific keyword. - I have a Misc Item configured with that keyword, that is movable by the player. It's a clean bowling pin. - eventually, the animated light and locked door setup like item 1 The point would be (for the test fixture) that the light animates green and door unlocks, ONLY when the bowling pin is set on the table, and at no other time. Unfortunately, it seems that when I hop on the table, it gets activated as well. Eventually this is going to get expanded into a ten trigger array where the puzzle 'resolves' and unlocks everything when special bowling pins are in two of the triggers, and not in the other eight trigger volumes. All volumes start off with bowling pins, which is why I'm watching for OnTriggerLeave and scanning through using getTriggerObjectCount in the 'real' version. Mostly looking for hints, tricks, and missed details here...
-
This is going to be lengthy because I've gotten myself into a corner with a few things for an upcoming mod... I'll try and keep this organized, brief, and terse. Problem 1: I have the following items already set in place. - a container EFTH_PZ1_Container, with this script. Currently this is intended to open everything up and set the light green when food is placed, but for now I'm allowing for any placed item. Scriptname EFTH_Puzzle01Control extends ObjectReference ObjectReference property DoorController auto ObjectReference property LightController auto Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer) if (aiItemCount > 0) DoorController.activate(game.getplayer()) LightController.activate(game.getplayer()) endIf endEvent - marker EFTH_PZ1_DoorController, with script: Scriptname EFTH_DoorControlActivator extends ObjectReference objectReference property ControlledDoor auto Event onActivate(ObjectReference akActionRef) ControlledDoor.Activate(game.getplayer()) endEvent - marker EFTH_PZ1_LightController, with script: Scriptname EFTH_IndicatorLightScript extends ObjectReference ObjectReference property IndicatorLight auto event onActivate(objectReference akActionRef) IndicatorLight.PlayAnimation("Green") endEvent - door EFTH_PZ1_ExitDoor, with vanilla script DefaultUnlockLinkonActivate, and bShouldOpenDoor set true. Activate parent linked to EFTH_PZ1_DoorController - activator EmergencyLightAnim01, activate parent EFTH_PZ1_LightController. Behavior: When the door reference is set to inaccessible, this all works as intended when the two markers have the container set as an activate parent. However, this means the door isn't closeable, and since I want parts of this setup portable (40 more doors to do later), I want user control afterwards. But, with the reference accessible and locked to any tier, and the unlock function added to the doorcontroller script, everything fires on accessing the container, and fires repeatedly. Removing the activate parent links from the markers to the container just result in getting the door lock warning when accessing the container, and no activations. I'm obviously not doing something right here.... I'm going to put the other two in responses to keep this organized
-
I'm trying things until I hear something that clicks. Next thing to try, I have a hidden intermediate container (with keywordworkshopcontainer) linked with workshopitemkeyword and workshoplinkcontainer to a settlement workbench. There is an accessible container linked to the hidden intermediate in the same manner... I did this in case it does *not* work, what I will try after that is making a 'faux workbench' furniture object linked through the intermediate, using the same mesh that I've got set up with the accessible containers (an assembly of 16 floor safes, turned on their side and attached to a wall in a grid layout). This doesn't connect the settlements but would provide a single, handy spot to move things around.... if it works. So, this attempt is ACC_CONT > (workshopitemkeyword,workshoplinkcontainer) > IMED_CONT > (workshopitemkeyword,workshoplinkcontainer) > WORKSHOP_REF
-
I'll lay out a test case, just to be more clear. First cell, it's L1SA. Workbench would be WB_L1SA, container CT_L1SA. Second cell, is L4SD. WB_L4SD and CT_L4SD as above. We'll call a central container in the core CT_CORE. Tried so far: CT_CORE > WorkshopLinkedContainer > CT_L1SA CT_CORE > WorkshopLinkedContainer > WB_L1SA with and without CT_CORE > WorkshopItemKeyword > WB_L1SA CT_L4SD > WorkshopLinkedContainer > WB_L1SA (leaving CT_L1SA>WB_L1SA intact) I have noticed that I can't add more than one of the same keyword to the container object... if I've edited CT_CORE and linked to CT_L1SA with the WorkShopLinkedContainer keyword, and then tried to link CT_CORE to WB_L4SD with a new instance of the same keyword, the CK will simply edit that first instance. That's expected, I think... makes this complicated, and that's why I asked for help before diving in any further.
-
Insufficient light from glowing item
mfree80286 replied to mfree80286's topic in Fallout 4's Discussion
Huh, didn't get any notifications on this thread. I figured out the easiest way to do this was to make it a lobbed projectile (i.e grenade) with no damage, because the PROJ item type allows you to assign a light to the projectile itself. I then made a custom green light that fit what I wanted. Still have some tweaking to do in that I wanted the projectile to "self-injure", basically count it's HP down to zero so it would go out after several minutes and turn back into the base object to collect and reuse. Oh, and the emittance value in BGSM will not 'cast' light, that pretty much requires an LGHT object and attaching one to the NIF is not straightforward at all, though that's how it's done for lanterns and such.