placeable.2da question
#1
Posté 27 février 2013 - 08:19
In the editor, I could make a placeable and see and select the new model to it and place it in the world fine. The problem is several already placed item types had their assigned model changed. A lot of the rocks were changed to bookcases for example. I could pick each object and change the model back to the proper one okay, but when I tried to change the blueprint, it would keep going back to the wrong model after closing and opening the selection again. I also started getting a lot of access violations errors on nwtoolset.exe as well.
Going back to the 2da and replaceing the new line with a blank line again fixed the problems, but the new item went away of course.
So, what am I doing wrong? Hopefully its something obvious that I'm not aware of.
Thanks for any help
#2
Posté 27 février 2013 - 08:52
Randomdays wrote...
I created a new placeable building and to get it in game I copied an existing line of another building and pasted it on a blank line. I changed 2 entries on the new line to match the new building, the new name in quotes and the name of the mdl file.
In the editor, I could make a placeable and see and select the new model to it and place it in the world fine. The problem is several already placed item types had their assigned model changed. A lot of the rocks were changed to bookcases for example.
So, what am I doing wrong? Hopefully its something obvious that I'm not aware of.
Thanks for any help
That sounds like you inserted a line between two others.
That would change every single placeable after the one you inserted.
You either have to add the new line after the last line of the 2da or replace another 2da line which you don't need or which is a reserved line or padding.
If you insert it between two others all the following lines will have higher numbers. It doesn't matter what the first number of the line says, it is only there to make the file more readable.
If you insert a line between lines 9 and 10, line 10 will actually become line 11.
To fix this you'll have to remove the line you added and either add it after the last line in the 2da or replace one of the lines from 202 to 229 which are lines reserved for user added content. If the CEP or other placeables you use already used up all of those lines you'll have to add your line to the end of the file.
Modifié par Zwerkules, 27 février 2013 - 08:58 .
#3
Posté 27 février 2013 - 09:04
I used an existing line with no data in it, 6001 which said "user" , When I copied the old line from 1623 which was "structure log cabin", I copied everything but the old line number and pasted it to the new line number and changed the 2 data values, so isn't that considered replacing the line?
Sorry if I'm dense, not sure how else you would do it.
Modifié par Randomdays, 27 février 2013 - 09:05 .
#4
Posté 27 février 2013 - 09:21
Randomdays wrote...
I used an existing line with no data in it, 6001 which said "user" , When I copied the old line from 1623 which was "structure log cabin", I copied everything but the old line number and pasted it to the new line number and changed the 2 data values, so isn't that considered replacing the line?
Sorry if I'm dense, not sure how else you would do it.
If the old line 6001 was completely replaced by your copied line you did it right, but then it shouldn't have affected any of the other placeables. What you described sounded as if some of the lines have moved.
This can happen if you insert a new line between two others or if you remove a whole line without replacing it by a new line.
You should check which placeables are affected by the changes you made.
For example the evil throne is on line number 184. If the evil throne is okay, then the error is somewhere after line 184. If the evil throne is replaced by another placeable, the error is somewhere before line 184.
Check if the placeable after the line you copied is still okay. Then check if the placeable after line 6001 is okay.
If your text editor shows on which line your cursor is, try placing it on line 6001. There are three lines at the beginning of the 2da file and the numbering starts with 0 so entry 6001 should be on line 6005. If it isn't, there's something wrong with the lines before 6001. If it is higher than 6005 there's one line too much somewhere, if it is lower, one line is missing.
#5
Posté 27 février 2013 - 09:22
Basically, NWN identifies placeables not by the number that is present on the row that declares them, but by the ACTUAL sequential number of the row.
Let me give you a short example :
placeables.2da
<header> (should never be altered)
0 Armoire
1 Bookshelf
2 Box1
will produce exactly the same result in the toolset/game than :
<header>
10 Armoire
29 Bookshelf
27 Box1
because NWN will always "semantically" read it as the former. If you insert a new row between existing placeables, like this :
<header>
0 Armoire
1 <new custom placeable>
2 Bookshelf
3 Box1
everything past your custom placeable will be shifted in place, which is why you don't recognize your areas anymore, and/or experience crashes.
So what can you do ? Either you find a padding line, to replace it with the definition of your custom placeable, or you add a new line at the very end of your placeables.2da file, so that existing placeables remain untouched (which is still the safest option) :
<header>
0 Armoire
1 Bookshelf
2 Box1
...
<whatever> <new custom placeable>
Modifié par Nissa_Red, 27 février 2013 - 09:28 .
#6
Posté 27 février 2013 - 09:37
So row 6001 is what you need to paste in, go to line 6005 ( 4 more than what it's labeled as ) in the file and paste in your entry on this line.
If you are on line 6005, subtract 4, and the label should say 6001.
( For notepad think the show line number is an option in the menu if it's not there already )
#7
Posté 27 février 2013 - 11:47
TR
#8
Posté 28 février 2013 - 12:21
The reason the model kept reverting back to the wrong one in the blueprint turned out to be that the blueprint was part of the cep haks so it couldn't be changed without making a copy of it.
I'm just using notepad so I don't have the actual line number to look at, but I understand what you're saying that the actual line number is off a few lines from the one you see. I also get get (now) that I could add a line between 10 and 11 and call it anything, like 4000, but it would still just be the new 10. But since I was going to an existing padding line and pasting over everything BUT the number, I don't think that was it.
I'm not sure what the problem was but I was able to fix it. The cep 2da has a lot of what I'm pretty sure are padding lines - lines with nothing but the 4 astericks groups except where the model should be where it says "user", "cep reserved",etc. I was copying the data from the last entry of a line for an item (static column) back to the last space before the line number, keeping only that. I pasted it to the padding line, changed the data for the item name and mdl name I was adding, saved the 2da and got the error. I had done this before with 2da's to add items from other haks by copy/pasting their data and it worked just fine. The new items appeared in the toolset without affecting any of the other items.
No matter what I tried with copy / paste, it wouldn't work. Somehow I must have been inserting a line,extra spaces of something, since as you guys said, everything after the line was changed.Maybe the way Tarot was saying.
I finally got it to work by clicking on the last asterick of each group of 4 on the padding line I was using, backspacing to erase each group and entering the data by typing it in for each column that needed it. The maps look normal and I checked the blueprint on the last used item on the 2da and it was correct.
Thanks again for all the help and interest.
Instead of starting a new thread, I've got a couple of quick questions ;
The meshes I'm working with have alternate sets of textures (IE normal and snow). I assume that I would need to set up two different mdls and there's no way to swap textures out on a single mdl with scripting?
Using a walkthru I set up a dummy object, added the pwk extension to it, gave it the placable proprty and assigned a plane to it to actually set the walkable area. Can you assign more that 1 plane to the dummy to have more control over blocking areas of the mdl?
Last, some of the mdls I'm converting have common, shared textures (IE two bushes using the same leaf texture) . Would there be a problem in game with this - do I need to rename the shared texture to different unique names so that each mesh has its own version of the texture?
Sorry if I seem a bit pesty. Hopefully it will lead to some new content that can add to the game.
#9
Posté 28 février 2013 - 03:47
There is a way to use different textures on one model by using on and off animations. Let's say your model is a house with a red tile roof and you want to replace the roof texture by a texture with a little snow. You can't change the texture itself (unless you use NWNCX or whatever the name of that client extension was) so what you can do isRandomdays wrote...
The meshes I'm working with have alternate sets of textures (IE normal and snow). I assume that I would need to set up two different mdls and there's no way to swap textures out on a single mdl with scripting?
make the roof a separate mesh if it isn't already. Then clone that mesh and apply the snow texture to the cloned mesh and change the alpha to 0.0. Then you'll need animations that change the alpha of the red roof to 0.0 and of the roof with snow to 1.0 and vice versa.
That way the red tile roof disappears when the placeable is turned on and the roof with snow appears and it is the other way round when the placeable is turned off. You'll probably also need a default animation which has the alpha of the red roof set to 1.0 and the other one to 0.0.
That is not neccessary. Many placeables can share the same texture. If you retexture one of them, the others will change, too. If you don't want that to happen, you'll need unique textures for each one.Last, some of the mdls I'm converting have common, shared textures (IE
two bushes using the same leaf texture) . Would there be a problem in
game with this - do I need to rename the shared texture to different
unique names so that each mesh has its own version of the texture?
Modifié par Zwerkules, 28 février 2013 - 03:50 .
#10
Posté 28 février 2013 - 03:54
The meshes I'm working with have alternate sets of textures (IE normal and snow). I assume that I would need to set up two different mdls and there's no way to swap textures out on a single mdl with scripting?
There would be a way, but it's quite sophisticated, and I don't think it's worth the trouble (compared to adding two distinct placeables instead). It could be achieved through the "on" and "off" animations of your placeable.
For academical purposes, you would create your placeable to include the two textured versions at the same time. With the "off" animation, you would show the non-snowy geometry and the snowy geometry would disappear far under ground. Vice-versa with the "on" animation. Unlike doors, PWKs cannot be animated (to my knowledge), so the non-snowy and snowy versions would need to have the same ground geometry of course.
It's far easier, and just as efficient in most situations, to just script this behavior with two distinct placeables.
Using a walkthru I set up a dummy object, added the pwk extension to it, gave it the placable proprty and assigned a plane to it to actually set the walkable area. Can you assign more that 1 plane to the dummy to have more control over blocking areas of the mdl?
Placeables can only have one PWK, and it has to be a flat plane too (again, to my knowledge).
Last, some of the mdls I'm converting have common, shared textures (IE two bushes using the same leaf texture) . Would there be a problem in game with this - do I need to rename the shared texture to different unique names so that each mesh has its own version of the texture?
No, you're actually quite encouraged to reuse the same textures whenever they exist. Unless really justified, it's quite bad practice to rename textures, creating duplicate versions.
Also, please don't forget to set "use" nodes, and (ideally) destroy animations, if your placeables justify it. I had to discard so many nice looking placeables (containers mostly, but also siege weapons and various other furniture) because once set to "useable", they couldn't really be used in game.
Good luck to you.
EDIT : Zwerkules just beat me to it again
Modifié par Nissa_Red, 28 février 2013 - 03:56 .
#11
Posté 28 février 2013 - 08:54
Nissa, not sure about setting up use nodes and destroy animations. Are those set up in gmax or in game? None of the walkthrus I've read over so far has mentioned them. I understand what you're saying about being able to use an object in game or seeing pieces fly off when its destroyed for example. Can you load up n existing mdl that has an animation and "steal" it for yours with a copy/ paste action?
#12
Posté 28 février 2013 - 09:53
If your placeable is a pseudo-tile, like a house, it probably won't matter that much, but it's still so simple to do that I tend to recommend it as standard practice. You never know how builders (or yourself) will use your placeables in the future ^.^
Anyway, to prevent this from happening, the process is fairly straightforward. Create a simple dummy node with NWmax, parent it to the PWK, and suffix it with "_use01" , like this :
node dummy H07_pwk_use01
parent PLC_H07_pwk
endnode
Place and orient it wherever you like the player to stand and face when using your placeable. That's it, you're all done. In theory, there exists a second use node ("_use02"), but I am not sure what it's used for by the engine, sorry. I always finish creating it anyway.
Finally, the best practice to learn I found is to look at how Bioware made their placeables, by exporting a chair or a barrel ("plc_h07") for example (EDIT : You can do that with NWNexplorer by the way). You should be able to copy the emitters and nodes directly over to your placeable model file. This will make it so that your placeable doesn't simply vanish into thin air upon destruction. The process is almost the same if your placeable has any light emitters (flames, candlefires, etc.).
In my opinion, these are but slight alterations to your models, but really help to give your placeables a more "professional/Bioware-like" finishing touch to them.
Modifié par Nissa_Red, 28 février 2013 - 10:07 .
#13
Posté 01 mars 2013 - 12:53
Nissa_Red wrote...
In theory, there exists a second use node ("_use02"), but I am not sure what it's used for by the engine, sorry. I always finish creating it anyway.
Since the use node is the place where the PC/NPC should stand when using the placeable, there is a second use node for placeables that can be used from two sides like benches without a backrest. If you have a bench with a backrest, one use node is enough because the placeable has a front, but if there's no backrest, the PC could aproach the bench from one side or the other when trying to use it.
Maybe a bench is not such a good example because a PC could also sit on it and there's probably only one direction the PC would face when sitting on the bench even if there are two use nodes.
#14
Posté 01 mars 2013 - 02:20
I am glad I finally got to learn what it was good for after all this time. Better late than never as they say, yes ?
#15
Posté 01 mars 2013 - 02:43
Re PWK: this is a non-rendering geometry that *can* do two things.
Where it intersects the tile WOK, it tells the engine "can't walk here". But it also - if tall enough - blocks vision & targeting.
As an example, both the
Another note on 3d PWKs - one that used to get Bannor Bloodfist all hot - is that the WOK is not always a flat plane. What if your placeable center is on a tiny bump, just an inch above the surrounding terrain? That puts your flat plane PWK hovering uselessly in the air (a bug I've just discovered in my Treasure Chests :-/ ) because it doesn't intersect the WOK.
Best practice is to extrude the PWK both above and below the assumed WOK.
As long as I'm mentioning thing I *should* be doing... Make your PWK as blocky as possible! Every corner is a pathfinding decision! Make a column with 4 sides, simple for engine to go around. Make a cool, smooth shape with a zillion sides and watch the NPCs slow to a crawl. OTR made a great video showing this behavior. Normally I try for a 6-sided PWK. And 3-sided shadow casters...
Ok, stopping now. :-/
<...bits he wants to save>
Modifié par Rolo Kipp, 01 mars 2013 - 02:48 .
#16
Posté 01 mars 2013 - 02:49
*hops away before derailing YET another thread*
Modifié par Nissa_Red, 01 mars 2013 - 02:51 .
#17
Posté 01 mars 2013 - 03:37
@Rolo - If you look over some of the comments by Robert Babiak in the Omnibus, especially with the "placeable hole" video I did (from that same thread) in mind, I wouldn't be surprised if one could do a 2D PWK plane as walkmesh, with the appropriate bits set to "obscuring" and have it block line of sight without having to make it 3D. Just a guess though. Babiak, a programmer at Bioware, had a more nuanced view of walkmesh/PWK which I think still holds true. FWIW.
Edit: Video link was funny in the post I linked to, hopefully fixed now.
Modifié par OldTimeRadio, 01 mars 2013 - 03:45 .
#18
Posté 01 mars 2013 - 04:40
I knew about past experiments with "walkable" PWKs, but I've always found better (and safer I wager) alternatives through customizing tiles (or doors) to achieve the same result.
I was convinced that using flat PWKs was the way to go, but I can now see how Bannor correctly points out the "shoot through" issue. I will have to take care of that in the future. Also, since I rarely use placeables on non-even ground, I didn't pay much attention to the "walk through" issue, if placed below z=0.
Two (related) questions though please :
1/ let's say one places a placeable with a WOK at the center of a perfectly flat tile. Would the WOK disappear with the destruction of the placeable ?
2/ what about creating a placeable with a WOK once in game ? Would the WOK appear, dynamically changing the one of the underlying tile ?
In any case, I've learned quite some again, thank you, OTR (and all those who contributed to that thread)..
#19
Posté 01 mars 2013 - 05:21
If you're a modeler and can perform some of these tests yourself, it couldn't hurt to open up an ongoing thread where a number of us can contribute as time permits. Right now I'm wrapped up in skin mesh and PLT's and inventory icons (shudder) and I don't imagine revisiting this anytime soon simply because of the work involved to get back to a good environment for testing. Maybe in such a thread as the one I describe, a test placeable could be created and others could join in the testing to see what the rules governing the effect really are.
#20
Posté 01 mars 2013 - 06:11
Danmar :
Realistically, tiles have wok meshes these can change heights. Placelabes have pwk meshes, these do two things, dictate where the player cannot walk and provide the use nodes to indicate the points that a player should stand in order to 'use' an item. If there are no use nodes properly set up and the pwk file is larger than about 1 meter if the player tries to use the item they'll use the 0,0 coordinate of the object and then just rubber band off it because they can't reach it. So if you're going to make your object useable make sure its small or you put working use nodes in it at the edge of the pwk mesh so that it can be used.
Technically though we've found out that the engine will allow wok mesh data for a pwk file. This is additive only and has so many restrictions that its not usable. The placeable wok HAS to be 1000x1000 units just like a wok file. It HAS to be located at the exact center of the tile. It CAN'T be placed dynamically, only in the toolset. It doesn't allow multiple z heights. It ONLY works additive, i.e. if the pwk wok is higher then the tile wok data is modified to be higher when the 'area wok' data is compiled. So you could say add the ability to have a placeable mound for a tile and the players could walk up it. But you can't dig a hole.
But pretty much the general consensus of everyone is that its easier and a darn site more reliable to just make tiles if you need to change the z height.
I guess this at least answers my question 2/, unfavorably I suppose >.<
The more I think about it, and the more I agree with Bannor that making a WOK (something which is meant to specify where one can walk and where not) out of a PWK (something which is really only meant to specify where one can NOT walk, and to carry "use" nodes and such) is really a "hack".
And sooooorry Randomdays for derailing your thread, I swear I'll stop with that right here and right now.
Modifié par Nissa_Red, 01 mars 2013 - 06:15 .
#21
Posté 01 mars 2013 - 11:06
I don't think I've seen it done and it would probably be a major hit on the engine, but has anybody done trees, flags or grass that sway in the wind? If you turn on/off rain and a rain sound with a script as well as the tress moving to that wind, it would add a lot to realism.
#22
Posté 01 mars 2013 - 11:23
Randomdays wrote...
I don't think I've seen it done and it would probably be a major hit on the engine, but has anybody done trees, flags or grass that sway in the wind? If you turn on/off rain and a rain sound with a script as well as the tress moving to that wind, it would add a lot to realism.
I've made flags and grass and wild flowers using dangly meshes, but I never even tried this with trees because I'm pretty sure this will slow the game down far too much. Lots of transparent meshes for the foliage is already bad enough but the engine can still handle it if there are not too many trees. If that foliage was also dangly mesh, I doubt the engine would be able to handle it.
Take for example the cliffs in the TNO tilesets which have a lot of bushes on them that are dangly mesh. I've heard people say that those make the tilesets too slow for them. A single tree would need as many dangly meshes or more, so two or three of those trees would probably slow down the engine so much that the game would become unplayable.
#23
Posté 02 mars 2013 - 08:14
I added a few vertices to the pwk plane so you can walk inside the fence a bit or near the doors in both, or put a creature inside like in the pics. The barrels and hay are part of the mdl and so are not usable.


Modifié par Randomdays, 02 mars 2013 - 08:26 .





Retour en haut






