Author Topic: Moving placeables  (Read 475 times)

Legacy_Nebril2

  • Full Member
  • ***
  • Posts: 104
  • Karma: +0/-0
Moving placeables
« on: December 13, 2014, 06:17:09 am »


               

Hi all!!


 


 


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


 


 


Ty.



               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Moving placeables
« Reply #1 on: December 13, 2014, 07:43:13 am »


               

_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.



               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
Moving placeables
« Reply #2 on: December 13, 2014, 10:32:16 am »


               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.
               
               

               
            

Legacy_Nebril2

  • Full Member
  • ***
  • Posts: 104
  • Karma: +0/-0
Moving placeables
« Reply #3 on: December 13, 2014, 02:58:12 pm »


               

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.



               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Moving placeables
« Reply #4 on: December 13, 2014, 08:32:16 pm »


               

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