Aller au contenu

Photo

Pushable Placeables


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

#1
Sydious

Sydious
  • Members
  • 59 messages
Is it possible to make a pushable placeable? Statue that slides around by being pushed (Dragged)by the pc?

#2
CID-78

CID-78
  • Members
  • 1 124 messages
not like you do in zelda and that kind of adventure games. you can move placeables with scripts. ie create/destroy or give a creature the apperance of a placeable and allow it to move around.

#3
Quillmaster

Quillmaster
  • Members
  • 103 messages
I hadn't thought of the creature option. Currently working on a mirror I want the player to twist, so I set waypoints at the two possible angles, then destroy one mirror while creating the other. Even though they're the same object, I made the two unique so that I can give them different descriptions to describe the changed reflections. It's not ideal as you see one fade out while the other appears, but it does the job, and I think most players would be forgiving considering the limitations of the toolset.

#4
Sydious

Sydious
  • Members
  • 59 messages

CID-78 wrote...

not like you do in zelda and that kind of adventure games. you can move placeables with scripts. ie create/destroy or give a creature the apperance of a placeable and allow it to move around.



Ya creatures should work. Thanks for your input.

#5
Axe_Murderer

Axe_Murderer
  • Members
  • 279 messages

Quillmaster wrote...

I hadn't thought of the creature option. Currently working on a mirror I want the player to twist, so I set waypoints at the two possible angles, then destroy one mirror while creating the other. Even though they're the same object, I made the two unique so that I can give them different descriptions to describe the changed reflections. It's not ideal as you see one fade out while the other appears, but it does the job, and I think most players would be forgiving considering the limitations of the toolset.

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

#6
Xardex

Xardex
  • Members
  • 217 messages
You could consider using a visual effect to conceal the swap. Cheesy, but does the trick.

Modifié par Xardex, 25 juillet 2011 - 09:05 .


#7
_six

_six
  • Members
  • 919 messages
If you don't mind using a bit of custom content, creating several visual effect copies of the placeable with a simple sliding animation could look really cool, and far smoother than changing positions by script. You'd choose which way to move based on the angle between the creaturing using the statue and the statue itself.

See, now I want to try it too, darn it

Modifié par _six, 26 juillet 2011 - 07:34 .


#8
Vipre

Vipre
  • Members
  • 26 messages
How about a placeable that doesn't actually move but has an animation (as in, Activated/Deactivated or Opened/Closed) that makes it appear to move. Is that not doable?

Imagine for example an "invisible" chest on it's side whose "lid" is a bookshelf which when set by click or script to open/activated slides out and away from the wall. No need for fade-in/out or other it just slides. No good?

(Edit: I fear I may have misunderstood the OP, though I'm still curious if this has been thought of or done.)

Modifié par Vipre, 26 juillet 2011 - 07:34 .


#9
_six

_six
  • Members
  • 919 messages
Hm. Having just implemented the basics of statue pushing myself (I did say you'd made me want to try it) by having the statue move one square of a small grid along whichever axis the player pushes it from, I've noticed a few problems.

Firstly, if the placeable blocks movement, then the player will always move to a certain position around it before using (namely, where the use node is in the model). You can get around that either by adding an empty .pwk for the placeable, or by simply placing it 50cm to a metre below ground level, so the placeable's walkmesh gets ignored by the game. Either method should make the player able to push from any direction.

Secondly, the fading animation placeables use when created and destroyed seems to be unstoppable. Which means adding a sliding animation on top might look a little weird. But I haven't taken a shot at implementing that yet.

I did try to post my code, but these forums hate me.

Modifié par _six, 26 juillet 2011 - 07:43 .


#10
Pstemarie

Pstemarie
  • Members
  • 2 745 messages
I'm pretty certain you can place multiple use nodes - I've seen some of the Bioware placeables have as many as six.

#11
_six

_six
  • Members
  • 919 messages
Having had a mess around with the use nodes, it seems no matter how many you add, only two are useable. For some reason the first and last declared in the model are used, and any others ignored. I might be creating some kind of other problem with the pwk, I suppose, but I tried it several times.

Very strange.

My solution was to make a minimal amount of the model block the player and include only one use node in the centre. As it is using from all sides works fine, albeit with the player's leg sticking into the statue a bit.

Modifié par _six, 27 juillet 2011 - 02:56 .


#12
_six

_six
  • Members
  • 919 messages


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

Modifié par _six, 27 juillet 2011 - 03:53 .


#13
Mad.Hatter

Mad.Hatter
  • Members
  • 165 messages
That's really not bad _six.

#14
CID-78

CID-78
  • Members
  • 1 124 messages
do the visual effect just slightly bigger so you don't see the popup of the static statue.

#15
Pstemarie

Pstemarie
  • Members
  • 2 745 messages
Nice work Six

#16
Sydious

Sydious
  • Members
  • 59 messages

_six wrote...



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



Wow. Now how did you do that?

#17
Quillmaster

Quillmaster
  • Members
  • 103 messages

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. :)

#18
virusman

virusman
  • Members
  • 282 messages
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 .


#19
_six

_six
  • Members
  • 919 messages

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 .


#20
virusman

virusman
  • Members
  • 282 messages

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

#21
_six

_six
  • Members
  • 919 messages
Just thinking on the lines of what might be possible in terms of simple animations with placeables.

#22
AzurDraak

AzurDraak
  • Members
  • 48 messages
@ _six

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

#23
Sydious

Sydious
  • Members
  • 59 messages

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


#24
_six

_six
  • Members
  • 919 messages

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 .


#25
Greyfort

Greyfort
  • Members
  • 234 messages
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 .