Jump to content

how to pass a form to a script


Recommended Posts

So far I am trying to use this syntax, it compiles but nothing shows up in-game. Any clues?

ObjectReference InvisibleMatRef1 = furniturestage3ref.placeatme(Game.GetForm(0x000000C2), 1)

InvisibleMatRef1.setposition(InvisibleMatRef1.getpositionx(), InvisibleMatRef1.getpositiony(), InvisibleMatRef1.getpositionz()+50)

InvisibleMatRef1.addkeyword(workshopkwd)

ObjectReference InvisibleMatRef2 = furniturestage3ref.placeatme(Game.GetForm(0x000000C2), 1)

InvisibleMatRef2.setposition(InvisibleMatRef2.getpositionx(), InvisibleMatRef2.getpositiony(), InvisibleMatRef2.getpositionz()+150)

InvisibleMatRef2.addkeyword(workshopkwd)

ObjectReference wireRef = InvisibleMatRef1.CreateWire(InvisibleMatRef2, Game.GetForm(0x00021F34))

 

 

Link to comment

Figured it out, with the help of F4SE team and kinggath (thank you!)

 

For future reference:

- the endpoint objects .nifs need to have connector points (check out the generator nif for reference, just copy the connector point branch to your nif)

- the endpoint objects need to be linked with a workshop reference - I have used the Sanctuary workshop bench reference

 

For example, this code spawns two objects (which have been added connector points in their nif) and spawns a rope between them

 

ObjectReference SplineStartRef = caster.placeatme(furniturestage3, 1)
SplineStartRef.addkeyword(workshopkwd)
SplineStartRef.SetLinkedRef(workshopref, workshopkwd)


ObjectReference SplineEndRef = caster.placeatme(furniturestage3, 1)
SplineEndRef.setposition(SplineEndRef.getpositionx(), SplineEndRef.getpositiony(), SplineEndRef.getpositionz()+100)
SplineEndRef.addkeyword(workshopkwd)
SplineEndRef.SetLinkedRef(workshopref, workshopkwd)

utility.wait(1)

ObjectReference wireRef = SplineStartRef.createwire(SplineEndRef, Game.GetForm(0x00021F34))
Problem is that the rope is static, it does not adjust if I move the endpoints after spawning. So, kinda fail, overall :(
Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use