Aller au contenu

Photo

Moving placeables


  • Veuillez vous connecter pour répondre
4 réponses à ce sujet

#1
Nebril2

Nebril2
  • Members
  • 59 messages

Hi all!!

 

 

I want to make a script wich moves a placeable object a little each time used. Is that possible? 

 

 

Ty.



#2
Pstemarie

Pstemarie
  • Members
  • 2 745 messages

_Six did this for the module he was working on once upon a time. Maybe he'd share his code with you - assuming he still has it.



#3
Proleric

Proleric
  • Members
  • 2 360 messages
It's impossible to move a placeable, but you can create the illusion of movement.

Create a new placeable a short distance from the original, then delete the original. Using DelayCommand and ExecuteScript, run the same script on the new placeable after a short delay. Continue until the end position is achieved (you don't want a script to run forever!).

The results are a bit jerky and resource-hungry, but you can fine-tune the distance and timing to make it look better.

The other way to create the illusion of motion, which is really smooth and efficient, is an animation. Oseryn's Sailing Ships is an excellent example; the ship can appear to sail from horizon to horizon if you like, though technically its location never changes. However, making animations requires expertise that few of us have mastered.
  • Pstemarie aime ceci

#4
Nebril2

Nebril2
  • Members
  • 59 messages

Oh thanks, i was trying to do a copyobject of the placeable so its created a short distance forward.... but there i failed.

 

 

Im not sure how to get the new location, using vectors i assume. 

 

GetPosition of the first one, and then copying to a new location using that vectors. But dont know how to change the valors of the vector relatively from the first location.



#5
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

Look at the tread Working with vectors in NWN.    If you still need more help after,  Post back.