Pushable Placeables
#1
Posté 24 juillet 2011 - 07:30
#2
Posté 24 juillet 2011 - 08:08
#3
Posté 24 juillet 2011 - 10:37
#4
Posté 24 juillet 2011 - 11:13
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
Posté 25 juillet 2011 - 07:55
Although you cannot move them, you can rotate them without having to recreate them like that. SetFacing will work.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.
#6
Posté 25 juillet 2011 - 09:04
Modifié par Xardex, 25 juillet 2011 - 09:05 .
#7
Posté 26 juillet 2011 - 06:36
See, now I want to try it too, darn it
Modifié par _six, 26 juillet 2011 - 07:34 .
#8
Posté 26 juillet 2011 - 07:25
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
Posté 26 juillet 2011 - 07:43
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
Posté 26 juillet 2011 - 07:45
#11
Posté 27 juillet 2011 - 02:53
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
Posté 27 juillet 2011 - 03:53
Darn you, visual effects. Darn you and your glowyness.
Modifié par _six, 27 juillet 2011 - 03:53 .
#13
Posté 27 juillet 2011 - 04:03
#14
Posté 27 juillet 2011 - 07:05
#15
Posté 27 juillet 2011 - 10:43
#16
Posté 27 juillet 2011 - 12:22
_six wrote...
Darn you, visual effects. Darn you and your glowyness.
Wow. Now how did you do that?
#17
Posté 27 juillet 2011 - 03:37
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
Posté 28 juillet 2011 - 05:28
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
Posté 29 juillet 2011 - 09:38
Brace yourselfSydious wrote...
Wow. Now how did you do that?
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).
Out of interest, does that mean you get the fading in/out effect?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.
Edit: Just noticed the video
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
Posté 29 juillet 2011 - 01:49
Frames are rendered on the client, while scripts fire on the server._six wrote...
Edit: Just noticed the videoI'm curious, is there any way through NWNX to fire a script on every frame render? Not much use for a SP mod, but...
I can hook rendering functions in the client, but what for?
#21
Posté 29 juillet 2011 - 02:50
#22
Posté 29 juillet 2011 - 03:01
I notice in your video that the statues change orientation during transition. Is it possible to retain facing in the vfx files?
#23
Posté 29 juillet 2011 - 03:53
_six wrote...
Brace yourselfSydious wrote...
Wow. Now how did you do that?
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).Out of interest, does that mean you get the fading in/out effect?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.
Edit: Just noticed the videoI'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
Posté 30 juillet 2011 - 02:21
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
Posté 05 août 2011 - 09:57
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 .





Retour en haut






