Jump to content

BendableSplines -- what will they dynamically attach to?


Recommended Posts

I don't know if attaching splines through papyrus is something that can be done outside of SUP_F4SE but someone in here probably has some idea as to what a spline ref will and will not work with.

I'm playing around with drawing up grids and randomized patterns using splines, attached to (currently) x-markers but It would be infinitely cooler if the attachy refs could just be invisible instead.

Is that possible? I assume the refs need to have loaded 3D. Can they be loaded but set to 0 alpha? How does one set a non-actor object to 0 alpha without having to mess around with new models and meshes? Papyrus only offers Actor.SetAlpha().

Grateful for any help. And have a nice weekend.

Link to comment
Share on other sites

I haven't played around with splines in scripts yet, but it I don't quite understand what your questions is. X-Markers are already invisible and they're being loaded by the engine at runtime and they can be used as REFs. A lot of AI packages use X-Markers. The "3D" is afaik being loaded, but is just hidden under normal circumstances. There is a console command to make them visible ingame though. I don't know if they somehow, magically become visible if being connected through splines, that's at least what your post implies for me. I'm curious how such an implementation would look like anyway, since splines are normally connected/created through SplineEndpointMarkers.
Link to comment
Share on other sites

Sorry for being unclear -- the x-markers I'm using have been repurposed and edited in NifScope to actually be visible, bright red.

So no magic happening afaik with attaching splines. And using other vanilla markers that are still invisible seems to generate no splines.

So far the spline grids look like grates but I'll post images when I get them looking more interesting.

Link to comment
Share on other sites

I saw Bethesda playing around with splines getting longer while being attached to a lift and one can obviously create them in settlement mode so it should be possible. I would recommend to test SplineEndpointMarkers and to take a look at how they implemented splines in the settlement mode.
Link to comment
Share on other sites

Theoretically you could use F4SE AttachWire()/CreateWire(). Wires are made from bendablespline and some connection table entries.

I never tested if the AttachWire() requires the targets to have PowerConnection keyword, but probably not.

 

If it works, it'll attach to P-WS-Snap connection point when present. Or root node when P-WS-Snap is not present. And it'll use slack setting for workshop wires specified in game ini and thickness will be hardcoded to 1.5 for the spline. There will be some overhead vs using "pure" bendablespline, because wires also have some sort of connection table entries in the game - Utilities::ConnectSpline() in game engine takes care of that IIRC.

 

Be very careful to never let any of the wires get connected to a power source for whatever reason, or using Delete() on them will introduce the scrap crash into player's saves.

 

You can turn anything with a material invisible by making a matswap for an invisible material. But xmarkers are invisible by default (IsMarker flag), so I guess I don't understand your last question?

Link to comment
Share on other sites

I never tested if the AttachWire() requires the targets to have PowerConnection keyword, but probably not.

; Attachs a BendableSpline to two other references
; Restrictions:
;	- akRef must not be None
;	- akRef must not be the same as the caller (i.e. no wire to itself)
;	- Spline must be a BendableSpline (None will use FormID 0001D971)
;	- Calling object must be linked to a Workshop (Uses keyword 00054BA6)
;	- Calling object must not be another BendableSpline (i.e. no wire to wire)
; Returns the newly created wire ref (The wire ref is disabled)
ObjectReference Function AttachWire(ObjectReference akRef, Form spline = None) native

In the ObjectReference.psc source file it says it must be linked to a workshop.

 

; - Calling object must be linked to a Workshop (Uses keyword 00054BA6)

Link to comment
Share on other sites

SUP_F4SE seems to be the only way but it works very well. Solved some of the mystery of what it will attach to -- as long as an object is loaded, a zero alpha mesh will work fine. I set it using vertex color in nifscope. But now I'm looking for a more primitive shape than the "X"-marker to make sure as little as possible is happening that doesn't have to. Generating an 4x4 (i.e. 25 point) grid with 8 hanging splines takes about 2 seconds, I bet I could get that down a bit.


I managed to strip the vanilla "SplineMarker" mesh down to just a cube (it came with a caltrop looking shape surrounding it) but now vertex color options won't show up under vertex data as they did with the "X". Any clues as to how I can activate them or what I may have screwed up?


X:



Stripped SplineMarker:


Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...