Author Topic: Pushable Placeables  (Read 894 times)

Legacy_Sydious

  • Full Member
  • ***
  • Posts: 116
  • Karma: +0/-0
Pushable Placeables
« Reply #15 on: July 27, 2011, 01:22:12 pm »


               

_six wrote...



Darn you, visual effects. Darn you and your glowyness.



Wow. Now how did you do that?
               
               

               
            

Legacy_Quillmaster

  • Full Member
  • ***
  • Posts: 126
  • Karma: +0/-0
Pushable Placeables
« Reply #16 on: July 27, 2011, 04:37:43 pm »


               

Axe_Murderer wrote...
Although you cannot move them, you can rotate them without having to recreate them like that. SetFacing will work.


Haha!  Learn something new every day. '<img'>
               
               

               
            

Legacy_virusman

  • Sr. Member
  • ****
  • Posts: 448
  • Karma: +0/-0
Pushable Placeables
« Reply #17 on: July 28, 2011, 06:28:25 am »


               I just tried doing SetPosition for placeables, and it did work!
With the new NWNX API it's just one line of C++: oObject->SetPosition(vPos, 0);
Placeables don't move smoothly as NPCs, though: in the client it appears if it has disappeared and then appeared in another place.

               
               

               


                     Modifié par virusman, 28 juillet 2011 - 04:16 .
                     
                  


            

Legacy__six

  • Hero Member
  • *****
  • Posts: 1436
  • Karma: +0/-0
Pushable Placeables
« Reply #18 on: July 29, 2011, 10:38:24 am »


               

Sydious wrote...

Wow. Now how did you do that?

Brace yourself ':wizard:'

Firstly, changed the statue model and pwk so you can activate it from all four sides (by putting the Use node in the centre, and making sure the walkmesh is small). Secondly, I took the placeable model, and created four vfx files, one for each direction of it moving.

The script for moving around, well, I tried to post it on the forum, but after getting annoyed at formatting I put a txt file of it here.

To check for the statues being in the right place, I use a pseudo heartbeat fired from a trigger's on enter around the room. It basically uses the same IsInSq function to check if the statues are within one metre of some waypoints I placed. I tried to use GetIsInSubArea with triggers instead, but that apparently only works for creatures (or it didn't work how I used it, anyhow).


virusman wrote...

Placeables don't move smoothly as NPCs, though: in the client it appears if it has disappeared and then appeared in another place.

Out of interest, does that mean you get the fading in/out effect?

Edit: Just noticed the video ':pinched:' I'm curious, is there any way through NWNX to fire a script on every frame render? Not much use for a SP mod, but...

Also, uploaded a video of the 'final' version of the statue sliding I came up with for my mod. Excuse the noodling around, I had set it up to involve weather as well as the statues, and it conveniently started raining while I was on the way to the rain god's altar.

               
               

               


                     Modifié par _six, 29 juillet 2011 - 11:54 .
                     
                  


            

Legacy_virusman

  • Sr. Member
  • ****
  • Posts: 448
  • Karma: +0/-0
Pushable Placeables
« Reply #19 on: July 29, 2011, 02:49:53 pm »


               

_six wrote...
Edit: Just noticed the video ':pinched:' I'm curious, is there any way through NWNX to fire a script on every frame render? Not much use for a SP mod, but...

Frames are rendered on the client, while scripts fire on the server.
I can hook rendering functions in the client, but what for?
               
               

               
            

Legacy__six

  • Hero Member
  • *****
  • Posts: 1436
  • Karma: +0/-0
Pushable Placeables
« Reply #20 on: July 29, 2011, 03:50:36 pm »


               Just thinking on the lines of what might be possible in terms of simple animations with placeables.
               
               

               
            

Legacy_AzurDraak

  • Jr. Member
  • **
  • Posts: 84
  • Karma: +0/-0
Pushable Placeables
« Reply #21 on: July 29, 2011, 04:01:09 pm »


               @ _six

I notice in your video that the statues change orientation during transition. Is it possible to retain facing in the vfx files?
               
               

               
            

Legacy_Sydious

  • Full Member
  • ***
  • Posts: 116
  • Karma: +0/-0
Pushable Placeables
« Reply #22 on: July 29, 2011, 04:53:39 pm »


               

_six wrote...

Sydious wrote...

Wow. Now how did you do that?

Brace yourself ':wizard:'

Firstly, changed the statue model and pwk so you can activate it from all four sides (by putting the Use node in the centre, and making sure the walkmesh is small). Secondly, I took the placeable model, and created four vfx files, one for each direction of it moving.

The script for moving around, well, I tried to post it on the forum, but after getting annoyed at formatting I put a txt file of it here.

To check for the statues being in the right place, I use a pseudo heartbeat fired from a trigger's on enter around the room. It basically uses the same IsInSq function to check if the statues are within one metre of some waypoints I placed. I tried to use GetIsInSubArea with triggers instead, but that apparently only works for creatures (or it didn't work how I used it, anyhow).


virusman wrote...

Placeables don't move smoothly as NPCs, though: in the client it appears if it has disappeared and then appeared in another place.

Out of interest, does that mean you get the fading in/out effect?

Edit: Just noticed the video ':pinched:' I'm curious, is there any way through NWNX to fire a script on every frame render? Not much use for a SP mod, but...

Also, uploaded a video of the 'final' version of the statue sliding I came up with for my mod. Excuse the noodling around, I had set it up to involve weather as well as the statues, and it conveniently started raining while I was on the way to the rain god's altar.



Hehe well I guess this is well out of the scope of my current abilities. Thanks for the info.

(damn learning curve!)
               
               

               


                     Modifié par Sydious, 29 juillet 2011 - 03:53 .
                     
                  


            

Legacy__six

  • Hero Member
  • *****
  • Posts: 1436
  • Karma: +0/-0
Pushable Placeables
« Reply #23 on: July 30, 2011, 03:21:43 am »


               

Sydious wrote...

Hehe well I guess this is well out of the scope of my current abilities. Thanks for the info.

(damn learning curve!)


Heh, you know, if you take out the vfx bits, that script alone should handle most of it for you, for one or multiple moving statues. Just change the tag "TombStat1" to whatever yours are, and put a waypoint in the centre of the area you want to be able to move it around with the tag "StatPuz".
               
               

               


                     Modifié par _six, 30 juillet 2011 - 02:25 .
                     
                  


            

Legacy_Greyfort

  • Sr. Member
  • ****
  • Posts: 442
  • Karma: +0/-0
Pushable Placeables
« Reply #24 on: August 05, 2011, 10:57:39 pm »


               You mentioned altering the placeable and vfx files, are you going to put your hak file with modle and vfx changes and a demo in the nwn vault?

Other wise the script that you gave can be altered to:
When player use placeable the get a conversation to chose direction to push it and then....

Are you even thinking of developing this more?
               
               

               


                     Modifié par Greyfort, 05 août 2011 - 09:58 .