Jump to content

[LE] Moving static object to character body node


Jollypolly

Recommended Posts

Hello,
I'm trying to move an xMarker to the PlayerRefs head node (or any other character body part for that matter) using the MoveToNode method, but it doesn't work.

Here is the basic code i'm using

;----Properties----
STATIC property xMarker Auto
Actor Property PlayerRef Auto

;----Variables----
;/Edit/; ObjectReference Marker1

;----Events----
Event OnInit()
Marker1 = PlayerRef.PlaceAtMe(xMarker as form, 1, false, false)
RegisterForSingleUpdate(5.0)
EndEvent

Event OnUpdate()
Marker1.MoveToNode(PlayerRef, "NPC Head [Head]")
RegisterForSingleUpdate(1.0)
EndEvent

I also tried different names for the nodeName in the MoveToNode function like "NPC Head", "NPC Head [Head]" or "[Head]". The marker always pops at the characters feet but never translates to the head. Any idea why?

 

I also tried the SplineTranslateToRefNode() with no success either.

 

Thanks

Edited by Jollypolly
Link to comment
Share on other sites

I am surprised that your code compiles. Marker1 while given a value is not defined as a specific object type. Hopefully this was just forgotten when copying the code to the forum and you have a non-property ObjectReference declaration in the empty state for Marker1.

 

As far as the node thing, have you cracked open the head mesh in NifSkope to see what the node is actually called? Maybe it is not working due to there being no node with the names that you have tried. Cannot say for sure as I have not used either of the functions you mentioned before.

Link to comment
Share on other sites

Just out of curiosity, as I actually like to have an object being moved to a character's back when that character moves.

 

Does the script example of yours fire often enough in theory, to show a seamless movement?

 

 

 

I either tried to add the object I would like to see on the back of my NPC as a backpack type. But unfortunately it seems that creature cannot equip backpacks.

As I either have not much experience with mesh editing I am not sure how to add that object right into the mesh so it will be natively a part of the creature mesh.

 

Therefore my last resort would have been a script that moves the said object to the back of the creature as long as it is alive (MoveTo and SetAngle, the object in question has no collision so that should be fine).

As soon as it dies, the object will be disabled after an actual useable object for the player will be dropped at the same place.

 

@Jollypolly

Sorry for not being much of a help, but it seems we both have a similar problem.

We try to move a static object towards an Actor, even though you go for the body nodes.

I hope you'll get your solution. Maybe that one could also help me out. :)

Link to comment
Share on other sites

@JustChill

I tired what you want to do:

The MoveToNode() method with a very small RegisterForSingleUpdate() will give the impression your object is constantly popping on and off.

The SplineTranslateToRefNode() with a very high translate speed and a very small RegisterForSingleUpdate() value will be seemless unless your character starts moving: there is always a small jitter unfortunately. (You also have to disable/delete the collision behaviour on your object or it will be a hot mess. Also it will always center the object on the creature node so it will be impossible to place your backpack in a natural way with no creature-backpack mesh penetration)

Edited by Jollypolly
Link to comment
Share on other sites

If I understand what you want to do correctly, it's actually pretty easy to do with The Nexus Outfit Studio.

1) Load your creature mesh

2)Load the backpack

3) Place the Backpack appropriately

4) Set the creature as the reference

5)Copy the creature desired bone(s) to the backpack

6) Set an appropriate partition on the backpack that is not 32 Body or any partition that is already used by the creature

7)Export backpack without the creature.

8)Load the backpack in the CK as an armor addon, select the creature race in the dropdown menu, set the right partition slotand assign it to a new armor with the same options.

9) Your creature should be able to equip it.

Edited by Jollypolly
Link to comment
Share on other sites

  • Recently Browsing   0 members

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