Aller au contenu

Photo

Visual effect changing during combat


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

#1
4760

4760
  • Members
  • 1 207 messages

As the NWN dragons use a very similar body (the most noticeable differences being the head and fins or manes at the tail or the neck), I decided to use only one line in appearance.2da for the body, one line in wingmodel.2da for the wings, three lines in tailmodel.2da (one for the dracolich tail, one for the chromatic dragons, one for the metallic dragons).

 

Basically, each species has its own head, a common body, a common pair of wings, a family tail.

To get all species in game, I thought I could just use c_nwndragon_cl_body01, c_nwndragon_head?? (where ?? is between 01 and 15), c_nwndragonwings and the tail, and apply a visual effect to swap the diffuse texture and the normal texture accordingly.

 

In the toolset, it works as expected. In game, the visual effect sometimes changes (because the dragons use stoneskin for example) and obviously doesn't revert to the original VFX.

 

Apart from having one mdb per species, is there an easy and quick solution to reapply the original VFX? I thought about using the heartbeat, but I'm not sure it's not too much work just for this... (looping through all effects, checking which change the appearance, and revert to the original effect if none is found...)



#2
kamal_

kamal_
  • Members
  • 5 250 messages

I think you can detect what if any vfx is applied, store that while you switch textures, and then reapply the vfx.



#3
Dann-J

Dann-J
  • Members
  • 3 161 messages

I can't imagine the normal maps for the bodies would be very different between species (or at least, the average player probably won't notice the differences). You might get away with a generic white tintable body, provided the tint texture is up to the challenge. The separate wings and tails can have individual textures.

 

Where the body normal maps do vary greatly (such as metallic or gem dragons having more specularity), you could have a body model for each general dragon type (one for chromatic dragons, one for metallic dragons, one for gem dragons, for instance).

 

I use my own tintable white dragon for a variety of species. Admittedly I spent a lot of time tweaking the tint map (the result is a lovely rainbow-hued work of abstract art).



#4
4760

4760
  • Members
  • 1 207 messages

I think you can detect what if any vfx is applied, store that while you switch textures, and then reapply the vfx.

Actually, the effect is attached to the blueprint, so I looped through all effects during combat. Checking the condition == EFFECT_TYPE_VISUAL_EFFECT kinda works (if no visual effect is applied, then the original diffuse map is reapplied. The problem is that some effects don't change the texture map, they just add some transparency. In this case, the wrong texture shows until all visual effects have expired before the correct skin shows up again).

 

As I don't want to spend too much time determining what spell ID applies which visual effect, I guess I'll just have c_nwndragon_cl_body01 to c_nwn_dragon_cl_body15...



#5
4760

4760
  • Members
  • 1 207 messages

I can't imagine the normal maps for the bodies would be very different between species.

That's right, but I noticed some parts where scales were more apparent.

 

Thanks for reminding me the tintable option, I'll give it a try before duplicating the mdb.



#6
Dann-J

Dann-J
  • Members
  • 3 161 messages

Actually, the effect is attached to the blueprint.

 

I've had a hard time detecting visual effects applied via the blueprint. One option is to create an OnSpawn script that applies a visual effect, which you can then tag with a dummy spell ID for easy retrieval later.

 

I created a visual effect that puts a seated mage on the back of a wyvern (a Zhentarim skymage). I initially put the VFX on the wyvern blueprint, but when the wyvern died and its OnDeath script spawned the unseated mage, you could still see the skymage VFX on the dead wyvern. The only way I could remove that VFX during the OnDeath event was to apply it via an OnSpawn script, using the above-mentioned method. Otherwise it stubbornly refused to budge.

 

14083160268_8b4dbe2990_b.jpg


  • kamal_ et 4760 aiment ceci

#7
4760

4760
  • Members
  • 1 207 messages
Ok, thanks for the tip. Let's see if that solves the problem.

#8
4760

4760
  • Members
  • 1 207 messages

:( Still doesn't work... When stoneskin is active, and the dragon casts another spell that uses visual effects on itself, it appears the default texture is used... I even tried without checking if other visual effects were active (meaning, always apply the dragon color VFX), but as it's in the heartbeat script, there's still the 6 s delay before the normal texture is reapplied.

And using an mdb per species is unfortunately not good enough (unless I missed a step, wings and tails have only one model per line in the 2da: it looks like my idea of using a common model for all NWN dragons is not that good... I wanted to avoid adding 15 lines in appearance.2da, tailmodel.2da and wingmodel.2da, but right now I can't see any other way).

 

Except if I succeed in creating "a lovely rainbow-hued work of abstract art" too!

 

Edit:

  1. Even without any visual effect (neither attached to the blueprint nor added at spawn), the tint disappears as soon as stoneskin wears off (like all colors had been chosen as pure white).
  2. The above was also the result of a test with an empty override, no haks at all in the test module.
  3. And finally, the loss of the tinting also occurred on a stock creature after stoneskin ended.

 

I checked the stock blue dragon, and found it doesn't know the spell "stoneskin". I had all the feats and skills automatically added, but it appears the special abilities have to be manually added. I don't remember where the list of abilities on my test dragon comes from... So can anyone tell me if the dragons are supposed to know stoneskin, barkskin or spiderskin spells? Because if they're not, I'd just have to remove them from their spellbook and the problem is solved! :ph34r: Not a nice solution, but at least it'd work...



#9
4760

4760
  • Members
  • 1 207 messages

:( Still doesn't work... When stoneskin is active, and the dragon casts another spell that uses visual effects on itself, it appears the default texture is used... 

:D It now works...

Looping through all the effects applied on the dragon, and reapplying the VFX corresponding to the effect (defaulting to the original dragon coloring VFX if none is found) solved it eventually.

I also tried with overridden .sef (changing the diffuse map swapping to coloring the skin in grey instead), but it would have meant doing this to all spells involving a change in appearance, so even if it didn't involve a custom heartbeat script, I finally decided not to go that way.

 

So, now dragon heads are done, dragon tails are done, dragon wings are done, blueprints are done (for wyrmling, young, adult, very old and wyrm ages - not sure that very old [level 35ish] and wyrm [level 40+] will be ever used though) and animations have been converted.

Well, it should be ready for upload then, except that I'm not too fond of bipedal dragons, and the Idle / IdleM animations need to be recreated to match a four-legged animal.


  • rjshae aime ceci

#10
Dann-J

Dann-J
  • Members
  • 3 161 messages

If the dragons all share the same skeleton, then they can all use the same line in appearance.2DA. If the wings are 'extra' models rather than 'real' wings, then you can use different armour types for the different species (cloth, hide, scale, plate, etc). The 'extra' models can then be named after each armour type (CL for cloth, HD for hide, etc).

 

If the wings are 'real' wings (that is, they're in wingmodel.2da), then you can have all the dragon body types as the same armour type (cloth01, cloth02, etc).



#11
4760

4760
  • Members
  • 1 207 messages

If the wings are 'real' wings (that is, they're in wingmodel.2da), then you can have all the dragon body types as the same armour type (cloth01, cloth02, etc).


I'll have to test again then, because cl_body01 didn't work with tail01 but tail only. Same for the wimgs.