Table of Contents
tips
Colors and tinting
Just to Clarify… white is not “white” in the toolset.
Is this by design? I'm trying to make some textures have a snowy appearance, or even make ice with the water… But white in the toolset seems to basically mean “translucent” or in the cases of texture painting 'it actually erases other colours I've painted. What if I want to make snowy areas? Why can I not actually use “white”.
tints
Air Elemental No tint
Water Elemental No tint
Earth Elemental Armor 1 – Body Armor 2 – Vegetation
Fire Elemental No tint
Mindflayer Tints properly
Umberhulk Armor 1- Underbelly and underclaws Skin – Main shell
Badger Armor 1 – Dark fur Skin – Light fur
Bat Skin – entire model
Bird No tint
Boar Armor 1 – Body Armor 2 – Snout Skin – Main body
Bear Skin – Entire body
Deer – Female No tint
Rabbit Armor 1- Light fur Skin – Main body
Rat Skin – Main body
Stag No tint
Weasel Armor 1 – Light fur Skin – Main body
Wolf Armor 1 – Light fur Skin – Main fur
Cat Armor 1 – Main fur Skin – Light fur and highlights
Chicken No tint
Cow No tint
Pig No tint
Dire Badger Armor 1 – Grey highlights Armor 2 – Spikes Skin – Main body
Dire Bear Armor 1 – Highlights Armor 2 – Spikes Skin – Main body
Dire Boar Armor 1 – Highlights Armor 2 – Snout and lips Skin – Main body
Dire Rat
Armor 1 – Highlights Skin – Main color\\
Dire Wolf Armor 1 – Main fur Armor 2 – Spikes Skin – Light fur
Blade Golem Armor 1 – Main color Armor 2 – Secondary color Skin – Highlights
Bone Spider No tint
Iron Golem Armor 1 – Secondary color Armor 2 – Highlights Skin – Upper arms
Black Dragon Armor 2 – Neck frill Skin – Highlights
Red Dragon Armor 1 – Chest plates Facial hair – Face horns Skin – Main color
Dryad Facial hair – Hair leaves Skin – Body
Pixie Armor 1 – Wing veins and pants Armor 2 – Shoes Skin – Body
Fire Giant (cloth, full plate) Eyes – tints beard Skin – Body
Frost Giant (cloth, full plate) Armor 1 – Leather Armor 2 – Metal Skin - Body
Ogre Eyes – tints hair Facial hair – tints earrings Skin – Main skin
Ogre Mage (cloth and leather) Armor 1 – Main armor color Facial hair – head hair highlights Skin – Body color
Troll (cloth, full plate, hide) No tinting except armor
Bugbear Armor 1 – Main cloth Armor 2 – Belt Skin – Body
Gith Female Eyes – Eyes and headband Facial hair – Hair highlights Skin – Body Armor 1 – Straps
Gith Male Armor 1 – Secondary armor color Armor 2 – Primary armor color Eyes – Eyes Skin – Body
Gnoll (cloth, leather, chain shirt, full plate, naked) Armor 1 – Hackles Skin – Main color
Goblin (cloth, leather, chain shirt) Armor 1 – Clothing Armor 2 – Clothing Skin – Main skin color
Kobold (cloth, leather, full plate, naked) Armor 1 – Chest plates Armor 2 – Clothing Eyes – Jowels, neck, and lips (completely different from Preview view!!!) Skin – Skin
Lizardfolk (cloth, leather, full plate) Armor 2 – Armor Facial hair – Head spike Skin – Skin
Orc (cloth, leather, chain shirt, scale mail) Eyes – Eyes and hair Skin – Skin
Celestial Bear Skin – Body color
Celestial Dire Bear Armor 1 – Hair Armor 2 – Spikes Skin – Hair
Celestial Wolf Armor 1 – Light fur Skin – Dark fur
Fiendish Dire Rat Armor 1 – Fur Skin – Fur
Glow Spider Armor 1 – Butt tip and leg tips Armor 2 – Abdomen Skin – Thorax and legs
Phase Spider No tint
Winter Wolf Armor 1 – Light fur Skin – Dark fur
Gargoyle Armor 2 – Highlights Skin – Main color
Bladeling (cloth – naked, full plate) Armor 1 – Highlights and piping Armor 2 – Spikes and armor Eyes – Ponytail holder Facial hair – Ponytail Skin – Main skin color
Balor Armor 1 – Loincloth Facial hair – Horns Skin – Body and wing color
Hezrou Armor 1 – Shoulder piece Armor 2 – Arm Skin – Back and arm vein
Succubus Armor 1 – Clothing Eyes – Hair and eyes Facial hair – Lips and eye shadow Skin – Skin
Erinyes Armor 1 – Clothing Armor 2 – Feathers Facial hair – Hair Skin – Body
Horned Devil Armor 1 – Belly scales Armor 2 – Wings Eyes – Neck and chin Skin – Body
Imp Armor 1 – Clothing Skin – Body and wings
Pit Fiend Armor 1 – Highlights Eyes – Facial color (light area in face) Facial hair – Fangs Skin – Body
Hell hound Skin – Body
Shadow Mastiff No tint
Sylph No tint
Cargo Ship Armor 2 – Hull stripes Skin – Hull stripes
Werewolf Armor 1 – Light fur Eyes – Light fur on face Skin – Body color
Black Bear (shape shift) Skin – Main color
Siege Tower No tint
Elite Vampire (female vampire model) Armor 1 – Clothing Armor 2 – Piping Skin – Body
Ghast Armor 1 – Loincloth Skin – Body
Ghoul Armor 1 – Pants Skin – Body
Lich Armor 1 – Highlights Armor 2 – Bracers Eyes – Helmet (Crown) Skin – Body
Mummy Armor 1 – Body wrapping Armor 2 – Skin visible through body wrapping Eyes – Head wrapping Facial Hair – Skin visible through head wrapping Skin – Lips
Skeleton (cloth, chain shirt, half plate) Skin – Body
Vampire Male Armor 1 – Leather Armor 2 – Cloth and piping Skin – Body
Wraith Armor 1 – Highlights and lower body Skin – Main body
Zombie (cloth, leather, chain shirt, scale mail, full plate) Armor 1 – loincloth and neckband Skin – Body
Bombardier Beetle Armor 1 – Thorax sides Armor 2 – Abdomen highlights Skin – Thorax top plate
Fire Beetle Armor 1 – Lowlights Armor 2 – Thorax upper plates and head plates Skin – Shell highlights
Stag Beetle Armor 1 – Thorax top plate Skin – Main color
Sword Spider Armor 1 – Body lowlights Skin – Main color
Giant Spider No tint
My Little Parrot Buddy
I decided to tinker about with custom content a bit this afternoon. We have a bird in the toolset, but no parrot, which everyone needs for a good pirate adventure. I opened the nwn2_Models.zip file and pulled out the bird model, and opened the nwn2_Materials.zip file and pulled out the matching DDS textures. Then I changed the name of C_Bird_CL_Body01 to C_Parr_CL_Body01 for all the files.
Next was opening up C_Parr_CL_Body01.MDB in a hex editor and also changing the references. Finally, I added a new reference for a C_Parr_CL_Body01_T file, matching what I saw in other MDB files, and added a tint file reference. The tint file was simply another DDS reference with red, green, and blue parts highlighted for the different parts I wanted to tint. Finally, I added a new line to appearances.2da for my new bird, keeping the same TLK reference.
I loaded up the toolset and there was my parrot, ready to tint. I threw in some nice garish colors and it was good to go. Sadly it didn't appear in the game itself, which I think we knew at this point. I probably could have overridden the existing bird if I needed to.
As a plus, this points to the ability to make things you currently cannot tint into a model you can tint. It's a bit of work, but not too technically difficult. Just thought I'd share.
Water
Water question
How do the multiple layers of water work? If possible, can we get an example of how to make a really deep-looking lake?
Any other water examples (making it frozen, fun tips) would be great.
Is it possible to make a waterfall? There's some water plane placeables you could stick under the surface of the water. That might give the illusion of depth (since you won't be able to see the bottom). I'm working on an ocean and the best results seemed to make the color a darker blue and slide the smoothness down a bit. Being able to globally change the water in an area would be nice. I also have problems getting the eyedropper working right (it doesn't seem to pick up the height), though perhaps I'm missing something. In terms of waterfalls, I think the best approach is a couple animated waterfall placeables. You'd have a flat plane that uses the UV scroll property so that it seems like water is falling. I'd probably use a couple layers, along with some “splash” style effects at the top and bottom.
waterfall
Originally Posted by Leanthar
Sunjammer, how did you do the waterfall? I know the splash at the end but the waterfall itself, what did you use? Quote: Originally Posted by Acrodania Nice! Could you give DETAILED instructions since I was unable to get suitable results from your suggestions in the previous thread? It took a lot of trial and error but it is essentially the same technique I mentioned before.
For this scene I wanted a hill-type-thing with a path winding up the side and a simply waterfall-type-thing. I still plan to do the 4-tier-cascade but I really want some sexy particle effects and some friendlier props before attempting that.
Note: for anyone unfamiliar with the water placement rules it's important to know that you can only have one water level in each 2×2 MegaTile so any waterfall has to be placed along the boundary of two such MegaTiles, i.e. along one of the black grid lines.
1. Landscape
I flattened an area to 15m running north (I think) from a MegaTile's edge. I made a wee pool on top it by flattening to 13m and a wee pool down below by flattening to –2m. I then raised the very edge of the top pool back up to ~15m to contain my water. The water was added at 14m and –1m respectively.
I then roughly textured it because there's only so much green one man can take (unless of course that man is Lord Percy Percy).
2. Waterfall
Having already done some experimenting, I picked up my trusty Ice placeable (02 - MANMADEPROPS) and painted it roughly where I wanted it. I then engaged in a long battle with the toolset involving lots of trial and error and tweaking.
I started with my initial values Scale (0.2,0.2,1), Orientation (0.5, 0, 0, -5) and UV Scroll ([True][0,-2]). However I ended up changing Scale (0.8, 0.2, 1) and Orientation (-0.25, 0, 0, 7.4) because a) stretching the texture makes it look more like water and b) I need it to tilt back slightly to so it filled the small gap between my two planes of water.
Using the cursor keys and Page Up/Page Down keys I positioned it exactly so as to minimise the gap between the top and the top water plane and avoid any terrain poking through. Some delicate terrain sculpting was also involved at this point.
Note: ultimately I found best to have the leading edge of the pool (where the waterfall will be) a few cm back from the MegaTile's edge. Painting water can be a bit of a of a pain when you need to be accurate. Too much water and the plane will poke through the waterfall, too little and you have a visible gap.
3. Props
Even after all my tweaking I was left with a noticeable gap at the top and an overlap at the bottom. I realised I could spend the rest of my life trying to fix that and still not be happy so I cheated and simply masked all four edges with a liberal sprinkling of appropriate props. Throw in a nice effect and sound for good measure and the jobs done.
4. Conclusion
I think the outlook for waterfalls is pretty good. My waterfall was based on a suggestion by Capt'n Adam (PIPBoy3000 to you lot) and was made with whatever happened to be lying around in the placeables palette. I wouldn't be surprised if OE have some more elegant solutions in the stuff we didn't get to play with. If not it won't belong until someone produces a hole range of waterfall related props.
Note: there is one fly in ointment which may or may not effect everyone. I can't currently view my waterfall ingame because the waterfall's Orientation resets. — Okay here is a cheap and cheerful attempt at the back drop for a waterfall:
1. Paint an Ice placeable (02 - MANMADEPROPS) 2. Scale 0.2,0.2,1 3. Orientation 0.5, 0, 0, -5 4. UV Scroll = [True][0,-2]
Top and tail with water and the odd particle effect. – Cal? Here is your suggestion using the “icycles” as the base…. Not perfect but works well. Sorry for the quality, I get less than 10 fps in game and have to wait for the new card….. My attempt to jump on the waterfall bandwagon
Because ice/water placeables don't render correctly in-game after their orientation has been changed, I wanted to try to do this without using them. It's still a bit rough around the edges (I just spotted a couple floating rocks and odd water-endings), and selective camera angles make it appear a bit better than it is.
It basically consists of water at the top and bottom; boulders to mask the cutoff, and splash, fog, and fountain effects on the way down. You can't really see it here, but the lower pool has a faster rate of flow.
On a related note, I was looking at the “fx_lion_vomit” files, and those may be a good base for a much better effect. I'll play with them some over the weekend.
Textures and surfaces
Max # of textures per Area?
Aparently theres a cap (like 7 or 8 textures within an area), I was playing with the texture tool, paiting different textures in same spot, and there was no undo option… so just painted the original grass texture to start over…. after a few times of trying different texture, I noticed I couldn't put anymore down… anyone encounter this, or found a work around? Its fustrating since now I can not change the textures of the area I was playing with.
I think doing a fill in the area fixes the problem, but thats not good if you already have textures in the area that you dont want to change. ___ Yes, there is a max of 6.
If you take a look at the list of textures then scroll down you will see another 6 slots. The painted textures appear in those 6. However, the list and the list of 6 is buggy as they tend to be blank or disappear or do not draw properly on the terrain sometimes. And yes, being able to swap out a texture for another one and filling ONLY that texture (instead of the whole area) would be quite awesome.
if you wish to completely wipe an area of a texture, set the pressure to 100% of the desired base texture and “wipe” over what you want to erase. Thats what I have used if I made a mistake.
if you wish to completely wipe an area of a texture, set the pressure to 100% of the desired base texture and “wipe” over what you want to erase. Thats what I have used if I made a mistake.
That will not work once you have too many textures in place. If you try to go over 6, it just will not paint anymore on that section of the map. I ran into this and the only way to fix it is to “swap” out unused/lesser used textures. Quote:
Yes, there is a max of 6.
If you take a look at the list of textures then scroll down you will see another 6 slots. The painted textures appear in those 6. However, the list and the list of 6 is buggy as they tend to be blank or disappear or do not draw properly on the terrain sometimes. And yes, being able to swap out a texture for another one and filling ONLY that texture (instead of the whole area) would be quite awesome.
I noticed the blank spots in this texture list at the bottom (the six slots) too. I don't think the blanks are a bug, nor is the fact that you can not paint anymore after you use too many textures on a given tile. If you get 6, it is over for that tile. If you have less than six on a given tile, you have blank slots for adding more textures. From my testing, this works on a tile by tile basis, so you can have up to six textures for any given square.
After playing with this a while I also found that you can indeed swap out a texture for another by filling ONLY that texture and not the entire area. You need to pull up the “swap” menu and select the texture you want to get rid of, then select the one you want to trade for and tell it okay. This will fully remove any given texture you do not want anymore, thereby freeing up a slot for another texture
I fixed the problem I posted the screenshots for by using this trick . . . hope that helps the rest of you
Alpha Channel -- VFX and Terrain Color
Has anyone found a way to use white in either a custom visual effect (particle) or colored terrain? Can you share info on how, if so? White is the default color - those operations are multiplicative not additive.
Terrain Texture * Terrain Color = Final Color. Hence if you multiply by white you will get the Terrain Texture unmodified.
edges
Area edges...
Ive noticed that with this new ability to play and such, the area edges of each area will be much harder to DUPLICATE for the next area that connects to it… how do they expect us to match our zones so that they dont look one way in one and another in another….. perhaps there should be a function that would allow us to copy the edge of another area, or if any of you have played with the TQ editor you will see that each area is shown, allowing you to edit every single area in the module…. something they might want to think about. *shrugs* If you Duplicate an Area, then resize it, you might get the results you need.
e.g. I have a stream going off the northern edge of one area. I copy the area, then resize it by a few tiles, adding to the north and subtracting from the south. The unwalkable edge from the first area is now in the walkable zone for the second area. Encounters and triggers: How do you create a new spawn point off of an encounter? Make sure the encounter instance is selected, then use the “paint spawn point” button on the bottom-most top toolbar. Make sure that the encounter is marked active
Are your default encounters not firing? Read this.
After a bit of brain numbing research, I've finally managed to figure out why I had been unable to get encounters to fire off. Before I get to that, I'd like to recap for everyone the necessary procedure to place an encounter.
First, the encounter needs to be selected from the blueprints menu.
When painting the encounter trigger, be sure to paint an object with at least three sides. E.g. try to create a triangle or square by clicking around and area to encircle the space that you would like to have the trigger activate. Keep in mind, that when creating an encounter trigger it is possible to create a trigger that is just a line. This occurs when painting the trigger and only 2 points are created. While the trigger will paint, if the trigger area has only two points (e.g. a line) then it will not fire off.
After painting the trigger, be sure that the encounter is set to active/true in the properties window. It is the first option in the list.
The last step is to select or highlight the encounter or trigger point and paint spawn point.
So to recap, encounters can be done in a three step process. Select the encounter and paint the trigger area, ensuring to not just paint a line but to paint a region like a square or a triangle. With the encounter still selected paint the spawn point. And finally set the encounter to active.
What had happened to me originally was that I had painted many encounters by only creating a trigger line instead of a region. Well, its the little things that get you
2das
2DAs - what goes where?
I spent some time this morning fiddling with 2DA files. It seems like you can put them in several places: In a hak pack, using the old NWN hak pack tool. In the My Documents override folder. In the game's override folder. In the 2DA.zip file. Finally, there's also a 2DA editor in the module itself, though I'm unclear what that does. Which should we be using? I'm also fuzzy on how the Appearance property is linked to the 2DAs. Is the name that shows up coming from the TLK file? Can you put in a name plus for the StrRef and have it show up? The reason I'm asking is that I think I found a way to retexture placeable models. While the files are binary, the model and texture names are in plain text, making them easy to change. I've played with the 2da's some. So far if you edit the 2da's in the module, and save it, aparently changes work in the game, not sure if the changes are being thrown into a seperate override folder, or the module itself. I've tried manually changing the dialog.tlk file and adding a stringref…renamed the TLK file and threw it in override folder, and made sure module was using the modified TLK file, but no dice. If anyone figures out how the mod is pulling the TLK file information, it would be nice to know Basically, if you are hosting a server, you want the 2da's in a hak. Placing them in a hak means they only take effect when you are working with a server with those haks.
If you place them in your override folder, it is my understanding that the 2da file will be in effect all the time. So, if you normally play on server A and you need a file named A.2da to play on that server, if you have that 2da and play on server B, you will have a lot of the stuff from A.2da overriding your game on server B.
Clear as mud, eh?
Selecting and moving things
Bounding Box on Trees
The huge bounding box on trees (particularly those with any kind of canopy) makes it near impossible to select anything nearby. I can be at a perspective where I don't even see the tree itself, yet the bounding box for it is in my way, preventing me from selecting anything that sits under or near it. I try, and select the tree. In order to do any kind of placeable decoration around trees, I constantly have to toggle the trees on and off.
Is it possible to have smaller bounding boxes for the trees? Like maybe the circumference of the base of the tree trunk, rather than the circumference of the canopy?
It's not a bug, but it sure is a PitA. You can also turn the selection of trees on/off so that you can still see them, just not select them. Same with just about everything else too.
Very, very useful feature.
Tilted placeables?
Seems that I can tilt placeables in the toolset, and they appear correctly tiled there. But when looking at the same thing in the game client, they are all upright.
Anyone else see this thing?
Ui
For simple text you should be able to use the DisplayInputBox function although I don't know if it will effect the conversation (and I can't test that right now).
There is an example in the scripting documentation (but it isn't very good) and the Input Box itself is missing some textures. Also try as I might I couldn't pick up the response string which, I believe, is passed in as a parameter to main in the gui_* script.
One thing that isn't made clear in the documentation is that there is no GetLastGuiClicker function (or the equivalent). However it appears that the GUI user (i.e. the PC) executes the gui_* script and so can be accessed using OBJECT_SELF
The captured text is sent via a passed parameter. OBJECT_SELF is the inputer.
So:
void main(string sText)
{
sText = The text you typed.
oPC = OBJECT_SELF; {the typer of the text - NOT PASSED like sText}
}
scripting
GetCreatureWingType() not in .. hmm.. never used myself but… I am sure usefull at some point SetCreatureWingType() not in .. hmm.. never used myself but… I am sure usefull at some point GetCreatureTailType() not in .. hmm.. never used myself but… I am sure usefull at some point SetCreatureTailType() not in .. hmm.. never used myself but… I am sure usefull at some point GetCreatureBodyPart() not in .. hmm quite annoying that this is missing.. Thus will again need to have Zillion creatures in the palette or have all creatures look the same.. SetCreatureBodyPart() not in.. hmm quite annoying that this is missing… Thus will again need to have Zillion creatures in the palette or have all creatures look the same..
GetHardness() not in… hmm quite annoying that this is missing SetHardness() not in… hmm quite annoying that this is missing SetLockKeyRequired() not in.. very sad that this is not in.. Making manipulating locks in response to actions hard SetLockKeyTag() not in.. very sad that this is not in.. Making manipulating locks in response to actions hard SetLockLockable() not in.. very sad that this is not in.. Making manipulating locks in response to actions hard SetLockLockDC() not in.. very sad that this is not in.. Making manipulating locks in response to actions hard SetLockUnlockDC() not in.. very sad that this is not in.. Making manipulating locks in response to actions hard SetTrapDisarmable() not in.. very sad that this is not in… I want my trap setting and manipulation in script! Danced of joy when these came for nwn1.. now very sad SetTrapDetectable() not in.. very sad that this is not in… I want my trap setting and manipulation in script! Danced of joy when these came for nwn1.. now very sad SetTrapOneShot() not in.. very sad that this is not in… I want my trap setting and manipulation in script! Danced of joy when these came for nwn1.. now very sad SetTrapKeyTag() not in.. very sad that this is not in… I want my trap setting and manipulation in script! Danced of joy when these came for nwn1.. now very sad SetTrapDisarmDC() not in.. very sad that this is not in… I want my trap setting and manipulation in script! Danced of joy when these came for nwn1.. now very sad SetTrapDetectDC() not in.. very sad that this is not in… I want my trap setting and manipulation in script! Danced of joy when these came for nwn1.. now very sad CreateTrapAtLocation() not in.. weeping that this is not in… I want my trap setting and manipulation in script! Danced of joy when these came for nwn1.. now very sad CreateTrapOnObject() not in.. weeping that this is not in… I want my trap setting and manipulation in script! Danced of joy when these came for nwn1.. now very sad SetWillSavingThrow() not in .. hmm.. never used myself but… I am sure usefull at some point SetReflexSavingThrow() not in.. hmm.. never used myself but… I am sure usefull at some point SetFortitudeSavingThrow() not in.. hmm.. never used myself but… I am sure usefull at some point GetTilesetResRef() not in and does not make sense I guess GetTrapRecoverable() not in. very sad that this is not in… I want my trap setting and manipulation in script! Danced of joy when these came for nwn1.. now very sad SetTrapRecoverable() not in. very sad that this is not in… I want my trap setting and manipulation in script! Danced of joy when these came for nwn1.. now very sad GetModuleXPScale() not in. hmm.. never used myself but… I am sure usefull at some point SetModuleXPScale() not in. hmm.. never used myself but… I am sure usefull at some point GetKeyRequiredFeedback() not in. hmm.. never used myself but… I am sure usefull at some point SetKeyRequiredFeedback() not in. hmm.. never used myself but… I am sure usefull at some point GetTrapActive() not in.. weeping that this is not in… I want my trap setting and manipulation in script! Danced of joy when these came for nwn1.. now very sad SetTrapActive() not in.. weeping that this is not in… I want my trap setting and manipulation in script! Danced of joy when these came for nwn1.. now very sad GetInfiniteFlag() not in.. very sad that this is not in… I want my trap setting and manipulation in script! Danced of joy when these came for nwn1.. now very sad SetInfiniteFlag() not in.. very sad that this is not in… I want my trap setting and manipulation in script! Danced of joy when these came for nwn1.. now very sad LockCameraPitch() not in.. wonder how the cutscenes in general go..can we still do the non dialog types.. LockCameraDistance() not in.. wonder how the cutscenes in general go..can we still do the non dialog types.. LockCameraDirection() not in.. wonder how the cutscenes in general go..can we still do the non dialog types.. GetPlaceableLastClickedBy() not in and the event not in! Really really sad that we cannot detect clicks anymore! GetAreaSize() not in and cannot seem to fake it either! unlike nwn1. Thus REALLY annoying. SetName() different names (better in nwn2) GetPortraitId() not in and would not make sense either I guess SetPortraitId() not in and would not make sense either I guess GetPortraitResRef() not in and would not make sense either I guess SetPortraitResRef() not in and would not make sense either I guess
GetAbilityScoreGetAbilityScore(object oCreature, int nAbilityType, int nBaseAbilityScore=FALSE) the getting of base ability score not in, makes checking for hacked characters in online games harder and other uses GetSkillRank(int nSkill, object oTarget=OBJECT_SELF, int nBaseSkillRank=FALSE) getting the base skillrank not in , makes checking for hacked characters in online games harder and other uses SetTrapDetectedBy(object oTrap, object oDetector, int bDetected=TRUE) the removal of detection not in. I liked this ability. ExploreAreaForPlayer(object oArea, object oPlayer, int bExplored=TRUE) removal of exploration not in.. uuh.. not good at all SetCutsceneMode(object oCreature, int nInCutscene=TRUE, int nLeftClickingEnabled=FALSE) The leftclick parameter is not recognised (but have not tested the cutscene functions in general) GetPCPublicCDKey(object oPlayer, int nSinglePlayerCDKey=FALSE) The singleplayerCDkey is not in, never used.. but I suppose could be usefull for some CreateItemOnObject(string sItemTemplate, object oTarget=OBJECT_SELF, int nStackSize=1, string sNewTag=“”) The sNewTag is not in! this is really not good. And not even Copyitem has the new tag Funtionality! This is very limiting. Only the CopyObject has the new tag setting funtionality. Making thus the process again a Create,Copy for a LOT of things we do.. adding another thing to go wrong and such. GetName(object oObject, int bOriginalName=FALSE) the otginal name parameter is not in. Nor is it in in the GetFirstName and GetLastName functions, so seems there is no way to get the orginal name. ActionRest(int bCreatureToEnemyLineOfSightCheck=FALSE) Has a new flag bIgnoreNoRestFlag allowing us to ignore area rest limits, but the flag to ignore enemies is missing. This can be “intresting” a we have integer parameters that have different meanings. Also being able to ignore enemies or not would be very usefull for restsystems. RandomName(int nNameType=NAME_FIRST_GENERIC_MALE) the ability to set what type of name to generate is missing. Thus all names generated by it will again be “wrong”. With the ability to set first and last names this would really be needed.
SetUseableFlag() not in.. a nice function allowing better immersion with less work.
GetSkyBox() Not in.. and not make much sense I guess GetFogColor() Not in.. GetFogAmount() Not in.. SetFogAmount() not in, instead NWN2 has its own command and a resetfog command.
Well, I tracked down my script bug and reported it. It seems that the following code fails: Code: AssignCommand(oPC, JumpToObject(oWP)); AssignCommand(oPC, ActionStartConversation(oAlvar, “dw1_alvar_1”));
But this code works. Code: AssignCommand(oPC, JumpToObject(oWP)); AssignCommand(oPC, DelayCommand(4.0, ActionStartConversation(oAlvar, “dw1_alvar_1”)));
It worked in NWN, but fails here. oWP is a waypoint in a different area. Essentially you get a “the person is not close enough” and the jump never happens. If it's delayed (more than a second or so), the conversation seems to kick in normally.
While there seems to be a workaround, it points to changes in the action queue and other core functions, making me a little nervous.
Walkmeshes: Walkmesh Trouble in Game?
If you are running around in your beautiful modules causing nothing but chaos.. then all of a sudden the ground seems to cause chaos back at you…
If you can't walk somewhere you think you should be able to…
If you sink into the ground for no apparent reason…
Open the console window by hitting your ~ key, then type “surfaces” and hit enter. This should display your walkmesh and may help you figure out the trouble.
We may ask you to give us a screenshot of this when you report a problem.
Day night and weather Day/Night Settings, and a way to toast your mod, extra crispy.
Been playing around with some of the setting for day/night arrays. Having a problem trying to keep an interior area to just a specific time (nighttime setting), It seems indoor areas keep defaulting to, either defualt, or daytime, or something, not sure. Anyone know offhand? I've tried to force the interior area as night only (and turned off day/night cycle array), but still no go. Anyone experimented with the settings yet for day/night cycles?
Also, found a nice way to corrupt a module, don't delete any of the day/night cycle arrays (even though there is an option to remove), as soon as you try and save the module, you get an array out of bounds error during the save, and it toasts the module, can't open it in-game anymore (thank god for auto saving). Basically, here is what I have done. For one of my areas i started to customize every aspect of the day night cycle. At first glance I noticed moonset and moonrise are backwards, I could be wrong on this but it doesnt seem logical the way they have it now. Since the moonset colors match the colors of the sunset and the moonrise colors match the color of the night cycle…. anyway I noticed that if you set an area to NOT use the cycle it will use the DEFAULT cycle. I attempted to remove the other cycles but when saving I was given an error (this is the bug I think) So… i played with it a bit more and found each area is required to have at least 7 cycles. When you turn off the area to cycle through the daytime cycle it will default to slot 7, no matter what it is…
So to fix this I put the customized daytime in slot7 of the daytime cycle and made sure the cycle option was turned to false and walla!!
I know thats a horrible explanation but im at work and dont have alot of time, hope that helps if not post some questions and when i get home ill be sure to help out to the best that I can. – I found that setting night to true and directional light to false and then editing the nighttime colors to pure black does the trick. Default didnt seem to work as if you have it set to be night only then it puts it at night.
I finally just set all colors to black and turned off directional light and everything else and it was pitch black. Then I added my torches and what not and it looks great.
Just seems like alot ot do to get an area black. They need a singe turn the dam lights off in this area checkbox
Sky and Fog
Lol sorry but i still dont know how to change the color of the sky / add fog to an area.
I searched complete properties and changed the light colors (day/night/sunrise/sundown) but only the clouds had different color.
Please help me Under the menu for the area's properties, choose the expander button for 'Appearance' –> 'Day/Night Cycle Stages', and then the time of day you wish to affect.
Under that time of day (eg, “Sunrise, Sunset, Daytime”, etc) you will find what you are looking for. Of particular interest to you should be the 'Fog' expander button; under it you can change how far from the player the fog starts, where it 'ends', where the far clip/draw distance is, and color of the fog. You can change the color of the sky in one of the the options, appropriately labelled 'SkyLight' Dialogs: NWN1 Style Dialogue?
It is my understanding that we can present dialogue similar to the method used in NWN1; i.e. a Box format with the dialogue inside. I cannot seem to figure out how to change to that format. The Cinematic format is fine for cut-scenes but it is a bit much for some things.
Anyone have any ideas? Once the dialog is open, go to the properties window and set “Neverwinter Nights 1-style Dialogue” to True.
World map Try this, not sure if it'll work in the beta build
Go to the campaign editor (name your campaign if you wish), and hit the Set Module to Use Selected Campaign (with your module open)
Now make sure the tga image for the world map is in the base folder of that new campaign directory (it should match whatever name you gave it). I think the dimensions are 647×647 pixels? Alright, here's what I've got so far. 1. Open your module. 2. Open the world map editor; click File → New to create a new map. 3. Go to windows explorer and copy all of your TGA files (minimum needed is the background) to the clipboard with Ctrl+C 4. * Click “File | Save As” in the map editor. Change to “My DOcuments\Neverwinter Nights 2\modules\current-module-temp-directory”. If this is a new module, it will have the module's name. If it's not a new module it will have a randomly-generated name w/ module name appended to the end. For example: temp_gTVfDnWMKkSAEssWVF0vIQ==_custom 5. Name and save the map. 6. In the map properties, click the WorldMapImage property “…” button to display the file chooser. 7. When prompted with the file chooser, make sure to change the file type selector to *.tga, then press Ctrl+V to paste your TGA files into this directory. Do not change whatever the default location is, do not change it or the image won't display. (bugged) 8. Choose your background image from among the files you pasted. It should now display correctly.
I'm holding off on the remaining steps (setting up map points, in-game modifications) until I have a working, displayable map… creating this and gettting it to retain the background image is far as I've gotten so far.
* This was changed from my original instruction – previously, I said do NOT put it in any module-specific location. This was incorrect – the map does not show unless you save the .wmp file into the module folder.
Caveat: THe resources (wmp file, tga files) are rolled into your module save folder. This means that after you close the module, it will look like all your hard work is gone – your files will be nowhere to be found. When you next go to open the world map, enter the temporary directory created for the module; you'll find it there along with all of your tga resources (Bug entered for lack of clarity.)
When opening from this location, I did find that the full map and image(s) were present and viewable in the map editor. In earlier testing it had not been, when I saved it manually to a different location. Cutscenes Anyone experimented in trying to do cutscenes?
I'm starting to look in that direction and wondering what kind of system the OC uses. You can see a template script - right click - add from template - to get to an OnClient Enter Cutscene template but alas, I can't open the include file so it doesn't make much sense.
I have begun to mess around a bit with the camera options in the conversations but I don't see how to do pans or movement of the camera - at least it doesn't seem to work if I just click pan.
So, anyone had any luck. Static camera shots seem straightforward from conversation editor but is that what they use for all cutscenes?
I ported the cutscene library which I wrote for Daggerford, but quickly discovered that NWN2's SetCameraFacing() doesn't work (at least for me). I did see some new script functions like AssignCutsceneActionToObject(), but was a little nervous about its header comments. I looked at the code in ginc_cutscene, but it's really basic stuff.
My cutscenes run perfectly except that 1) SetCameraFacing() always causes a STACK OVERFLOW error and 2) SetCutsceneMode() never removes the UI elements from the screen. I bugged 1) but not 2) since I'm not sure what the NWN2 behaviour should be. Does everyone else have the same issue with SetCutsceneMode()?
Plugins: Plugin documentation and sample plugins w/script support
Since we should be keeping all NWN2 info on this board I'm posting this sample plugin and documentation here. Anyone that wants to contribute to the docs or sample plugin feel free. I know it's very early but if you have any suggestions for plugins chime in here.
Keep in mind that the attached plugin is more for demonstration purposes and not for actual use. If anyone here is a C# programmer and wants to go over the code I can post that as well.
This plugin currently populates an area with random trees (only works on flat ground currently), randomizes the seeds for all trees in an area, randomizes the size and tint for any creatures selected in an area, and displays statistics about the module.
The documentaion describes how to install the plugin and (when finished) will show how to write a plugin and go over the code in the demo plugin.
Update: I've added a new plugin LUAPlugin that will run LUA scripts with support for accessing .NET and the NWN2 toolset classes. I need to write an installer or instructions for setting up LUA on a system. If you are already using LUA you can download this plugin and have some fun!
Update: Started adding information to docs about the NWN2Toolset classes. Hello all,
mcmillanjj and i were woking togeather to figure out the initial stuff. He pasted my toolbar code into his doc without telling you what a TooBarDef was
mcmillanjj - we should pick some areas of the library and write some intro stuff for the doc. Such as the ResourceManager, NWN2GameModule, etc.
Anywho, I wanted to dump some actual code for the c# guys out there.
What this test plugin does is randomize the terrain (very primitive).
You must first create a new area. Then lauch the plugin from the plugins dropdown menu. Then click the toolbar button. It take about 15-25 seconds to complete on my machine.
As i dig more and more into the libraries i can see some really great possibilites for generating terrain, forests, lakes, etc.
Anyway, its quarter to 4 in the morning here, so i apologize if my code isn't documented well enough or very neatly organizaed PluginLib.cs using System; using System.Collections.Generic; using System.Text; using NWN2Toolset.Plugins; using TD.SandBar;
namespace TerrainPlugin {
/* * To create a plugin, you'll need to create a class that inherits from INWN2Plugin. * * 4 Functions must be defined: * public void Load(INWN2PluginHost cHost * public void Shutdown(INWN2PluginHost cHost) * public void Startup(INWN2PluginHost cHost) * public void Unload(INWN2PluginHost cHost) */ public class TestPlugin : INWN2Plugin { /* * Our plugins test class which defines what our plugin actually does. It also * contains the definition of the toolbar we'll add to the toolkit. */ private PluginTests myTests;
/* * Sandbar MenuButtonItem * * This object will be instantiated */ private MenuButtonItem m_cMenuItem;
/* * Constructor */ public TestPlugin() {
}
/* * HandlePluginLaunch * * This function is called when our plugin is clicked from the Plugins dropdown menu inside the toolkit. * * It pulls the toolbar information from the PluginsTest object. */ private void HandlePluginLaunch(object sender, EventArgs e) {
/*Add the toolbars*/ List<PluginTests.ToolBarDef> toolBars = myTests.GetAllToolBars(); for (int j = 0; j < toolBars.Count; ++j) { for (int i = 0; i < NWN2Toolset.NWN2ToolsetMainForm.App.Controls.Count; ++i) { if (NWN2Toolset.NWN2ToolsetMainForm.App.Controls[i].GetType() == typeof(ToolBarContainer)) { ToolBarContainer tbc = (ToolBarContainer)NWN2Toolset.NWN2ToolsetMainForm.App.Controls[i]; if (tbc.Name == toolBars[j].NWNToolsetDockName) { tbc.Controls.Add(toolBars[j].toolBar); break; } } } } }
/* * Load * * Nothing is done in this example. */ public void Load(INWN2PluginHost cHost) {
}
/* * Shotdown * * Nothing is done in this example. */ public void Shutdown(INWN2PluginHost cHost) { }
/* Startup * * This function is called by the toolkit when its first launched. In order for the user * to interact with our plugin, we create our sanbar menuitembutton and assign our handler * function to it. * The PluginTests object is also created. */ public void Startup(INWN2PluginHost cHost) { m_cMenuItem = cHost.GetMenuForPlugin(this); m_cMenuItem.Activate += new EventHandler(this.HandlePluginLaunch); myTests = new PluginTests(); }
public void Unload(INWN2PluginHost cHost) { }
/* * Properties * * Below are properties used by the toolkit to gather information about the * plugin. These properties should always be created, the toolkit will call them. * */
public string DisplayName { get { return "NWN2 Plugin"; } } public string MenuName { get { return "Terrain Modifier"; } }
public string Name { get { return "Terrain Modifier"; } }
/* * The toolkit will ask for this object and add it to the plugins dropdown. Make sure * this object is initialized in the constructor or startup function. */ public MenuButtonItem PluginMenuItem { get { return m_cMenuItem; } }
/* * I havn't worked with proferances yet, but each plugin gets an entry in the * toolkit pref's. It looks like you can put all your configuration stuff there. */ public object Preferences { get { return null; } set { } } }
}
PluginTests.cs using System; using System.Collections.Generic; using System.Text; /* * The NWN2Toolset.dll exposes all the functions we need to manupulate the toolkit. */ using NWN2Toolset.Plugins; using NWN2Toolset.NWN2.Data;
/* * Sandbar is the library thats used for the toolbar. * * Windows also has a Toolbar object in System.Windows.Forms so make sure * you create the correct object when adding a toolbar to the toolkit. */ using TD.SandBar;
namespace TerrainPlugin {
class PluginTests { /* * This is probably overkill for this example but this dictionary will hold * our toolbars. My goal was to create a simple way of adding multiple toolbars. */ private Dictionary<string,ToolBarDef> AllToolbars;
/* * This object will hold the 2D bounds of our world. */ struct WorldAreaLimits { public Microsoft.DirectX.Vector2 BottomLeft; public Microsoft.DirectX.Vector2 TopRight; }
/* * The toolkit has 4 sandbar docks at the Top, Bottom, Right, and Left. * This enum will be used to determine where the toolbar is initially docked. */ private enum ToolBarInitialPos { Top, Bottom, Left, Right };
/* * A simple object that holds a sandbar toolbar and where it will be initially docked. */ public struct ToolBarDef { public ToolBar toolBar; public string NWNToolsetDockName; };
/* * Class constructor * * Initialize class variables and create the plugin toolbar. */ public PluginTests() { AllToolbars = new Dictionary<string, ToolBarDef>(); CreateToolBar("Test Toolbar", ToolBarInitialPos.Top);
ButtonItem TestButt = new ButtonItem(); TestButt.ToolTipText = "This is a Test!"; TestButt.Text = "Modify Terrain"; TestButt.Activate += new EventHandler(TestButtClicked);
AddButtonToToolbar("Test Toolbar", TestButt); }
/* * This function will be called when the toolbar button is clicked. */ public void TestButtClicked(object senter, EventArgs e) { /* * Do nothing if theres no area loaded. */ if (NWN2Toolset.NWN2ToolsetMainForm.App.AreaContents.Area == null) { System.Windows.Forms.MessageBox.Show("You must create an empty area first!"); return; }
int areaHeight = NWN2Toolset.NWN2ToolsetMainForm.App.AreaContents.Area.Size.Height/2; int areaWidth = NWN2Toolset.NWN2ToolsetMainForm.App.AreaContents.Area.Size.Width/2; System.Windows.Forms.MessageBox.Show("Width Height" + areaWidth.ToString() + " " + areaHeight.ToString()); WorldAreaLimits EntireArea = new WorldAreaLimits(); WorldAreaLimits PlayableArea = new WorldAreaLimits();
EntireArea.BottomLeft = new Microsoft.DirectX.Vector2(0, 0); EntireArea.TopRight = new Microsoft.DirectX.Vector2(Convert.ToSingle(areaWidth * 20 + 160), Convert.ToSingle(areaHeight * 20 + 160));
PlayableArea.BottomLeft = new Microsoft.DirectX.Vector2(80, 80); PlayableArea.TopRight = new Microsoft.DirectX.Vector2(Convert.ToSingle(80 + areaWidth * 20), Convert.ToSingle(80 + areaHeight * 20));
Random rand = new Random(); NWN2Toolset.NWN2.Views.NWN2AreaViewer viewer1 = (NWN2Toolset.NWN2.Views.NWN2AreaViewer)NWN2Toolset.NWN2ToolsetMainForm.App.GetActiveViewer(); for (int i = 80; i < PlayableArea.TopRight.X; i+=5) { for (int j = 80; j < PlayableArea.TopRight.Y; j+=5) { NWN2Toolset.NWN2.NetDisplay.NWN2NetDisplayManager.Instance.BeginSynchronizedOperation(); NWN2Toolset.NWN2.NetDisplay.NWN2NetDisplayManager.Instance.TerrainBrush(viewer1.AreaNetDisplayWindow.Scene, 1, 1, new Microsoft.DirectX.Vector3(i, j, 0), NWN2Toolset.NWN2ToolsetMainForm.App.TerrainEditor.InnerRadius, NWN2Toolset.NWN2ToolsetMainForm.App.TerrainEditor.OuterRadius, NWN2Toolset.NWN2ToolsetMainForm.App.TerrainEditor.TerrainValue, NWN2Toolset.NWN2ToolsetMainForm.App.TerrainEditor.TerrainBrushColor, NWN2Toolset.NWN2ToolsetMainForm.App.TerrainEditor.CursorColor, NWN2Toolset.NWN2ToolsetMainForm.App.TerrainEditor.TerrainBrushTexture, OEIShared.NetDisplay.TerrainModificationType.Noise);
int numMods = rand.Next(0, 10); int upOrDown = rand.Next(0, 2); for (int k = 0; k < numMods; ++k) { if (upOrDown == 0) { NWN2Toolset.NWN2.NetDisplay.NWN2NetDisplayManager.Instance.TerrainModify(viewer1.AreaNetDisplayWindow.Scene, OEIShared.NetDisplay.TerrainModificationType.Raise, 0); } else { NWN2Toolset.NWN2.NetDisplay.NWN2NetDisplayManager.Instance.TerrainModify(viewer1.AreaNetDisplayWindow.Scene, OEIShared.NetDisplay.TerrainModificationType.Lower, 0); } } NWN2Toolset.NWN2.NetDisplay.NWN2NetDisplayManager.Instance.EndSynchronizedOperation(); //if (upOrDown == 1 && numMods > 0) // NWN2Toolset.NWN2.NetDisplay.NWN2NetDisplayManager.Instance.TerrainModify(viewer1.AreaNetDisplayWindow.Scene, OEIShared.NetDisplay.TerrainModificationType.Water, 0);
} } NWN2Toolset.NWN2ToolsetMainForm.App.Refresh(); }
/* * CreateToolBar * * Creates a basic sandbar toolbar with some default settings. The name of the toolbar is used internally * to access the ToolBarDef objects in the dictionary. */ private void CreateToolBar(string name, ToolBarInitialPos initialPos) { ToolBar temp = new ToolBar(); temp.Name = name; temp.Overflow = ToolBarOverflow.Hide; temp.AllowHorizontalDock = true; temp.AllowRightToLeft = true; temp.AllowVerticalDock = true; temp.Closable = false; temp.Movable = true; temp.Tearable = true; temp.DockLine = 2;
ToolBarDef tbd = new ToolBarDef(); tbd.NWNToolsetDockName = GetDockNameFromPosEnum(initialPos); tbd.toolBar = temp;
AllToolbars.Add(name, tbd); }
/* * There was an enum created above to represent the toolbar docking locations. * This function will convert those enums to the actual name of the dock inside * the toolkit. Using this name we can search through the toolkit controls and * locate the docks. */ private string GetDockNameFromPosEnum(ToolBarInitialPos pos) { switch (pos) { case ToolBarInitialPos.Top: default: return "topSandBarDock"; case ToolBarInitialPos.Bottom: return "bottomSandBarDock"; case ToolBarInitialPos.Left: return "leftSandBarDock"; case ToolBarInitialPos.Right: return "rightSandBarDock"; } }
/* * AddButtonToToolbar * * Adds a button to an already created toolbar. */ private bool AddButtonToToolbar(string toolbarName, ButtonItem buttonToAdd) { if (AllToolbars.ContainsKey(toolbarName)) { AllToolbars[toolbarName].toolBar.Items.Add(buttonToAdd);
return true; }
return false; }
/* * Returns the toolbars we created. */ public List<ToolBarDef> GetAllToolBars() { Dictionary<string, ToolBarDef>.Enumerator en = AllToolbars.GetEnumerator(); List<ToolBarDef> toolBars = new List<ToolBarDef>(); while (en.MoveNext()) { toolBars.Add(en.Current.Value); }
return toolBars; }
}
} The fun continues!
Ok, so i promised the context menu stuff tonight but i got sidetracked. I wanted to gain full control over the camera in the area window. So i created this little plugin.
USAGE:
Add the plugin to your toolkit as described in mcmillanjj's document.
Once you've got your area displayed on the screen, press the 'q' key to activate the new camera controls.
The new controls follow the “flying through space” design.
The keys behave as follows:
W - Moves the camera forward in the direction its facing (not true north, but straight into where your looking) S - Moves the camera backwords, away from where your facing. A - Moves the camera left D - Moves the camera right.
Wheel Mouse - Wheel up moves the camera “up” (Camera +Z with respect to orientation) and wheel down moves the camera “down”.
CTRL-MOUSE-1 and CTRL-SHIFT-MOUSE-1 are the same.
A new movement has been added using CTRL-RIGHT-MOUSE that will allow the player to adjust the camera's pitch and yaw.
Please test it out. I don't promise it will work 100% but its in decent shape. I'm going to comment the code tomorrow and submit it so others have an introduction to controlling the camera in the area editor.
I've added the code for the plugin for those interested.
VB Sample Project
The following sample project shows how to implement a plugin using Visual Basic .NET. This is just a straight conversion of the barebones C# sample. Some people find VB easier to program in than C#.
Class1.vb: Imports System Imports System.Windows.Forms Imports NWN2Toolset Imports NWN2Toolset.Plugins Imports TD.SandBar
Public Class Class1
Implements INWN2Plugin
Dim m_cMenuItem As MenuButtonItem
Public ReadOnly Property PluginMenuItem() As MenuButtonItem Implements INWN2Plugin.PluginMenuItem Get Return m_cMenuItem End Get End Property
Public Sub Load(ByVal cHost As INWN2PluginHost) Implements INWN2Plugin.Load m_cMenuItem = cHost.GetMenuForPlugin(Me) AddHandler m_cMenuItem.Activate, AddressOf Me.HandlePluginMenu End Sub
Public Sub Shutdown(ByVal cHost As INWN2PluginHost) Implements INWN2Plugin.Shutdown End Sub
Public Sub Startup(ByVal cHost As INWN2PluginHost) Implements INWN2Plugin.Startup End Sub
Public Sub Unload(ByVal cHost As INWN2PluginHost) Implements INWN2Plugin.Unload End Sub
Public ReadOnly Property DisplayName() As String Implements INWN2Plugin.DisplayName Get Return "VB Plugin" End Get End Property
Public ReadOnly Property MenuName() As String Implements INWN2Plugin.MenuName Get Return "VB Sample Plugin" End Get End Property
Public ReadOnly Property Name() As String Implements INWN2Plugin.Name Get Return "VBPlugin" End Get End Property
Public Property Preferences() As Object Implements INWN2Plugin.Preferences Get Return Nothing End Get Set(ByVal value As Object) End Set End Property
Private Sub HandlePluginMenu(ByVal sender As Object, ByVal e As EventArgs) MessageBox.Show("Hello World!") End Sub
End Class A couple of comments and tips: 1.This is exactly what I was hoping would happen when I implemented the plugin system. Very cool. 2.You can indeed program in any .NET language, although I haven't written anything other than C# plugins. 3.You can use Reflector on the plugins that ship with the toolset to see some additional example code. (NWN2Toolset.dll and OEIShared.dll are obfuscated, though. 4.If your plugin exposes an object via its Preferences property, that will be XML serialized/unserialized by the toolset automatically. In addition, those preferences will show up in the Options dialog under the Plugins list entry. 5.Check out the INWN2VerifyPlugin and INWN2ProcessorPlugin interfaces for additional fun things you can do. Verify plugins will run as part of the Verify Module process. Processor plugins are accessible through the Plugins→Process menu item, and are a good way of allowing a user to select different game entities to modify via a plugin. 6.It's a good idea to build your plugin with a strong name. It's not required, but a good thing to do as an anti-tampering measure. Oh, I almost forgot…INWN2VersionControlPlugin.
I figure since documentation is so limited, as we find things out it may be helpful to post them so others can see. Below is a function that will add a new area to the current module. /*
- Function: CreateNewArea
- Description:
- This function will create a new Area in the active module. You can setup the area with any properties
- you need. Below are just a few examples. Once created the area will be set as the displayed area.
- Be aware that the Size property is either bugged or inaccurate. A size of 4,4 is actually a playable
- area of 2,2. So whatever size you want, make sure you double up the numbers. Meaning if you want
- an 8,8 playable area, than use 16,16 for the size.
- Toolkit Version: 1.0.739.0
- /
private void CreateNewArea(System.Drawing.Size mapSize)
{ string tempName = NWN2Toolset.NWN2ToolsetMainForm.App.Module.GetTemporaryName(NWN2Toolset.Data.ModuleResourceType.Area);
NWN2GameArea newArea = new NWN2GameArea(); newArea.Size = mapSize; newArea.HasTerrain = true; newArea.Name = tempName; newArea.TerrainFlags = AreaTerrainTypes.Natural; NWN2GameArea addedArea = (NWN2GameArea)NWN2Toolset.NWN2ToolsetMainForm.App.Module.AddResource(newArea); if (addedArea == newArea) { newArea.InitializeArea(tempName, NWN2Toolset.NWN2ToolsetMainForm.App.Module.TempDirectory, NWN2Toolset.NWN2ToolsetMainForm.App.Module.Repository); } NWN2Toolset.NWN2ToolsetMainForm.App.ShowResource(addedArea); }
Heightmap plugin questions
Hi all,
I've been writing a heightmap plugin for a few days and so far everything is fine, except for a few questions
1.) When modifying the terrain with brushes it is really really slow. If I load a 50 x 50 heightmap picture into my plugin, the area should use that heightmap (it currently stretches the heightmap to fit the area). Analysing the heightmap is not a problem, I can loop through the image within 1~2 seconds. When I start using the terrain tools within my plugin it takes about 2~3 minutes to generate the terrain. In my opinion this can't be right. I suspect there is a better way to generate terrain?
2.) The brushes are circular. This means that if I draw a rectangle or a square in my heightmap, it'll have rounded edges. Is there a way to set the heightmap of the area at certain positions, instead of using the brushes? This is kind of related to the first question.
I've added a few pictures so you can see how it currently looks like. There's still lots to be done. I need to smooth the whole area (just using the flatten tool right now). I also need to center the heightmap in the area (it's not really centered yet), etc.
I hope someone can help me further along Quote: Originally Posted by Norfirin When modifying the terrain with brushes it is really really slow. If I load a 50 x 50 heightmap picture into my plugin, the area should use that heightmap (it currently stretches the heightmap to fit the area). Analysing the heightmap is not a problem, I can loop through the image within 1~2 seconds. When I start using the terrain tools within my plugin it takes about 2~3 minutes to generate the terrain. In my opinion this can't be right. I suspect there is a better way to generate terrain?
You should look for circular areas of the same height in the heightmap and then create one large brush (by setting the inner and outer brush radius) to change the height once. This will speed things up but you will still have the problem of trying to line up square pixel information to a round brush. The larger brush will make this problem worse. We all hope a square brush is added at some point. Unfortunately, my understanding is that the renderer that implements TerrainModify is written in C++ and communicates with the toolset via messages. This process introduces overhead. Quote: Originally Posted by Norfirin The brushes are circular. This means that if I draw a rectangle or a square in my heightmap, it'll have rounded edges. Is there a way to set the heightmap of the area at certain positions, instead of using the brushes? This is kind of related to the first question.
I hope I'm wroing but I've talked to Steve from OE and the round brushes seem to be it. The other possiblity is determining the file format and changing the terrain information there.
BTW, if you want to read the height information from the terrain you need to use the Pick or PickRay methods. The problem seems to be that these methods use the camera to determine where to pull the height information from. Moving the camera just to read height info seems slow. You need to call the functions like:
BeginSynchronizedOperation() Pick(with the current electronpanel.window, ScreenX, ScreenY, true) or PickRay(panel,ray origin, raydirection) WaitForMessageSynchronous(NetDisplayMessageType.PickResults,out byte[], messageID) create a new NDPickResultsMessage with the byte[] EndSynchronizedOperation()
I hope that this helps.
We have been using the methods:
NWN2Toolset.NWN2.NetDisplay.NWN2NetDisplayManager.Instance.BeginSynchronizedOperation(); NWN2Toolset.NWN2.NetDisplay.NWN2NetDisplayManager.Instance.TerrainBrush(); NWN2Toolset.NWN2.NetDisplay.NWN2NetDisplayManager.Instance.TerrainModify(); NWN2Toolset.NWN2.NetDisplay.NWN2NetDisplayManager.Instance.EndSynchronizedOperation();
In addition we've been trying to use Pick and PickRay to read the height information. We have run into quite a few problems with these methods. The round brush of TerrainModify for example and Pick/PickRay depending on the camera position and screen coordinates. Instead of using these methods to make the terrain changes is it possible to access the terrain height and texture information directly? Interiors I generally work on interiors with one hand on the mouse, other on the arrow keys.
First, plan out the floorplan of the area you wish to build. A sketch works wonders on ease of building.
Second, create the area. Go through the area and place all the tiles using the arrow-mouse combination. Remember, up-down for variants, left-right for turning.
I generally hit the <esc> key after placing each tile, and keep the camera zoomed way out so that I can see the overall floorplan. Just recreate your sketch, and then tweak stuff from there (you can select whole groups of tiles quickly and set their tints after making the general layout).
The, start with placeables. For each new area, I generally create the top five groups of placeables. Slap them down, (Like “DungeonTreasure001”) and then ungroup them to tweak positioning. As needed, mess with the individual tints afterward.
I then set up the doors or area transitions. I usually right-click and open a new property window for each set of “linked” doors, one at a time. This then allows me to cut and paste tags directly across to both. Remeber to set the Linked To field for each door/trigger.
That's a start for you. I'll post more as I get more familiar with all the different interior tiles
I also find that laying tiles with one hand on the mouse and the other on ther arrow keys helps speed things up tremendously. However, I do run across a lot of problems with corners on tiles since there are certain types (stairs in the Shadow Fortress tileset, for example) that do not come in varieties with corners, meaning that they don't connect with other tiles without leaving ugly gaps. Furthermore, with respect to the Shadow Fortress set, there is no Open Floor tile without corners.
Actually darkness in Interiors works perfectly, we were able to figure it out earlier.
Basically in area properties:
1. Day/Night Cycle FALSE Directional Light FALSE Is Always Night FALSE (do not set to true)
2. On top toolbar go to Day/Night, and set your area to be previewed at Default.
3. Get a good camera angle on the area.
4. Under Day/Night Cycle Array, go to Default, and adjust settings. The biggest setting that has a huge impact on lighting is “Diffuse Color”.
The settings you'll need to modify:
Ground Light - This effects the actual light that the ground projects back to the player. It basically changes color of the bump map on the walls and floor slightly.
Sky Light - This is basically how you tint the entire area whatever color. The only option worth anything here is Diffuse Color.
SunMoon - Effects the brightness of the area (only about 50% of it), only thing here worth messing with is again Diffuse Color.
Best settings for really dark: Use SkyLight-Diffuse Color + SunMoon-Diffuse Color, and make both of them a dark color. Use both to adjust the brightness correctly.
Save mod, and have fun
message controls:
I tried using the constants in NWN2 to make text coloured using sendmessagetopc but it just spits it out as numbers (I converted the constant to a string). How am I suppose to colour text in NWN2?
Nope. You can also use <b> and </b> for Bold and <i> and </i> for italics. Also, the color tag should accept a hex value in addition to one of several defined colors. Try putting the following tags in the text: <color=red> Text you want here</color>