Jump to content

CompGuyJMB

Members
  • Posts

    34
  • Joined

  • Last visited

Nexus Mods Profile

About CompGuyJMB

Profile Fields

  • Country
    United States

CompGuyJMB's Achievements

Explorer

Explorer (4/14)

0

Reputation

  1. OK, that makes sense. I had every other mod except this one disabled during my testing.
  2. Wonder why I couldn't find that. Thanks, ThoraldGM!
  3. Thanks, JackRob. Where in the Creation Kit would I go to make the "archived mod"? Other than the script inclusion, are there any other differences?
  4. Hi Everybody! (Hi Dr. Nick!) I've created a small mod (ESP file) that adds a new interior cell. I have written some custom Papyrus scripts as part of the mod. While sharing it here on the forms to get some troubleshooting help (https://forums.nexusmods.com/index.php?/topic/6413086-script-compiles-doesnt-work-as-intended-noob/), the guys were saying that the scripts were not showing up. I know they were there though, attached to the appropriate ObjectReferences. Do I have to do something special to get my scripts to "become part of the ESP file", so I can share the ESP file and the scripts are included? (That was a Simpsons reference above if anyone missed it...)
  5. I FINALLY GOT EVERYTHING TO WORK THE WAY I WANT IT TO! I got a little creative disabling the generator on initialize. Basically if the marker is off, it shuts the generator off. This only needs to happen the first time things load. I guess OnInit would not disable the generator - maybe the cell wasn't fully loaded (even with a 5 second wait) Thanks so much guys! ESP is updated for you guys to look at if you like. I still have to figure out how to "compile the scripts into the ESP" so they are present. ESP Ilnk: https://www.dropbox.com/s/3lxifp1pnnz44i8/JMB.esp?dl=0 Generator Switch code: Scriptname JMBBunkerGeneratorSwitchScript extends ObjectReference ObjectReference Property GeneratorEnableMarker Auto {Enable / Disable Marker for Generator} ObjectReference Property Generator Auto {The generator that is toggled on and off} ObjectReference Property CellWorkshop Auto {Link this to the cells Workbench} ; Needed for the “CurrentPowerGeneration” variable to get its value WorkshopParentScript Property WorkshopParent Auto Const {Set this to WorkshopParent} Event OnCellAttach() Utility.Wait(1.0) ; Wait 1 second to let cell load ; Retrieve the Current Power Output in the Workshop float CurrentPowerGeneration = CellWorkshop.GetValue(WorkshopParent.WorkshopRatings[WorkshopParent.WorkshopRatingPower].resourceValue) Generator.BlockActivation(true,true) ; Blocks Player Activation, Disables Activate prompt in game. ; Generator.Activate(Game.GetPlayer(), true) will still work, as "true" forces the activation to occur, but also bypasses the OnActivate() event on the generator itself. If (GeneratorEnableMarker.IsDisabled()) ; This means that the Generator SHOULD be off If (CurrentPowerGeneration > 1.0) ; See if Power is being generated (ie Generator is on) Generator.Activate(Game.GetPlayer(), true) ; Activate the generator to turn it off (true disables OnActivate from firing) Debug.MessageBox ("Trying to Shut Down Generator") EndIf EndIf EndEvent Event OnActivate(ObjectReference akActionRef) If (GeneratorEnableMarker.IsDisabled()) GeneratorEnableMarker.Enable() Else GeneratorEnableMarker.Disable() EndIf Generator.Activate(Game.GetPlayer(), true) ;Toggle Generator State - Have to use True since BlockActivation is used above EndEvent Radio Code: Scriptname JMBBunkerCheckForPower extends ObjectReference {Checks to see if PowerSource is on before allowing device (self) to turn on} Event OnCellAttach() ; When Player enters cell Utility.Wait(1.0) ; Wait 1 second to give the cell some time to load. Cannot use OnLoad or OnCellLoad - not fired everytime cell is entered, or OnInit - only fires when ESP is loaded. If (IsPowered() == false) ; Check if Device is receiving power from Workshop (not necessarily turned on) BlockActivation(true) Else BlockActivation(false) EndIf EndEvent Event OnPowerOn(ObjectReference akPowerGenerator) ; When Workshop Power is Turned On BlockActivation(false) EndEvent Event OnPowerOff() ; When Workshop Power is Turned Off BlockActivation(true) ; If Radio is Playing, Turn it Off If (IsRadioOn()== true) SetRadioOn(false) EndIf EndEvent Now I just have to add the rest of the details. Thanks again!
  6. Kitcat, do you know how would I be able to "fully compile" this mod with the scripts if I wanted to share it? I'm also not sure how he was able to move it either. I couldn't. Not in Workshop move, and now with the Z key like he mentioned. I did not create a crafting recipe. My experience is nowhere near that yet. Seems like we're all getting different results from the same file :confused:
  7. So, I loaded the same ESP as I shared here. Even with upping the PowerRadiation from 50 to 500, it had no effect on the radio. 1. I built a ceiling power conduit, but could not attach my generator to it - most likely because the visual model I'm using doesn't have a power line attachment. 2. I built a small generator while in workshop mode, and this still had no effect on the radio (using CanBePowered keyword). As soon as I connected the workshop generator to the power conduit, everything worked fine. YAY! 3. In the creation kit, I removed my "pre-installed" generator, and placed DLC02WorkshopGeneratorFusion, adding a PowerRadiation of 500.00 (it had none by default). This generator has a power connection by vanilla. Started the game, and the radio didn't work. As soon as I attached the generator to the power conduit, things worked fine. 4. I went back into the creation kit and added a ceiling power conduit. Went back in game, and as soon as I connected the generator to the condiut, things worked fine. So, it seems that regardless of the PowerRadiation setting of the generator, the radio does not "receive" power until the generator is connected to a power conduit (as I believe someone may have mentioned). The generator itself will not "radiate" power, despite having this keyword. This is kind of odd, and may take some tinkering if I decide to persue it. Good news is I now know the problem was generator/power radiation related, not radio script related. One last thing to contend with is having the generator start in the "powered off" state. Last month, I had posted that question here, and received no "helpful" answers: https://forums.nexusmods.com/index.php?/topic/6379166-creation-kit-switch-controlled-generator/ Now knowing more about how the creation kit works, I can probably eventually figure this out... unless someone knows off the top of their head :wink: I'm thinking a simple check at OnInit to see if the workshop is getting power and if so, "activate" the generator to turn it off. This would have to be done at OnInit instead of OnCellAttach, otherwise the generator would continually shut itself off, if the player decides he wants to leave it on. Another "interesting idea" I had is to find a way to have the generator "consume" fusion cells. Perhaps set a counter that starts on activation (power up) and pauses on activation (power off). After so accumulated time running, it would shut down. When re-activated it would remove a fusion cell from the player's inventory, or complain that they don't have one and have to get one. I've seen some Skyrim scripts on making a working fireplace that removes kindling from the player's inventory, so I know it's possible. You know, more difficult ideas just for immersion's sake :smile:
  8. I think I posted the link to the ESP earlier, but I just made sure the most-recent version is there. Here's the link in case it isn't working. I haven't shared too much with Dropbox :) https://www.dropbox.com/s/3lxifp1pnnz44i8/JMB.esp?dl=0 I'm not sure why the script isn't showing up. Do I need to include something else or compile it differently? I've included it below: Scriptname JMBBunkerCheckForPower extends ObjectReference {Checks to see if PowerSource is on before allowing device (self) to turn on} Event OnCellAttach() ; When Player enters cell Utility.Wait(2.0) ; Wait 2 seconds to give the cell some time to load. Cannot use OnLoad or OnCellLoad - not fired everytime cell is entered, or OnInit - only fires when ESP is loaded. If (Self.IsPowered() == false) ; Check if Device is receiving power from Workshop (not necessarily turned on) BlockActivation(true) Debug.MessageBox ("Device is not receiving power") Else BlockActivation(false) Debug.MessageBox ("Device IS receiving power") EndIf EndEvent Event OnPowerOn(ObjectReference akPowerGenerator) ; When Workshop Power is Turned On Debug.MessageBox ("Generator was Turned On") BlockActivation(false) EndEvent Event OnPowerOff() ; When Workshop Power is Turned Off Debug.MessageBox ("Generator was Turned Off") BlockActivation(true) ; If Radio is Playing, Turn it Off If (IsRadioOn()== true) SetRadioOn(false) ; stop playing EndIf EndEvent Thanks again to all of you for putting your time into helping me work through this.
  9. I'm not using OnInit because of that reason. I'm using OnCellAttach. The first line in OnCellAttach is Utility.Wait(2) to make the script pause for 2 seconds before checking for power, to give the cell some time to fully load. It very well could be that I have to attach a power conduit to get things to work. I'll have to check tonight, I'm taking a break from hanging drywall. Darn wife and her priorities :-)
  10. So, even with adding a PowerRadiation value to the generator, it doesn't "radiate" the power? I still have to connect the generator to a pylon or conduit / connector? If so, I can incorporate that as a quest or something to make it fit my lore.. this was the one last step he didn't complete before the bombs dropped. :)
  11. See, that's weird, because when you first enter the cell, the generator is running. I can tell because it adds 10 to the workshop power. If I turn it off, the workshop power drops to zero. It could be the PowerRadiation Range, I'll have to look at that. The enable marker is no longer tied to the generator (though it is named as such). Initially, when you hit that switch, it would Enable the generator (there was a static one there so that the enable / disable didn't make it disappear), and it also activated the enable/disable marker for the lights. I eliminated the generator control portion until the radio thing got worked out - reducing variables. Now, all that switch does is enable the marker for the lights. To make my generator, I used the workshop large generator, and just re-skinned it (changed the model). It should be the same as the large generator, just look different... I'll delete my generator and try placing one in workshop mode and see if that makes a difference. Sounds like it may have for you guys, so maybe something is funky with the generator. If that works, I'll try placing one of the "vanilla" ones without re-skinning it to see if that's the culprit. I'll also try a fresh game as Kitcat suggested. Thanks again guys! One more thing, I threw a bunch of Workshop Keywords at it too. Nothing worked... even tried linking the radio to the workshop as a WorkshopKeywordItem.
  12. Hi Kitcat, Thanks for taking the time to check it out. Yes, the button is "detached" at the moment - it's still present but I isolated it from the script for troubleshooting. I have the generator running as it normally would until I get the radio thing figured out. It can be turned on / off by activating the generator itself. The fusion core is simply aesthetic. Down the line, I want to experiment with making the generator "consume" fusion cores, so you have to replenish them so often. The script is added to the radio. Double click on it, and then click on the "Edit Base" button. This is where think you as well as BigAndFlabby suggested I attach it. It was originally in the Reference Box, on the Scripts tab. This is the box before you click the "Edit Base" button. The power connection on the ceiling is left over from my first attempt at making the generator power the cell. I decided to go with the PowerRadiation keyword to avoid wires in the cell. As your question regarding snapping, the 5th button in (a finger pointing), and clicking on the Movement tab allows you to modify the Snap "grid" in the render window, so things align. Pressing Q toggles the snap on and off. I prefer to set the snap at 16 for walls and floors, and 4 when decorating. Pressing Shift + Q will allwo you to double-click on a reference point (say a floor piece) to set that as the "home" for the grid. If things are close but won't quite snap, Press Shift + Q, then double click on the floor piece you want to snap to. Then move the other piece and it will snap. Also for decorating, you can press F to make things "drop" to the floor or a counter, so they're not floating above it. Some surfaces will let things fall though, so be cautious of that. Just press CTRL + Z to undo the drop, and move it manually by holding Z (for Z-Axis). Edit: Updated my ESP to address some of the things you pointed out (as well as add tonight's changes). When I test my mod, I have been loading a save that was created before I began developing my mod. This way, I know my save file isn't contaminated.
  13. So... still not working by moving the script to the base... When switched on, my generator does add power to the workshop. With kitkat's script, the radio just sits there and won't turn on when activated. This time I'm posting all the info I can (in the below images). Hopefully you guys can see what I'm missing? Remember, I'm new, so it could be something you'd assume I know. Radio Info: https://www.dropbox.com/s/tjv4s0muiahjatd/RadioInfo.png?dl=0 Generator Info: https://www.dropbox.com/s/xat6hb1adsajq9a/GeneratorInfo.png?dl=0 Oh, and really - thanks for all the help so far! Edit: Here's a link to the current ESP: https://www.dropbox.com/s/3lxifp1pnnz44i8/JMB.esp?dl=0
  14. I'll try moving the script from the reference window for the radio to the edit base window on the radio. I did add a PowerRadiation tag to the generator of 100, so I don't need to add wires (at least for this)
  15. The script is attached to the Reference box, under the Scripts tab. When you double-click the item in the Render Window, and scroll to the last tab. It's the box before you click the Edit Base button (which is the image shared above) Photo below: https://www.dropbox.com/s/i7vhquang5xxcjn/ReferenceBox.png?dl=0 Is this the wrong location to attach the script?
×
×
  • Create New...