Aller au contenu

Photo

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


  • Veuillez vous connecter pour répondre
1056 réponses à ce sujet

#826
Tchos

Tchos
  • Members
  • 5 079 messages
Okay, let me just check a couple of things, because the toolset calls these things by slightly different names, and I want to make sure I'm thinking of the right ones.

Maximum volume = Maximum Distance?
Range of maximum volume = Difference between Minimum Distance and Maximum Distance? (So since your example total range was 30, with a range of 10, then it would be Min: 10 and Max: 20?

Nothing to do with Volume Variation, right?

Judging from the purple dotted sphere around the sound object, I estimate the distance from the sound to the edge of the area where you should still be able to hear it, is 100m.

#827
Dann-J

Dann-J
  • Members
  • 3 161 messages
There should be two range values:

- The range of maximum volume is how close you need to be to hear the sound played at maximum volume.
- The total range is the distance at which the sound volume falls off to zero.

So for a positional sound that has a max volume range of 10 and a total range of 30, you'd hear the sound at full volume if you are between 0 and 10m away, the sound will begin to fall off between 10m and 30m, and will be inaudible beyond 30m. The purple sphere represents the total range of the sound.

Modifié par DannJ, 11 juin 2013 - 12:59 .


#828
Tchos

Tchos
  • Members
  • 5 079 messages
Please refer to this screenshot and tell me if yours looks different, or you're talking about some other properties than the sound objects, because things are not written that way in my toolset. I only have minimum distance and maximum distance, not maximum volume and total volume.

https://www.dropbox.... properties.JPG

#829
Dann-J

Dann-J
  • Members
  • 3 161 messages
'Minimum Distance' is the distance at which the maximum volume plays.
'Maximum Distance' is where the volume of the sound falls to zero.

#830
Tchos

Tchos
  • Members
  • 5 079 messages
Wrote another quest and a new general-use script to work with it. What the hell am I doing? I don't know, but for some reason I like writing these scripts. This is a revenge quest, and so I needed a basic kill-quest system to work with it.

I wanted to track a certain amount of near-indiscriminate slaughter as well as a named objective, and use custom tokens to update the journal with the running total in the same way as I did the collection quest from before. That time, it was a script with a specific quest, message, and numbers to deal with. This time I wanted to make it entirely general so that I can just put this script on any creature, stick some variables on the creature, and update whatever quest I choose. It also displays a floating string with the running total, and allows for multiple objectives.

I also made it possible to choose whether to store/retrieve the tracking variables on the main PC, the current area, or the current module. I'm using the main PC as default, because that seems to be where the built-in journal stores its information. Maybe I should also add an option to store it on an object by tag, spawning a waypoint with that tag to store them on if the specified object doesn't yet exist.

After adding that quest, I found that my tinkering with a different script had caused an animation to stop playing. After some experimenting, I found that I had incorrectly used "==" instead of "=" in one spot, and the compiler hadn't complained. Fixed that.

I also found the reason for a problem that had plagued me for months -- certain of my goblins had one of those black cubes with the red question marks on them, which indicates a model that doesn't have any assigned textures. I had thought, since the box was on one of their arms, that it was the shield causing this problem, but changing the shield and ultimately removing the shield didn't help. Today I thought to check if perhaps it was one of their armour pieces, like the bracer. Well, I didn't determine that exactly, because somehow the blueprint had lost all of its custom armour settings. So I copied a different blueprint, reassigned the proper feats and put the same name on it, and removed the old one. That fixed the problem.

Rather than search for a louder waterfall sound, I just opened the existing waterfall sound from the game in Audacity and took a look. Indeed, it was far quieter than it needed to be, so I amplified it to the maximum it could go without clipping. I also noticed that there were fades in and out at the beginning and the end of the waterfall sound, meaning it could never loop smoothly. Why, I can't fathom. But it didn't seem to matter, because after I removed the gaps, it still had a brief pause at the beginning/end of each loop. The only semi-solution I could think of was the put two sound objects there, with slightly different pitch variations, so that they would start and stop at different times, partially masking the gaps.

I got the sound to reach as far as it needed to, and to get louder appropriately as you approach. I used a different distance on the second sound, so that as you ascend to the plateau the volume has a more distinct rise at point at which the waterfall is coming into view.

Next I made another general-purpose script, to use on an object that you have to place items into in order for something to happen. I made it so that you can specify as many items as you want in the object's variables, and have it update the journal and/or fire another script on success. I realised a little too late that I could have simplified it a bit by using an array, so that you'd only have to add 1 variable for all of the objects you wanted to check for.

#831
Dann-J

Dann-J
  • Members
  • 3 161 messages
I've noticed that problem with goblin armour accessories too. The black cube with the red question mark means there is a corrupted model somewhere.

The pause in looping sound placeables has always annoyed me. It's not so noticable on sounds that are punctuated (like cricket chirps), but it's really noticable for constant sounds - especially if there's a lot of white noise (fire, flowing water, wind).

#832
Tchos

Tchos
  • Members
  • 5 079 messages
Water's turning out to be the most oft-used ambient sound effect in this module. I tried both Continuous and Looping, and the difference seemed to be that the pause was occasionally longer with the Continuous setting (even with no interval variation), but steady with Looping.

#833
Tchos

Tchos
  • Members
  • 5 079 messages
Watching Marshall's Legends plugins demo videos always gets me fired up to do more in the toolset on my module. Since some of the plugins are for PWs and require a database, I've written a lot of scripts to provide the same kind of functionality without a database, though this of course means there's more manual work on it, since I can't use the plugins to generate all of the required resources automatically. Still, it's inspiring stuff!

It inspired me to go back and add in the special mechanics I had originally planned for one encounter in particular, but which I was going to just leave as a more straightforward fight. Now it's a little more challenging with some special things to do. They should be obvious, but woe to anyone who embarks on a quest without a full party!

I worked on some conversations that are necessary for the main plot, which were placeholders before (notably the Harbourmaster).

All this time, and I finally learned how the "preview" tab works in the toolset. So I can see what placeables look like without dragging them into an area. For anyone who doesn't know, you select the blueprint, click the Preview tab in the properties palette, and make sure the "Preview" toggle button is active in the strip at the very top of the Properties palette.

While looking through some scripts, I found a script that reports the PC's current location and current facing angle, whereas the "loc" command reports only the location, and I had to estimate the facing. The script gr_where_am_i() reports both.

I finished the Harbourmaster conversation, and moved on to the AI for one of the bosses. I'm trying a slightly different method than I used for the last boss, which was a damage switch in the spawn script. It worked, but I think it would be better if I moved the special event phase actions out of the actual NPC and into a regulator ipoint, which won't get interrupted by signals from the default AI.

I'm using a script in the On Damaged slot for this one, which will signal to the regulator's On User Defined event, and that's where the special actions occur, aside from the initial one in the perception script and the death script.

While looking for the event constants for this, I stumbled across exactly the command I was looking for before, and couldn't find. I wanted to be able to change a creature's scripts on the fly. I found a workaround at that time, in the form of SetCreatureScriptsToSet(), which required me to add entries to NWN2_ScriptSets.2DA, but what I really wanted is actually called SetEventHandler(). I couldn't find it before, because I was looking for commands with the word "script" in them. This is perfect! It will allow me to more easily and flexibly repurpose existing NPCs in a running game. This is great news because it makes it possible to expand a module/campaign nearly without limit, without the player needing to start over each time. However, my glee is very slightly dulled by reading that it doesn't function properly on areas or the module itself. But for what it does, I'm very glad.

#834
Dann-J

Dann-J
  • Members
  • 3 161 messages
Locations also have a facing direction embedded in them - that's the main difference between a location and vector. You should be able to extract the facing direction from a location, but you'd need to know what the 'struct' format was.

Modifié par DannJ, 25 juin 2013 - 11:41 .


#835
Tchos

Tchos
  • Members
  • 5 079 messages
What I mean is that when I'm in-game, and use the "loc" command in the console, it reports only the vector. That's what I've been using to manually copy down the vectors of specific spots to reference in my scripts, since opening that one area is near-impossible now, so it needs to be human-readable. With the gr_where_am_i() script, I can also write down the facing angle. I don't know anything about these "structs".

#836
Tchos

Tchos
  • Members
  • 5 079 messages
I've got the fight AI working. It consists of a perception script to start the whole thing off, a damage script to signal when to move to the next phase, a death script, and a regulator heartbeat that handles all of the special actions and abilities.

I've learned enough about scripting by now to add in the special abilities the sea hag is supposed to have, but which aren't in the NWN2 toolset -- namely, Evil Eye (3/day) and Horrific Appearance (aura, 1 save for each PC per 24 hours). So I got rid of the placeholders for those abilities: Death Gaze, Daze Gaze, and Pulse Strength Drain. She uses one of her special abilities on each stage, and the player is notified. She also has a bowl of commanding water elementals, and I've scripted her to make sure she uses it when necessary.

I put in voice barks at each stage, but I ran into the common trouble that creatures taking action will often not play the sounds you tell them to play. In other areas, I used a sound object that I would command to play at certain times. That's probably the best solution for any encounter in a specific area. I tried a couple of different ways here, though, and learned more about what works and what doesn't.

First, I tried having the regulator ipoint play the sounds, but I learned that placeables can't play sounds unless the sound is embedded in a VFX applied to the placeable (in which case I guess it's actually the VFX that's playing the sound).

Next, I looked into the "sound ninja" approach again (an invisible creature that spawns in, plays a sound, and destroys itself), which I had tried once before, but it didn't work then. Here, I just decided I didn't want to even try it again because if you spawn the sound ninja as needed, you need to delay the sound, and in a fast-paced fight like this, I don't want to delay anything.

So then maybe I wouldn't spawn it, and just have it there the whole time. But I don't want an invisible creature standing around, where it could still have collision or something that blocks players or NPCs from fighting. There's supposed to be a way to remove collision from a creature, though I've heard the ghost effect doesn't work, though it's supposed to. Also, I could place it in a space disconnected from the main walkmesh, but there's no way I'm touching this walkmesh again after how long it took to get it working.

Someone around here had a good idea (PJ? Tsongo?) of using spawning animals that are usually just used as decoration, and using them as references for scripts. So I placed a small rat on the pirate ship (not a Rodent of Unusual Size that are used as enemies, but a common normal-sized rat of the kind I used in my "sleeping at the inn" scene. I had the rat act as the ventriloquist, and it all started working. A pretty satisfying fight! Just one sound's still not playing, and that's the one that's supposed to fire when she dies. It's strange, because all of the other commands that occur after that line are firing correctly. Possibly it's because it uses "AssignCommand" to tell the rat to play the sound, and the others are straightforward commands?

At any rate, I put the files on sound objects and placed them in the area, and after a couple of tries where nothing played (the volume was 0, and it was set to play only during the Hours array, which was blank), I got the victory sounds to play.

Next, I created the loot. My bosses are dropping magic items that have a balance of both beneficial and detrimental effects, to make them more interesting. I notice these detrimental effects still add to the item's cost, though, so I correct that by adding a negative "additional cost" to it.

I'm using the SoZ loot system to spawn these items on the bosses from the items' resrefs. This is more convenient and less error-prone than putting it directly in their inventories, because I can make changes to the blueprints at any time, and those changes will show up correctly when the creatures spawn, whereas inventory items are instanced copies. This is especially useful when I'm creating placeholder quest items that I plan to fill out later, with their descriptions, icons, etc.

#837
Dann-J

Dann-J
  • Members
  • 3 161 messages
A rat of neutral faction scaled down to 0.1,0.1,0.1 doesn't present much of a collision target. You'd barely notice another creature diverting around it, even if they did happen to bump into it. Unless you knew exactly where to look, and zoomed in as far as you could, you wouldn't see it either. You could even give it a heartbeat script (and no other scripts) that makes it follow a certain target around closely, so the sound appears to be coming from the creature it's following.

Playing a sound on a creature counts as a queueable action, so make sure you ClearAllActions first. Otherwise the sound can get delayed until the creature has finished its current action, or it might ge over-ridden completely.

#838
Tchos

Tchos
  • Members
  • 5 079 messages
I'll do some experimenting with a shrunken rat like that. I have some other possible applications for such a thing, in fact. As long as there's nothing showing up in the combat log, like "Ventriloquist Rat resists all damage from your attack!" or something.

#839
I_Raps

I_Raps
  • Members
  • 1 262 messages
That will show up in the combat log, so choose your name well - probably not "Ventriloquist Rat." Leaving the name field blank ("someone resists all damage ...") might be the best bet.

There are rats throwing fireballs back and forth in a hallway in the Tomb of the Betrayers, for example.

#840
Guest_Iveforgotmypassword_*

Guest_Iveforgotmypassword_*
  • Guests
I always leave my rats and other conversation starters with blank names and descriptions unless the party's in a city, town or tavern when I just throw in a new guard or commoner. Making sure that the new npc spawns behind the trigger also ensures that everybody faces the right way ( PC facing the party ). Once whatever you've wanted to happen has you can just destroy the trigger or have the npc leave and it'll never happen again. I've got them everywhere in my mod and haven't had to script anything and everything happens at the right time without using any conditions.at all.

#841
Tchos

Tchos
  • Members
  • 5 079 messages
I can put the name in the curly braces so it doesn't display. :)

And I like that new guard idea. The town could use some more guards.

#842
Tchos

Tchos
  • Members
  • 5 079 messages
What I had in mind for another use of the unobtrusive rat was as a kind of a substitute for a trigger, because I found that OBJECT_TYPE_TRIGGER is not supported by CreateObject, and there doesn't seem to be any other way of creating one other than placing it manually in the area. This is, again, for the docks, and to add certain kinds of quests to the module for saved games in progress.

Using the rat's perception as a trigger was unsatisfactory, because it seems to be like a heartbeat, possibly checking for perception only every 6 seconds like the heartbeat does. Also, there doesn't seem to be any way to enable a creature to be able to see through invisibility without casting a spell (this is also a problem for the kuo-toa, who are supposed to be able to perceive invisible creatures).

Abandoning that idea, I looked into the GetFirstObjectInShape() method, and other methods like GetDistance(), but they all seemed to rely on heartbeats on placeables like ipoints, making them little better. A character could run right through one of these pseudo-triggers without triggering it if they got through in under 6 seconds, and I don't want a lot of sped-up heartbeats adding to the area.

I happened across what I needed while looking through the list of constants, finding a constant called SCRIPT_AOE_ON_OBJECT_ENTER. On enter is what I wanted. I couldn't find any example scripts that used that constant, but I learned what I didn't know, that you can create an invisible AoE object that has its own tag and set of enter, exit, and heartbeat scripts. A trigger in all but name!

So I wrote a quick conversation script to let me go in-game and watch these AoEs get created on command at a few different locations (I'll be using vectors for the locations later, but for the test I got the locations from waypoints), and also an On Enter script to print a message to the screen when I enter it, and destroy itself a few seconds afterward. Works nicely! Next I'll add a little quest that uses it.

#843
Arkalezth

Arkalezth
  • Members
  • 3 193 messages
So how advanced is this module? Sorry if that's been answered recently, but I haven't read through all the technical stuff.

#844
PJ156

PJ156
  • Members
  • 2 987 messages
The good thing about that model is that, apart from being sound objects, scripts targets and placeholders for vfx's, they make really good rats...

PJ

#845
Tchos

Tchos
  • Members
  • 5 079 messages
It certainly uses a lot of advanced techniques, but I assume you mean how much longer until it's done. Sort of a hint that I should finish the main parts and leave adding extra quests for later.

I believe there's only two or three more conversations to finish, for the currently existing quests. I should probably do those first. I can probably hold off on the finer decorations of the last area and do that while the rest is being beta tested.

I also need to script the events of the last major fight.

There are a few recruitable NPCs that need work.

I need to script a wardrobe change when you go underwater.

The pilot NPC needs to go in the cabin.

The epilogue needs to be scripted.

That's the extent of my to-do list.

#846
Tchos

Tchos
  • Members
  • 5 079 messages
Well, I don't know what's going on with the rat. I tried using the exact same rat in the same area for another PlaySound assignment, and this time I'm getting nothing but silence. The only differences include the sound file and the object making the call (the AoE object's On Enter).

Since I don't see any way to spawn a sound object, I embedded the sound in a VFX with no visuals and applied it as a temporary effect in its own location, which worked. Though this is an interface sound, so ideally it should be 2D rather than positional as it is. The VFX method would be more useful for the fight, actually. I'll keep it in mind for that in the final fight.

#847
Dann-J

Dann-J
  • Members
  • 3 161 messages
Are you using ClearAllActions() on the rat before assigning the sound to it? I usually put a slight delay after ClearAllActions() to be on the safe side (like 0.1 seconds). Things can get tricky when dealing with the action queue.

#848
Dann-J

Dann-J
  • Members
  • 3 161 messages

Tchos wrote...

That's the extent of my to-do list.


I've lost count of the number of times I've said that to myself, and it turned out not to be true (by a long shot).

#849
Tchos

Tchos
  • Members
  • 5 079 messages
I used ClearAllActions() on the NPC, but not on the sound rat. The rat has no scripts attached to any of its event handler slots. Is it still possible for it to have any actions in its queue in such a case, aside from those I assign through the ipoint? But it works in that case, and not in the case of the AoE object. I'll try throwing an assigned ClearAllActions() on the rat in the second case anyway, and see what happens.

On the to-do list: Yes, actually, I didn't say that the to-do list wouldn't have anything added to it if I found something wrong, or if further whimsy strikes, but it's true that those are the only things that I know of that are strictly necessary to get this one out the door.

Addendum: No difference when first assigning ClearAllActions() and delaying the assigned PlaySound() by 0.1f.  Back to the VFX method.

Modifié par Tchos, 01 juillet 2013 - 05:10 .


#850
Dann-J

Dann-J
  • Members
  • 3 161 messages
A creature with no scripts might still have something in the action queue if they get bumped and need to move out of the way. It's unlikely that'd happen at the worst possible time though.

It certainly sounds like the AoE object is the culprit then.

Most AoE spell scripts seem to assign things to the AoE creator, so that the game engine knows who the effect came from (rather than 'someone' if it comes directly from the AoE). I wonder if you can nest two AssignCommands? The first to assign the action to the AoE creator (provided it has a valid creator), and the nested one to then assign the sound to the rat.

Whenever I create a custom AoE, I usually apply it in a creature's OnSpawn event, and make sure I assign the AoE creation command to the creature itself (so the owner of the aura becomes the 'creator' for scripting purposes).