Zum Inhalt wechseln

Foto

ColorsFade's Development Journal


  • Bitte melde dich an um zu Antworten
560 Antworten in diesem Thema

#26
ColorsFade

ColorsFade
  • Members
  • 1.267 Beiträge
Today's Update:

I wrote a custom script to allow me to quickly set Journal statuses in Debug Mode. The default mechanism (dm_setvarint NW_JOURNAL_ENTRYblahblahblah) was too long to type. Now I can just type setquest(name_of_quest, number) and it's done. Really helps with conversation debugging.

Speaking of conversations, I spent quite a bit of time tweaking the main conversation piece in my first town. Lots of NPC's give quests, but this particular person is a resource for several different quests, and I wanted to make sure the subsequent conversations fired correctly, in the right orders, etc. I noticed that Conditionals are really useful here, outside of the RunOncePerModule feature. In fact, controlling Conversations with Journal entries seems like the best bet for consistency.

I also got some SLS2 lights working. That was really fun to watch.

I also looked at and downloaded a lot of Prefab outdoor areas today (and one interior I fell in love with). Some folks have a real knack for outdoor areas and it's going to save me a ton of time.

I'm also updating several working design documents, of which one in particular I am using to track all the prefabs and other user-created content I'm making use of so that I know who to properly attribute work to when this is done.

So much to do...

#27
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 Beiträge
You can use all the conversation scripts in the debug console, ga_journal would have done just as well.

#28
Tchos

Tchos
  • Members
  • 5.030 Beiträge
I have never used "NW_JOURNAL_ENTRYblahblahblah". There's already a built-in script that does the same thing as what you wrote, called ga_journal, where you just type the tag of the quest the number of the entry you want.

rs ga_journal("tag", 10)

#29
ColorsFade

ColorsFade
  • Members
  • 1.267 Beiträge

Tchos wrote...

I have never used "NW_JOURNAL_ENTRYblahblahblah". There's already a built-in script that does the same thing as what you wrote, called ga_journal, where you just type the tag of the quest the number of the entry you want.

rs ga_journal("tag", 10)


Ah, very cool then. I looked but couldn't find it. I figured they had to have something like that. 

Well, I can use that then :)

Thanks guys!

#30
Morbane

Morbane
  • Members
  • 1.883 Beiträge
i write my own conv scripts all the time, to add or remove a parameter or for a very specific purpose - the stock scripts sometimes fall short even if they would have worked fine - before you revert to them CF do a thorough comparison.

#31
Tchos

Tchos
  • Members
  • 5.030 Beiträge
Yeah, listen to Morbane, too. I also write conversation scripts with abandon, and there's no reason why you shouldn't, if you have additional parameters to add. In fact I have my own script to update the journal, but in my case it's because I've added 3 additional parameters to it, and assigned several previously unassigned default values to it that suit my purposes.

In the particular case you mention, though, the stock script performs just as many functions as the one you wrote, which is why I suggested it.

#32
ColorsFade

ColorsFade
  • Members
  • 1.267 Beiträge
Yeah, I can see the need for writing ones own scripts to advance the journal a particular way. One quest might have multiple variables/items associated with it, and it might not be enough to simply increment the journal to the next step when you really need to also adjust variable values, etc. In particular, I'm seeing cases where the OC uses variables in conversations to track when you've met someone for the first time, because those variables can help adjust conversation flow (I was about to do this on one conversation of my own, and was pleased to see the mechanic already in use in many of the OC conversations).

I have no zero fear of scripting, being a developer myself. So I have a feeling I'll be writing a lot of scripts :)

#33
ColorsFade

ColorsFade
  • Members
  • 1.267 Beiträge
One small development note, which I found cool...

So, there's my two warehouses full of rats, and the PC has to clear them out. I have rat squeak sound placeables in both warehouses, and it was annoying me that after the rats were all dead, those sounds would fire (because, of course, they are not tied to the rats at all). Here I am, playtesting the area, and I'm annoyed because I know, as the developer, all the rats are dead, but the sound is still playing, and I'm thinking to myself, "If I'm the player, I think there's still a rat in here that I missed".

Fortunately, that was really easy to remedy as part of the OnDeath script for the rats. Get the Sound Object by ID and call SoundObjectStop(). And it worked.

I can tell me and the scripting system are going to be best buddies.

#34
Tchos

Tchos
  • Members
  • 5.030 Beiträge
About that default sound object with the rat squeaks -- I'd make some edits to it if I were you. If you place it down and listen to it in the toolset, you'll hear the same single rat sound looped over and over, even though there are 7 different rat sound effects in the field of sounds to play. Turn off "looping", turn on "continuous", and reduce the "interval" (like to 5000), and you'll hear the rest of the sounds play. Optionally also turn off "random".

#35
ColorsFade

ColorsFade
  • Members
  • 1.267 Beiträge
@Tchos: Fortunately, Wyrin, who created the prefab I'm using, already had it working correctly :-)

Bearbeitet von ColorsFade, 25 Februar 2013 - 11:00 .


#36
ColorsFade

ColorsFade
  • Members
  • 1.267 Beiträge
Today's Update:

A lot of stuff is working now, and it's making me very happy and excited to work on this project. 

For starters, I got the World Map functioning. Getting the World Map to work feels a bit like having the training wheels taken off, or getting your driver's license for the first time. My charactesr can go anywhere now! I feel liberated.  

The only glitch in the whole thing is that every time I load the map in the Editor, it's black, and I have to fiddled with loading different versions of the map in order to get it to appear in the editor. I read Bill Hall's notes, but I still have issues, even with DDS maps. About the only thing that works is making a complete new TGA file and copying it into the directory, and then loading that. It seems like the World Map editor hangs on to FileInfo objects. Clicking on a map that's already been loaded doesn't cause the map editor to load it if it's already been loaded (because no wait cursor appears, so the code to load the image is clearly not running). But if you introduce a new filename it hasn't seen yet, it seems perfectly willing to fire that code and load that map. Again, another case where I wish I had access to the source code. I feel like i could fix whatever issue is happening in short order. 

I also created my first recruitable NPC and was able to add them to my party via a conversation. This part was quickly facilitated by another short tutorial on the nwn2toolset site. Easy peasy. 

I spent an inordinate amount of time trying to figure out how to keep buffs from expiring while in a conversation, but in the end learned that it's pretty much impossible without a lot of variable bookkeeping. This disappointed me simply because it would be such an easy fix if I had access to the source code. A simple member on the Effect object would do wonders. I may revisit this aspect later on, because it's important to me, but for now I will spend my time focusing on creating content, not trying to re-write the mechanics of the engine. 

I spent quite a bit of time reading Tchos' Diary today. The page that garnered the most attention from me was regarding character alignment changes. It was informative to me to read about the differences bewtween SoZ and the OC. I found myself siding with Tchos' viewpoint, that alignment shifts shouldn't really occur during the game for a character because their nature really doesn't change, but instead use alignment to limit the responses a character can give in conversation. 

As a builder, the latter option seems easier to implement and it also just makes more sense. 

I did go on to read some valid points about Paladins falling, etc. And I think when you're telling a "story" that's a key component - that characters evolve and change. And indeed, in my own story, I have one NPC character in particular who is going to undergo some pretty dramatic change. But it's not the PC. The PC is there to play, to explore, to adventure, to enjoy. I don't really want the PC to go through some alignment-altering journey. What I want my PC to do is become a grand adventurer. For the PC, the "change" is going from a whelp barely able to clear out some rats inside a warehouse to a renown adventurer whose name is known far and wide. 

Which brings me to another feature I'm contemplating, and that is the old Baldur's Gate style of reputation points. I want to implement that (a simple Global Variable) and have heroic actions increase reputation. As the reputation grows, what I want to do with that is change the ambient barkstring dialogs that people in towns will emit. When you're nobody, no one will say a word. But as your "fame" grows, people will start to know who you are. As you pass by people in towns, I want them to speak lines such as, "There goes so-and-so, I heard he did xxxx at yyyy" sort of stuff. 

The other thing is I'd like to use reputation/fame as  way of determining when certain quests make themselves known to the PC (a common mechanic in games). There are a couple of towns in this campaign where the PC is going to be spending a lot of time, and I want to control when the PC gets certain quests. The fame/reputation indicator seems like a logical way to do that. 

The next task in front of me is spawning an encounter and scripting a cut-scene. I've been looking at the code from the OC where the PC and company meet the sailors in Highcliff and the fight breaks out (or doesn't, depending on your diplomatic skills). That's pretty much how I want this particular even to work. 

It feels like I have most of the basics under my belt now. 

#37
ColorsFade

ColorsFade
  • Members
  • 1.267 Beiträge
Small Update: 

I had decided it was time to implement Tcho's Transition-Without-Opening-The-Door Code in my module. I figured I'd get ahead of this before I had too many doors, as this was a feature I wanted to have.  

But I noticed he was handling the sound and target waypoint data as variables that had to be set on the door. I figured those properties are already specified on the door and maybe I could alter the script to save me some re-entry of data (after all, my doors were already working and transitioning to waypoints; I didn't want to have to re-enter the data if I could avoid it). 

Well, it turns out that you can get *half* of the data you need easily: the target of the door transition can be fetched simply enough: 

object target = GetTransitionTarget(OBJECT_SELF);


Unfortunately, the sound, as far as I can tell, can't be fetched as easily. Doors have sound "sets", because they have an opening and closing sound. If the actual sound strings were stored in the 2da you could fetch them directly, but that's not what gets stored in the door's 2da file. Instead, it's an integer to a "SoundAppType". Somehow these integers link back to sound "sets" (I assume 2 files for every door), but so far I haven't been able to figure it out. I might be able to figure out what each number means, and which set of sounds they map to, and then write a big old switch statement to play the appropriate sound. But that seems like more work than it's worth at this point. Writing the switch would be easy enough, but matching up integer values in the sounds 2da file against actual sound files would be time consuming. 

So, for now, I decided to adopt Tcho's door-variable way of passing in a door open sound, but I modified it slightly. To save myself some trouble (on my many already working doors), I set the script to automatically use the default door sound. If you provide a "sound=" variable on the door, it will use that instead. Otherwise, it uses the default door sound of "as_dr_woodmedop1". 

Thus, for the majority of my doors right now, I can simply add the script to the OnOpen event and change nothing else. 

#38
kamal_

kamal_
  • Members
  • 5.235 Beiträge
Keep in mind you can export and import variable sets (and scripts). So get one door's variable set working and export it. Then import it on the other doors, and the variables are already assigned and you only have to change the values to the correct ones for that door.

#39
ColorsFade

ColorsFade
  • Members
  • 1.267 Beiträge

kamal_ wrote...

Keep in mind you can export and import variable sets (and scripts). So get one door's variable set working and export it. Then import it on the other doors, and the variables are already assigned and you only have to change the values to the correct ones for that door.


Ah, good to know. Did not realize that. I keep forgetting you can do that. 

#40
MokahTGS

MokahTGS
  • Members
  • 946 Beiträge

ColorsFade wrote...

kamal_ wrote...

Keep in mind you can export and import variable sets (and scripts). So get one door's variable set working and export it. Then import it on the other doors, and the variables are already assigned and you only have to change the values to the correct ones for that door.


Ah, good to know. Did not realize that. I keep forgetting you can do that. 


Yes you can export all sorts of things which makes for setting up new areas much easier.  The vault has large collections of prefabs for lighting, placeables, and even scripts.  I have a collection of prefabs that I've made over the years for all sorts of things.

#41
ColorsFade

ColorsFade
  • Members
  • 1.267 Beiträge

MokahTGS wrote...
Yes you can export all sorts of things which makes for setting up new areas much easier.  The vault has large collections of prefabs for lighting, placeables, and even scripts.  I have a collection of prefabs that I've made over the years for all sorts of things.


Yeah, I've used the SLS2 lights - those are great! 

I keep forgetting, however, that there are those import/export buttons above the right-hand pane and that I can actually import properties from another like blueprint. That will save some time, for sure. 

#42
Tchos

Tchos
  • Members
  • 5.030 Beiträge
I recall that I posted my original draft of the door code on the forum, but I made numerous modifications to it since then. For one thing, my current code includes a default sound effect, so you don't need to specify one in the variables unless you want it to be a different sound. It also works both on doors and on placeables, and has other bells and whistles.

But as Kamal mentioned, the way I always handle doors and other commonly used items is with saved sets of scripts and variables.

PS: It's Tchos, not Tcho.

Bearbeitet von Tchos, 27 Februar 2013 - 05:24 .


#43
ColorsFade

ColorsFade
  • Members
  • 1.267 Beiträge

Tchos wrote...

I recall that I posted my original draft of the door code on the forum, but I made numerous modifications to it since then. For one thing, my current code includes a default sound effect, so you don't need to specify one in the variables unless you want it to be a different sound.


I figured you would have modified it over time and I was tempted to dig through your thread to see if there were updates, but at 29 pages I decided I'd rather tackle it on my own. 

And it's actually a good exercise for me to keep bumping up against these issues because every time I have to write a script I learn something about the way the scripting engine/game works. It would be awesome if we could all download each other's brains concerning NWN2 Toolset, but we can't. So we code and learn. 

P.S. I meant no offense with your name. Sometimes I just type fast and miss characters. 

#44
Tchos

Tchos
  • Members
  • 5.030 Beiträge
There are no updates to it published on the forums. I was generally going to just leave a proper release to after the module is finished, along with the rest of the materials I've devised along the course of it, but in the meantime I have a standing offer to send whatever bits and pieces that I've mentioned in the thread to individuals on request.

The postscript was not offense, but an informational correction.

#45
ColorsFade

ColorsFade
  • Members
  • 1.267 Beiträge
I spent some time yesterday looking at the Silverwand Sample Campaign, in particular the barkstring code. I really like the idea of judicious use of barkstrings to liven up an area. It's a small thing, but done right it really helps add to the atmosphere, I think.

The Silverwand Sample Campaign is great and it was a good source of ideas. 

I also spent quite a bit of time researching additional NPC's of Fearun for my story, and a lot of time in my design document updating ideas, fleshing out story arcs and filling in gaps. 

In the beginning, I wasn't sure if I wanted to create my own world or try and do something with Faerun. Once I found a good spot in Faerun to tell my story, I found myself more and more interested in learning about the towns and people. The internet is a great resource and there's a lot of information out there, and it's fun to read about the characters and relationships, etc. I'm going to pull many of the NPC's of the area into my story, and try to stay faithful to who they are in the documentation I've read, and I hope it all gives the right flavor to what I'm trying to accomplish. 

The other thing I did was playtest a couple more encounters. I have a couple different test characters that I am using because I want the player to be able to play any class in this game, and so I need to test the encounters, especially the early stuff when you're level 1 and don't have a companion yet, to make sure any class can survive.

Tuning encounters is something I really want to take great care with. I want players to be challenged. but in a way that feels fair. I don't want anyone to feel like something is impossible, yet I want some difficult encounters in here. I want combat encounters to feel rewarding to the player; exciting and challening, but not oppressively impossible. 

#46
kamal_

kamal_
  • Members
  • 5.235 Beiträge
Where did you pick, by the way?

#47
ColorsFade

ColorsFade
  • Members
  • 1.267 Beiträge

kamal_ wrote...

Where did you pick, by the way?


It's a secret. 

#48
ColorsFade

ColorsFade
  • Members
  • 1.267 Beiträge
I didn't get to spend as much time today as I wanted working on my mod (thanks to multithreaded code in my real job requiring my attention), but I did have enough time to write some scripts to spawn companions and grant them XP for level up. 

I spent most of my time creating NPC's, adjusting tints/colors, learning how to make armor for them, and planning their introductions and stories in Excel.

I have serveral recruitable NPC's and I wanted to really define each of them wel. Each NPC's gets a name, race, alignment, class, quest and a defined point in the campaign when the PC is expected to encounter them. Whether the player decides to take them into his/her party is the player's discretion, but much like Baldur's Gate 2, I intend for every NPC companion to have a unique quest/story so it's worthwhile to take them along for at least long enough to do their quest. 

I also spent some time adjusting stats and making experimental builds on the NWN2 character creator website. I've decided that I want players to have the freedom to multiclass the NPC's however they like, and in particular, in directions that make sense. Not all the NPC compansions are going to have stats combinations that make a lot of sense for multiclasses. In fact, few will. But those few that do, it makes sense to look at their states and alignments to determine what classes and prestige classes might make sense. .

From what I can tell, NWN2 supplies multiclassing NPC's as an all-or-nothing option in the Campaign settings. Either the NPC's cannot multiclass at all, or they can multiclass for any class they are qualified for (there's no middle ground with restricting them to two or three classes). I want players to be able to have the freedom to adapt the companions how they see fit, since they can't make a full party, so players will have that option. 

To facilitate that requries some planning. I have to create the race/class and grant stats, and then look at progression and possibilities and see things that make sense. 

I also spent some time working on a couple of NPC companions that I know the player won't encounter until far later in the game. Instead of allowing the PC to meet those charactesr as level 1 and have the player level them up, I intend to have them already built to a certian level, and the player can go from there. There is some flavor stuff I want to do here... and it's important that these particular NPC's, when the player meets them, are fairly fleshed out. 

Aside from that, I spent some time organizing my to-do list and prioritizing items. It' sa pretty free weekend staring me in the face and some progress deserves to be made. 

#49
ColorsFade

ColorsFade
  • Members
  • 1.267 Beiträge
Ah, frustration... 

I decided that today I would get around to making the best-appraise-skill script work with my merchants so that the companion with the highest appraise skill in the party would have his/her skill used when opening a store. Bob Hall has a script in the 4th PDF file of his awesome tookset notes and I decided to start with that. 

But it didn't work. 

The first thing I noticed is that when I was using just my PC (no compansions in the party yet) was that there was a substantial delay in the store opening (turns out the script's while loop runs more than once). Then, when I added a companion, it wouldn't work at all. So, I added a SendMessageToPC debug call to determine what might be happening, just throwing some debug lines to the chat window. And I learned that my PC was being tested inside the while loop a LOT. 

Hrmm.. 

Reading through the code I figured it might be because of calls to GetFirstFactionMember, which seemed like it was the wrong call anyway. The more appropriate calls seemed to be the ones dealing with the roster, so I could ensure that only the characters in my party were checked. So I changed it to GetFirstRosterMember and that worked; the while loop only ran once, for the one person in my party. 

But it still wasn't opening the store.

My test PC has a zero for the appraise skill, and the companion I was testing with had a four. So hers should have been the skill used. I decided to print two more pieces of information: the highest skill found and the name of the character with that skill. 

The results: 6 and Neeska. 

Neeshka? But she's not even in my party...

Well, as it turns out, on the advice of a tutorial about creating companion NPC's, I had created my first two companions by copying the blueprints of an existing companion from the OC, namely Neeshka, and apparently the toolset and game were still considering my companions as Neeshka.

In searching through my companion's properties, however, I could find no reference to Neeshka at all. Not in tag, resref, etc. Nowhere was Neeshka's name mentioned. I opened up the UTC file and still saw no mention of Neeshka. I had no idea how to fix that. 

I decide to spawn the Paladin companion. Same deal - reported as Neeshka. Hrmm....

So, the next step seemed to me to create, from scratch, a brand new NPC companion without copying from a blueprint, to see what happens. I just called him Lliam and filled out basic stats and put all the companion scripts on him and gave him an Appraise skill of 4. When I ran the merchant dialog, the debug output to the chat window correctly identified him as Lliam and his Appraise skill of 4.  

Thus one lesson learned: Don't copy NPC Companions. I don't know what the game engine or toolset is doing with the copies to make them retain the name of the copied character, but it's something internal and hidden. It could just be my machine, my toolset, or a setting somewhere that I am unaware of. But, to prevent such confusion and frustration in the future, I'll be creating companions from scratch. 

Back to the appraise script: With Lliam in my party the appraise script still wouldn't work. The final line wasn't getting called or wasn't working. What I noticed in Bob's script is that he's passing the object of the actual NPC character in the party to N2_AppraiseOpenStore. The game doesn't seem like that if it's not the actual PC. I don't know if that's because of a setting I have in my campaign or what, but it just doesn't like it. 

So, I had to alter the script a bit. Fortunately, I found a Word document on the internet with all the NWN2 script files like N2_AppraiseOpenStore in it, so I just copied the code and altered it. The only important piece of information that is really needed is the appraise skill of the person in the party with the highest appraise skill, and so that gets passed as an int to the new open method. 

Testing showed it worked. I started the module with my PC and opened the store and checked prices. Then I added Lliam with his Appraise Skill of 4, and the prices correctly adjusted, which was very satisfying to see. 

It's always irked me in the OC that my character had to spend precious points on Appraise if I wanted to make an impact with merchants... Now I can just have an NPC do it. 

#50
Tchos

Tchos
  • Members
  • 5.030 Beiträge

ColorsFade wrote...
I want players to be able to have the freedom to adapt the companions how they see fit, since they can't make a full party

You've said that only one of the companions will be mandatory, and that the rest are optional, so why not give the players the option of creating their full party in addition to recruiting NPC companions?