Hi! I created a stone model of a chair. Added all the necessary effects, dummy objects, and connections to it. Uploaded a file to my hak. I wrote a script that puts the character on a chair. But the problem is that the character still sits facing East! No matter how I turn the chair model in a three-dimensional editor, the game still sets to the East. I compared the objects in the model of my chair and the standard resource that it works with, in this case the couch, all the same, except for the effects and animations, because my chair is made of stone. But even if I just tie my model to the frame of objects from the couch, in the game the character still sits to the East. How do I fix it? Maybe there is a 2da file where you need to register my chair? But I didnβt find such a 2da file. Help!
OnUsed
void main()
{
object oPC = GetLastUsedBy();
object oChair = OBJECT_SELF;
if (GetIsPC(oPC))
{
if (GetIsObjectValid(oChair) && !GetIsObjectValid(GetSittingCreature(oChair)))
{
AssignCommand(oPC, ActionSit(oChair));
}
else if (GetIsObjectValid(GetSittingCreature(oChair)))
{
AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, SpeakString("Π ΠΊΡΠ΄Π° ΡΠ°Π΄ΠΈΡΡΡΠ―? ΠΠ° ΡΡΠΊΠΈ, ΡΡΠΎ Π»ΠΈ?"));
}
}
}
2 Likes
you need a correctly positioned pwk file so the chair user will be properly positioned. let me make up something visual⦠(be back in a bit)
1 Like
The solution is discussed here.
2 Likes
Alright here we goβ¦
Iβm not a scripter so I cant suggest a scripting fix, but here is what worked for me
and since you made a chair. A physical fix might work for you
1 Like
Could you please send here the explanatory text of the image above? My English is poor. I can only write to you using an online translator. Thanks!
I did as you said, sorry, but it doesnβt help. Can you send me an archive with your model of the throne? Is there an incorrect structure or object associations in my file? Thanks!
p.s. Maybe there arenβt enough objects in the scene? Adding dummy βuse01β and binding it to the parent object did nothing.
What are these dummy objects and what are they related to? With a parent object, or a model?
You seem to have the .pwk correct. Did you try your chair in the game? if not, add your new files and try it like you did with the first picture. Post a picture of how it looks in the game so we can see what else we can do.
1 Like
Those cubes came with the base game chair. I simply opened one and replaced the chair object. I think they are for destruction animations and not required for sitting.
edit: Iβll make something more detailed. be back later.
1 Like
Hopefully this helps:
I will also copy the words from the pictures here so you can run it through a translator.
- Export a base game chair (I use NWN Explorer)
-Models from the βModelβ folder
-.PWK from the βModels, Walkmesh, Placeableβ folder
- Open and Hide everything except the original chair object parts. and the Aurora Base
- Rename the chair file
- Import (or create) your chair object. (Example. a Fire Giant head)
- Link the new object (Fire Giant Head) to the same location as the original chair objects
- Resize the new object and align with the original chair seat TOP and FRONT edges (it does not matter how wide or long the object is, the TOP and FRONT must align so it does not cut the sitterβs legs)
- Delete the original chair object parts.
- Export the new model.
-
Normally, You should have 3 files for every object: Model, .PWK, Texture plus an edited placeables.2DA if you dont want to overwrite anything.
-
Add to HAK and check in game.
Without the .PWK, any sitter will face a single direction regardless of position.
With the .PWK, any sitter will face wherever the chair faces. In this case we used the default .PWK from the base chair
To edit the PWK see instructions above
1 Like
OK, Iβm trying to do everything you have written, but:
- the model of the standard chair is not imported by NWmax, here is the error.
OK, I ran the model through CleanModel to get rid of the error. Thatβs what I discovered.
As I understood (as I thought), the key elements for the βsittingβ function is the dummy object βx02_pwk_use01ββ¦ Otherwise, the entire structure of names corresponds to my project. I created exactly the same dummy object for my project, made a link with another dummy AuroraPlaceable [pwk], but an error occurs when exporting, it may affect the final reult. CleanModel does not fix this model due to βa large number of errorsβ. As a result, the model opens in the game, but the character still sits facing East.
I will try to just" stupidly " replace the model of a standard chair with my own, rename the file and upload it to the game, without manipulating other objectsβ¦
There was no NWmax export error, but the result is the sameβ¦ doesnβt work I just donβt know why?
I uploaded all the project files to the rar archive. Please see if I have problems with my 3dMax2010? Or NWmax 0.8. C00β¦ Do I need to use NWmax Plus? What do you use?
I use Gmax so your 3dstudio is better than mine. I use the same NWmax
There was something wrong with your .PWK - I replaced it with mine.
It works now.
Your chair is beautiful.
If you make more chairs just copy and rename my .PWK
I saved it as a separate filename so you can compare.
1 Like
You seem to have done everything correctly
Try to make another chair. If the problem returns it means your .PWK is being altered on export.
To fix, try (Only if the problem returns)
- Adding/Renaming my .PWK to your new chair, AFTER you are satisfied with the shape, so you do not have to open the .PWK file
- or maybe reinstall your NWNmax, Iβm not sure about this though
1 Like
Thanks! Iβll try your version, thank you for helping. I will try to replace my PWK with yours
You can use my chair in your projects, and anyone who wants to, I just donβt have time to upload my modifications to Vault.
Yeeeee! Iβve solved the problem! All the problems were in the name of the wolfmesh model and dummy object. The βuseβ function must have correct, standard names of model objects. The name for the wolfmesh model should be βPLC_X02_wgβ, and the name of the dummy object βX02_pwk_use01β, the name of the parent dummy object for binding should be" PLC_X02_pwk", the other objects in the model can have their own names, see the model hierarchy in the screenshot. Thatβs how it works! The form of the wolfmesh can be any, for the βuseβ function, the main thing is the presence of any wolfmesh and dummy objects with" correct " names.
Thank you to all who responded, thanks to you, I figured out the problem, I think the theme will be useful for beginners!
3 Likes