Jump to content

The Black Scourge of Candle Cove -- Tchos' development diary


Tchos

Recommended Posts

I've been playing more Fanglewood. I find it inspiring, and it reminds me why I love this game and this toolset so much. With all its flaws, NWN2 is the best party-based RPG out there. If not for the toolset, I would probably give that accolade to Baldur's Gate 2 for its smooth movement, combat system, and freedom, or to the Temple of Elemental Evil for its turn-based structure and the sheer number of D&D moves they managed to make available (trip, 5-ft step, grapple, full attack, etc.), but nothing beats NWN2's customisability and extensibility, while retaining the full party control of its predecessors.

 

Note that, for this to be fully true, the modules must include the Storm of Zehir party chat to enable you to choose the speaker character, so that the main character doesn't always need to be the one with the social skills, lest the party be socially crippled as if they didn't have one, even if they do. But since any player can just open up a module in the toolset and click the "party chat" box for the dialogues, this is easily accomplished.

 

Now, as for my own module, I spent the whole time poring through AI scripts in the OC and MotB, as well as several modules, to try to better understand how to handle my boss AI. I saw that several used modified versions of the troll damage script, since it has some special conditions to deal with for its regeneration and special vulnerabilities. The Batha fight in the OC was a good read. It uses a user defined event script, which is a category that I still don't entirely understand, but I'm learning a lot about it now.

 

Then I found some global AI scripts that seem to do what I want, but they have the code in the spawn script of all places! I guess it must signal it to check it and change the conditions somehow. It doesn't use a user-defined event script like the Batha one does.

 

I tried it out, and it works, but I have no idea why it works. I thought the spawn script was only run once, and I can't imagine how it could adapt to the condition statements in the spawn script if it's not running more than once. But for now, I suppose I don't need to fully understand it, as long as it's working, and creates an intelligent boss battle with multiple phases.

 

I also finally found information on a bit of code I had seen references to in the default script sets, which I couldn't figure out how to activate -- where you can cause a creature to bark something when it perceives the player. Useful in cases where you want a friendly NPC to say something like, "Come look at my wares!" or an enemy to say something like, "How did you get in here? Now you die!" without having to touch the On Perception script. For the latter, either put SetSpawnInCondition(NW_FLAG_SPECIAL_COMBAT_CONVERSATION); into the spawn script, or just add the integer 262144 to the NW_GENERIC_MASTER local bitwise variable on the creature, which does the same thing. And then of course you'll need a conversation attached to the creature with the line you want it to bark, which you can optionally put the condition nw_d2_gen_combat on, to prevent it from showing otherwise.

 

I'm not sure which is more convenient: using the NW_GENERIC_MASTER for everything it can handle, from AI behaviour to activating user-defined event flags, or if I should use custom spawn scripts. The latter is much easier to read and understand which flags I've set just by looking, while if I use the master and don't document which flags I'm using, then I'd have to subtract out the bits to see. But if I use the master, then I can just save it as a saved variable with a name describing what it does, and load it on any creature as needed.

Link to comment
Share on other sites

  • Replies 254
  • Created
  • Last Reply

Top Posters In This Topic

I created a fairly traditional boss battle of four distinct stages, with several alerts and adds, and a surprise at the end. I just hope it's not too chaotic, because it still seems to move pretty quickly, and with everything going on you might miss the shouted strings, and maybe even the alert text.

 

As mentioned yesterday, all of the scripting for the fight is in the spawn script, bizarrely enough. But it works. Just don't ask me why.

 

The only thing that's a bit flaky is the transition from idle heartbeat to combat. I have him doing an action and speaking some barks before the fighting begins, and I have a condition in the heartbeat to check GetIsInCombat(), and to stop the actions and barks if he is. But he starts running around as soon as he perceives the player, and continues performing the idle actions and barks until someone actually hits him. So I guess I need to use the perception event instead of the combat check for that.

 

Also, the notice text fires from the boss' script, but it seems to fail to display sometimes because (I assume) the currently controlled player isn't necessarily the one that hit him last, nor is it the nearest PC. So I'm not sure how to get the currently controlled PC so that I can display the notice text. I'm thinking I'll have to use a loop and display it to every PC in the party in sequence.

 

Aside from that, I'm pleased at how it came out, and I consider it good progress. This will serve as a template for the other boss fights with different mechanics, as well, so it won't take so long for the others.

Link to comment
Share on other sites

I started today by adding one of the systems I've put off until now, which is the resting system at the inn. In town, you can only rest at the inn, though everywhere else you're free to rest, with the risk of wandering monsters. I've set up the inn resting system to work as it does in Baldur's Gate, complete with showing the room you're resting in, and time passing.

 

As a basis, I used the resting conversation system from Leira's Trick in SoZ, but adding and subtracting some things, as well as inserting the aforementioned image, and adding the time passing, since it didn't include that for some reason. The SoZ tavern rests were lacking in some respects, especially in the Sword Coast taverns, where you pay the innkeeper and the screen just fades to black and back again and he says "Hope you had a good rest", but the idea and the framework are solid. I think people will like what I've done with it.

 

Next, I finally modified the necessary scripts for the Thrice-Stupid Elf curse, and applied them to the proper location. This took a few tries. I was basing it on a set of three scripts from the OC, which apply spell failure in Duskwood, and those were an on enter (to apply the curse), on exit (to remove it), and heartbeat (to put it back on if it's removed). Well, reducing ability scores is an additive action, not a constant thing like spell failure, so I saw my characters lose stats on every heartbeat, down to zero. I also forgot to apply the racial check on one of the two scripts, so it happened to everyone.

 

The heartbeat was listed as necessary because if a character dies, they lose the curse, and it's supposed to be constant in this area. Eventually I determined that the on enter script wasn't necessary at all, since the heartbeat puts it on instantly anyway. Also, it was a bit inefficiently programmed, because it was set to check every creature in the area (and there are dozens in this area), when it only needed to apply to the PC party. So I rescripted it to check each party member for a variable that indicated the curse was already active, and if so, to exit. Works perfectly now. I just wish I could edit the "Cursed" indicator by the character portraits to include more information in the tooltip.

 

Also made some more tweaks to the boss encounter in the lighthouse. I think it's basically fixed now.

Link to comment
Share on other sites

I started by doing the lighting for the lighthouse loft, and also some set dressing. I think it still needs some things like a little bit of furniture with maintenance tools and such, but I'll handle that in my final polishing pass.

 

Next I did a little something else from my polish list, which I just wanted to get off the list, which was to expand the list of drinks that the waitresses of the taverns offer, using Seryn's Drinks of the Forgotten Realms for flavour, replacing the nonspecific drinks like "black beer" and "fruit wine" from UncleFB's scripts.

 

Next, I applied the necessary scripts and conversation to the first of the recruitable companions. I was surprised it was just a matter of loading the companion saved script set to the NPC, and adding a conversation to handle the joining and dismissal. I used Kaldor Silverwand's companion setup as a basis, but I need to write the companion's backstory, and also set a joining condition to check the current number of members in the party combined with the player-created party members, in the same way SoZ does it. Kaldor's conversation doesn't have any restriction on how many members can be in the party.

 

The way SoZ does it is that if you want to edit the player-created roster, you have to dismiss your recruitable companions first, and then add them back in after you modify your player-created roster. I'm sure it could be done without that dismissal first, but I expect it makes it less prone to error this way.

 

I'm not sure if it was this way in the original game, but when I played Baldur's Gate in the BG2 engine via BG tutu, I was able to dismiss companions, and tell them to wait for me right where they were, rather than them going to wait at a specific location like an inn. For the sake of simplicity, I'll do these companions the same way. No designated hangout for them to go to when they're not in the party, just waiting where you leave them. I don't think that'll be a problem, since in most cases you should always be able to go back to where you would have left one, and there's no point where you're forcibly taken anywhere outside of your own control. Especially since you don't have to talk to them directly to have them join or leave the party once they're on the roster. The inn guest registries as well as the player menu roster can handle them fine. But you'd miss out on some dialogue if you do it that way.

Link to comment
Share on other sites

Today I added some DM text to the loft entry event, to introduce the first of the bosses. This is the sort of thing that in cinematic modules would be handled by a cutscene, but which I am handling with text. The text box pops up, and the game auto-pauses to give you enough time to assess the situation, and let it sink in what's going on, and who this is. In a text box, I can paint a much more descriptive and informative image of the situation than a camera angle and a few lines of conversation could, anyway.

 

This method also eliminates a problem that I encounter in cutscenes, in that I never know when they're going to end, or whether they'll have a final "end dialogue" option or simply drop me into combat without warning. I also never know how long each line of text is going to display in a cutscene, and typically have to click through to the next line after waiting for a while for it to advance after I've finished reading it. Sometimes that results in me clicking at the same moment it finally gets around to advancing, causing me to miss a line.

 

Here, all the text is presented at once, for you to read at your own pace. When you're finished and ready to fight, you close the text box and unpause the game.

 

http://1.bp.blogspot.com/-lWVQ2SG-rB0/UE_fN2j0BiI/AAAAAAAADuY/QYdWvHxlbYA/s320/bcocc%2Blighthouse%2Bloft%2Bdm%2Btext.jpg

 

I've never played any of the Spiderweb Software games, but I took a look at a

, and I was surprised to see that it includes very much the same thing! At least in the intro cave, each new development spawned some text to establish what was going on. I like that.
Link to comment
Share on other sites

Trying a different brand of brewed coffee today, and a different blend. Pleasant aroma, but the flavour's not as intense. I think I'll need to make it stronger than the other brand.

 

It turns out I wasn't as finished as I thought I was with the AI for the boss. The fight was fine, but his introductory actions weren't working. Also, his initial challenge shout was showing up before I had even entered the game! (I can see this in the readout on Skywing's Client Extension.)

 

I tracked the shout down to a problem with the way I had programmed the spawning script. Basically, if it existed at full health, it would shout immediately, and this once again speaks to my very recent understanding that the game loads and executes the scripts in every single area in the module before you even go to those areas. So I modified the script to work around that.

 

The other problem was (is?) that I could either get him to do his introductory actions constantly or not at all. I moved those actions into a case switch heartbeat system of the same sort that I eventually settled on for the other scenes.

 

The good thing is that his combat script works just fine, in all of its stages...except that sometimes a sound doesn't play. Not sure why.

 

I also rewrote some of the text in the previous post, and added some more.

Link to comment
Share on other sites

A new ETA on the mod? I think the last time I made such an estimate, it established my inability to make good estimates. But I'd guess this month should see the mod getting released. I'm almost done with my holiday in Fanglewood, and some of my time lately has been used in a diversion of making placeables.

 

http://1.bp.blogspot.com/-231IvYKlgug/UFPhuCkzyRI/AAAAAAAADw0/X0ZCS0PTnFo/s320/ogre%2BETA.jpg

 

Speaking of which, as I indicated in previous posts, I've been working with Eguintir Eligard on some placeables. He models, I texture. Here's the latest work.

 

Individual placeable potion bottles. There are some normal bottles in the toolset, but nothing fancy. Drab jugs and wine bottles, etc. The toolset comes with several shapes of potion bottles, but they're in groups that you can't separate, and that's no good if you just want to have a single potion that can be picked up by the player or otherwise manipulated in some way. Or you just want more flexibility in how you decorate your tables.

 

So Eguintir agreed to separate the bottles for me. He said he couldn't save the original texture map, so I had to texture it from scratch, but that's fine, since I like my texture better than the original. I made it fully tintable in three separate channels, and I made a few preset blueprints of several colour combinations.

 

Now you can put potions alongside your gold piles for treasures, or leave a pretty bottle out on a table in your dungeon with a trap attached to it, or use a special bottle as a prop in a quest. Maybe even use them as fancy decanters for distilled alcoholic beverages with the appropriate tints.

 

http://2.bp.blogspot.com/-qj7e3ZzbYk4/UFPhtIVkP2I/AAAAAAAADwc/FYtlSrIrzKg/s320/bottle%2Bsample%2B3a.jpg http://1.bp.blogspot.com/-H84WNKrhVtI/UFPhtulNb_I/AAAAAAAADwo/7eTo56DqZkg/s320/lobotomy.jpg

Link to comment
Share on other sites

Today's work is rather miscellaneous and uninteresting to the reader, I think. I started work on another of the major plot encounters, and realised I needed to expand the island a bit to give more room for fighting.

 

From there I started assembling a better lighthouse exterior than the stock tower I was using before, from the BCK stuff.

 

From there I retextured some of the pieces, to better work for the exterior. This involved doing some systematic tests to see exactly where the boundaries were in the too-imprecise template that was provided. That was ultimately successful, so I built most of the lighthouse. It just needs a little more decoration that I don't have time to do before posting this, but will get done first thing tomorrow, and then I can show it. Then I'll get back to the encounter.

 

Also did some minor flavour polish with sound effects and conversation.

Link to comment
Share on other sites

One major thing that makes things take longer than they should is that moving placeables doesn't count as an undoable action. I can delete an item and hit undo to bring it back, but if I just move it accidentally, I can't put it back where it was. This is why I should lock things in position, right? Because I had to close without saving when I accidentally moved several dozen assembled pieces of the lighthouse at once, and their heights all got messed up in the move. Lost some work.

 

Currently, the new lighthouse is very clean-looking, which is unsatisfactory. I can fix that with a simple texture swap, though, now that I know what it looks like assembled.

 

http://1.bp.blogspot.com/-bfjgnn6g0Vg/UFj9Msb86nI/AAAAAAAADxs/r-tSHT0qMfE/s200/bcocc%2Bnew%2Blighthouse%2Bext.jpg http://4.bp.blogspot.com/-NaNpbLi0xog/UFkAgN5sY2I/AAAAAAAADyc/4YksQoIgASM/s200/bcocc%2Blighthouse%2Bfar%2Bview.jpg

 

I finished the lighthouse and prettying up the extended island (I plan to make some non-glowing windows for this purpose, though, which I'll replace these with), but then I ran into that accursed problem with the walkmesh right along the dock again. The line isn't even at the dock, it's a short distance past it. And this is after I fixed up the things that I could see from later experience that I had done wrong. So annoying, and it was necessary to make the changes, too, because I needed a walkable area in a place where there wasn't one before, so it's not like I could have just left it the way it was.

 

I finally got it working (and better than it was before) with the use of two barely-touching walkmesh helper planes over the docks that I converted to environmental objects.

 

http://3.bp.blogspot.com/--rWLdA_e7x0/UFj9L8P156I/AAAAAAAADxg/B8OzWFYEj-c/s200/bcocc%2Bwalkmesh%2Bagain.jpg

 

Right, so the docks had been placeables, and the fact that there were two of them touching may have been the thing that set off the walkmesh troubles, despite that trouble being on the opposite side of one of the docks. Why it worked with butted-up walkmesh helpers and not butted-up docks, I don't know. Previously, I had tried just a simple placeable-to-terrain connection, and when that didn't work, I made many attempts at a placeable-to-walkmesh-ramp/plane-to-terrain connections.

 

By the way, although I mentioned it a few times in earlier posts, I just want to remind everyone that if there's any placeable, script, or system that I've shown here that you want to use in whatever you're working on, you don't need to wait for this to be released. Just write to me privately and let me know what you want, and I'll send you an advance copy of it.

Edited by Tchos
Link to comment
Share on other sites

Gather round, me hearties, for it be International Talk Like a Pirate Day! To celebrate, you could hardly do better than playing this song, and singing along (Thanks, Tom Smith)! It would have been a perfect day to release this module, if it were ready, due to its pirate theme. But even if I had planned ahead, I probably wouldn't have made it.

 

Instead, accept the greetings of Cap'n Peg Powler, the infamous sea hag pirate, and the primary antagonist of this module! She's seen here with First Mate Scoursinge of the Fifty Lashes, who you saw before in the group shot of the other ogres, along with Bosun Fiercejaw the Shrill. Her costume accessory was, I think, my first experience with importing custom content into the toolset.

 

http://2.bp.blogspot.com/-qzGxEbFZNyM/UFnLt6gbx_I/AAAAAAAADzU/06Zd9zqo4Io/s320/bcocc%2Bpirates%2Barrrr.jpg

 

Yo ho! :pirate:

 

There's still one more boss that's been ready to go, but has not yet been seen. More on that one later. ARRRRR!

 

In other news, I'm experimenting with a script for the town citizens, to handle what happens if you attack them, since you can attack anyone. I was starting to make a replacement On Damaged script, but I saw it had a line in that default script for signaling a user-defined event whenever they're damaged (if that flag is active), so I created a user-defined event script instead, and used the NWMASTER local variable to activate it on the test NPC.

 

The first thing I tried was to just turn the NPC hostile if you attack it. I used the code in the ga_attack script. This worked, but it had the unintended side effect of causing the town guards to attack the poor NPC right along with you, instead of defending the citizen.

 

http://2.bp.blogspot.com/-F2m2auJmKjQ/UFnLtWXhSVI/AAAAAAAADzI/vFEut2xpbrw/s320/bcocc%2Battack%2Binnocent.jpg

 

Also, I noticed there's a problem with the ga_attack script. The instructions for the script say that the parameter bMaintainFaction should be set to TRUE if you want the NPC to attack without switching to the hostile faction, but when I looked at the function that the script calls, it actually does the exact opposite. What the ga_ script calls "bMaintainFaction" is called "bSetToHostile" in the function itself, and does as it says.

 

Anyway, when I made the attack script not change the citizen's faction, it worked better, but this time the guards just stood around without helping anyone. They're in the Defender faction, so I thought their default AI would make them defend a commoner under attack. Maybe I need to activate some kind of signaling for that to happen.

 

I tried a different strategy of adjusting the reputations of their respective factions to reduce by 20 points each time you attack a citizen (or a merchant). That means you get several chances, but if you keep attacking citizens, then both that faction and the Defender faction will eventually turn against you.

 

At any rate, it's better than how they were behaving before. Could surely still use development, though.

Edited by Tchos
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...