ThoraldGM Posted September 23, 2017 Share Posted September 23, 2017 I wrote a working washer script for the Diamond City security office, but this is my first time taking over vanilla furniture with a script (attached to quest, start game enabled). Because anyone with mods can drop a workbench there and start scrapping, I think I need to check if the washers and dryers exist before forcing them into reference aliases. Actually I'm not sure when to check (or which method is best practice). Is there a condition area in Creation Kit for filling aliases, or should I be checking IsEnabled in the script? I'm going to be grabbing other refs for other reasons too (guards, containers), so this seems like an important issue to figure out. Thanks! Link to comment Share on other sites More sharing options...
JonathanOstrus Posted September 24, 2017 Share Posted September 24, 2017 Well depending how you're grabbing the refs in the first place, they may come back as "None" if they're scrapped. Otherwise a simple IsDisabled() check should be safe enough. I would warn the users about what your mod does in the description of the mod page. If they're going to use it when you've told them what needs to be there and shouldn't be done that's their problem. I have no sympathy for them. Link to comment Share on other sites More sharing options...
ThoraldGM Posted September 24, 2017 Author Share Posted September 24, 2017 Thanks. Laundry is actually a footnote in a larger mod. Since version 2.0 is going to let players store clothing for guards, figured I would provide a path to acquire more outfits. My plan is to make laundry an MCM option that can be turned on/off by the player. Link to comment Share on other sites More sharing options...
ThoraldGM Posted September 27, 2017 Author Share Posted September 27, 2017 This is what I came up with: https://pastebin.com/S2NMkt3z Line 65 (OnInit) lays out the methodology.Line 99 (IsWasherAvailable) starts the actual checking of each washer. Compiled, tested, and works. Here's a tangent question if you are interested. I want to grab the ref of an existing vanilla container and "take it over" with another script (not the laundry script, but a quest script in the same mod). Is there any significant difference between the following 2 methods, or reason to choose one over the other? Option 1: Create 3 reference aliases in CK and force them to specific refs in the CK (locker, desk, cabinet). In code, if the first container is scrapped (NONE), use the second container. If the second is NONE, use the third container. Option 2: Create one reference alias in CK and force it to specific ref in the CK (locker). While still in CK, create/fill alias to desk ref if condition DoesNotExist on locker is true. Still in CK, create/fill alias to cabinet ref if condition DoesNotExist on locker and desk are true. Then do the checks in code to assign which container stores the gear that player wants guards to use. I know I'm under no obligation to hold the player's hand, but part of my project is to see how solid I can make my mod. The only other problem I foresee is that I need to override the locker's reset respawn flag in code, so it no longer resets. (I already changed the container faction so player won't be stealing as they add/remove from the container.) Link to comment Share on other sites More sharing options...
Recommended Posts