Jump to content

[LE] TranslateTo script problem


Recommended Posts

Hi all

 

I'm trying to move a boat in an open space but my script dsnt work.

Did I write anything wrong?

 

 

 

Scriptname QLH_Movimento_Barca_02 extends ObjectReference

Float Property PosX2 Auto
Float Property PosY2 Auto
Float Property PosZ2 Auto
Float Property RotX2 Auto
Float Property RotY2 Auto
Float Property RotZ2 Auto
Float Property RotationVal Auto
Float Property SpeedVal Auto
Float Property Time Auto

ObjectReference Property TranslateRef Auto

Event OnActivate(ObjectReference akActionRef)

TranslateRef.TranslateTo(PosX2, PosY2, posZ2, RotX2, RotY2, RotZ2, SpeedVal, RotationVal)

EndEvent

 

 

Link to comment
Share on other sites

So, i'm guessing that by "I'm trying to move a boat in an open space" you mean that you have a boat you want to 'translate to' in an exterior cell (worldspace), if this is the case then.

All translation function used on exterior cells works ONLY if the player and the object that's been 'translated to' are in the same cell. For example:

- If the player is in cell A and the boat is in cell B which is 2+ cells away from the player, the 'Translate' function will not work.

- If the player and the boat are in the same cell and the boat which is been 'translated to' leaves the same cell which the player is, after 2+ cells the boat will stop been 'translated to' because the function will fail since the object is no longer in the same cell with the player.

Link to comment
Share on other sites

 

So, i'm guessing that by "I'm trying to move a boat in an open space" you mean that you have a boat you want to 'translate to' in an exterior cell (worldspace), if this is the case then.
All translation function used on exterior cells works ONLY if the player and the object that's been 'translated to' are in the same cell. For example:
- If the player is in cell A and the boat is in cell B which is 2+ cells away from the player, the 'Translate' function will not work.
- If the player and the boat are in the same cell and the boat which is been 'translated to' leaves the same cell which the player is, after 2+ cells the boat will stop been 'translated to' because the function will fail since the object is no longer in the same cell with the player.

 

Hi maxarturo and thnx for the answer.

I have already done a check and it's all in the same cell, both the trigger to activate the movement of the boat on which I put the script, both the boat and the coordinates to be reached, and the player too...

I had also thought that the collision of the water could somehow interfere, but even removing the water doesnt work, then I also thought that it was the NIF of the boat that had problems, so I did a test with a 3D model, obviously a MovableStatic, which I had already used in an Interior that worked with the same script on another activation trigger, but still nothing moves, I activate the trigger and the TranslateRef does not move ... I don't know what else to think

Edited by Tiziano74
Link to comment
Share on other sites

'SetMotionType(4)' is not needed for 'MovableStatic' as long as the NIF has the appropriate collision set up.

- Check that: your NIF has the correct set up.

- Check that:

ObjectReference Property TranslateRef Auto

Is actually pointing towards your boat.

- Check that: All your 'float' properties are assigned.


If the player and the boat are in the same cell and the NIF is correct and the script has all its property correctly assigned.

Then the only thing I can think of is that, you are testing on a 'save file' that has seen the mod and at some point the script and/or it properties were change and you continiue to use the same 'save file', so the script is malfunctioning.

Don't use save files to test scripts if you will be changing and/or modifing it, always coc or cow.

Link to comment
Share on other sites

 

 

So, i'm guessing that by "I'm trying to move a boat in an open space" you mean that you have a boat you want to 'translate to' in an exterior cell (worldspace), if this is the case then.
All translation function used on exterior cells works ONLY if the player and the object that's been 'translated to' are in the same cell. For example:
- If the player is in cell A and the boat is in cell B which is 2+ cells away from the player, the 'Translate' function will not work.
- If the player and the boat are in the same cell and the boat which is been 'translated to' leaves the same cell which the player is, after 2+ cells the boat will stop been 'translated to' because the function will fail since the object is no longer in the same cell with the player.

 

Hi maxarturo and thnx for the answer.

I have already done a check and it's all in the same cell, both the trigger to activate the movement of the boat on which I put the script, both the boat and the coordinates to be reached, and the player too...

I had also thought that the collision of the water could somehow interfere, but even removing the water doesnt work, then I also thought that it was the NIF of the boat that had problems, so I did a test with a 3D model, obviously a MovableStatic, which I had already used in an Interior that worked with the same script on another activation trigger, but still nothing moves, I activate the trigger and the TranslateRef does not move ... I don't know what else to think

 

Hi Sphered

I have never used SetMotionType and I tried this way, with a debug notification when I enter the cell, but maybe I entered it the wrong way, because nothing is moving yet ...

 

 

 

Scriptname QLH_Movimento_Barca_02 extends ObjectReference

 

Float Property PosX2 Auto

Float Property PosY2 Auto

Float Property PosZ2 Auto

Float Property RotX2 Auto

Float Property RotY2 Auto

Float Property RotZ2 Auto

Float Property RotationVal Auto

Float Property SpeedVal Auto

Float Property Time Auto

 

ObjectReference Property TranslateRef Auto

 

Event OnCellAttach()

 

debug.notification("Sei entrato nella cella")

TranslateRef.SetMotionType(4)

 

EndEvent

 

Event OnActivate(ObjectReference akActionRef)

 

TranslateRef.TranslateTo(PosX2, PosY2, posZ2, RotX2, RotY2, RotZ2, SpeedVal, RotationVal)

 

EndEvent

 

 

Link to comment
Share on other sites

 

'SetMotionType(4)' is not needed for 'MovableStatic' as long as the NIF has the appropriate collision set up.
- Check that: your NIF has the correct set up.
- Check that:
ObjectReference Property TranslateRef Auto
Is actually pointing towards your boat.
- Check that: All your 'float' properties are assigned.
If the player and the boat are in the same cell and the NIF is correct and the script has all its property correctly assigned.
Then the only thing I can think of is that, you are testing on a 'save file' that has seen the mod and at some point the script and/or it properties were change and you continiue to use the same 'save file', so the script is malfunctioning.
Don't use save files to test scripts if you will be changing and/or modifing it, always coc or cow.

 

OK

What's the correct NIF setup? I use the "Dungeons\Ship\ShipRowBoatAnim01.nif" as a MovableStatic

All the Properties of the script are well assigned

There are no saves ... i enter in game for all my test with the COC on the name of the cell and an XMarker to be safe about aventually save issues

 

At this point i think that could be something in the NIF, but what?

Link to comment
Share on other sites

- Extract the nif boat from the Skyrim BSA.

- Open the NIF in NifSkope.

- Go to:

bhkCollisionObject > bhkRigidBody > Havok Col Filter = ANIMASTATIC

And

Havok Col Filter Copy = ANIMASTATIC

And

Motion System = MO_SYS_BOX

Deactivation Type = DEACTIVATOR_NEVER

Solver Deactivation = SOLVER_DEACTIVATION_OFF

Quality Type = MO_QUAL_INVALID


Now insert the NIF into CK as a new mouvable static object. The NIF has now mouvable collision that can be translated and actors can move with the nif.

As long as everything is set up correctly this is all that you need to make a nif move and to be able to move with actors on it.

Edited by maxarturo
Link to comment
Share on other sites

 

- Extract the nif boat from the Skyrim BSA.
- Open the NIF in NifSkope.
- Go to:
bhkCollisionObject > bhkRigidBody > Havok Col Filter = ANIMASTATIC
And
Havok Col Filter Copy = ANIMASTATIC
And
Motion System = MO_SYS_BOX
Deactivation Type = DEACTIVATOR_NEVER
Solver Deactivation = SOLVER_DEACTIVATION_OFF
Quality Type = MO_QUAL_INVALID
Now insert the NIF into CK as a new mouvable static object. The NIF has now mouvable collision that can be translated and actors can move with the nif.
As long as everything is set up correctly this is all that you need to make a nif move and to be able to move with actors on it.

 

Well i don't know what to think :sad:

I'v done all . . . but nothin... the boat dsn't move

Link to comment
Share on other sites

Try this: Translate the boat only a couple of meters first and not a long distance which would be crossing several cells, move it 2 meters.

If it moves, then the issue is with the distance been translated that exceeds the cells both actor and mesh are in.


Other than this I can't think of something else right now.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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