Author Topic: NWNCX Suggestion - open "hard coded" visual effects to modification/addition  (Read 6676 times)

Legacy_The Amethyst Dragon

  • Hero Member
  • *****
  • Posts: 2981
  • Karma: +0/-0


               Just copying this over from the custom content section:

Alex Warren wrote...

Several months ago this was
impossible, but thanks to Virusman and Amethyst Dragon we can now add
new visual effects to weapons.  So my question is - would it be possible
in NWNCX to 'remove' hard-coding from other visual effects in the game
(beams, 'skin-changing' effects)?

Any thoughts?


               
               

               
            

Legacy_virusman

  • Sr. Member
  • ****
  • Posts: 448
  • Karma: +0/-0


               It would help if you could specify in detail, what 2das are involved and how these effects are applied.
               
               

               
            

Legacy_Alex Warren

  • Sr. Member
  • ****
  • Posts: 326
  • Karma: +0/-0


               Beams are applied through EffectBeam() function, 'skin-changing' effects are applied as normal vfx (EffectVisualEffect()). Sorry, but I don't know how they work exatly.

They are all listed in visualeffects.2da (as a value in ProgFX_*). I haven't found any models for them, although I know I saw mod on the Vault where someone replaced textures in 'skin' effects.
               
               

               


                     Modifié par Alex Warren, 05 juin 2012 - 08:32 .
                     
                  


            

Legacy_virusman

  • Sr. Member
  • ****
  • Posts: 448
  • Karma: +0/-0


               There are several hardcoded effect types. See ProgFX_* in visualeffects.2da columns to see where these VFX types are used.

100 - EnvironmentMap
I haven't seen it used anywhere, but it's actually configurable.
ProgFX 101 = apply environment map vdu_envmap001, 102 = vdu_envmap002, etc.
I don't know how it looks in game, though.
200 - SelfIllumination
Calls some function with 3 floating point params (I guess it's color). Can be softcoded.
300 - LightSource
Model name + some parameters. I don't think it's worth modifying. We have enough colors for light sources.
400 - Alpha
3 or 4 params. Can be softcoded.
500 - SelfIlluminationPulse
6 params. Can be softcoded.
600 - Beam
Model name. Can be softcoded.
700 - UnloadModel
I don't know what this does
800 - Chunk (gib)
Heavily coded, nothing to do here.
900 - Mirv
Model name + hardoded trajectory. I'm not sure if this will work if you just change the model name.
1000 - TextureReplace
Texture name + some offset. Can be softcoded.
1100 - Cheat
Cows from hell!
1200 - Spellfail
I don't know what this does
1300 - Freeze animations
Self-explanatory. Nothing to modify here.
               
               

               


                     Modifié par virusman, 05 juin 2012 - 11:13 .
                     
                  


            

Legacy_virusman

  • Sr. Member
  • ****
  • Posts: 448
  • Karma: +0/-0


               So what kind of ideas do you have about these VFX and what would you want to see first?
               
               

               
            

Legacy_Alex Warren

  • Sr. Member
  • ****
  • Posts: 326
  • Karma: +0/-0


               I would love to have new beam effects for my warlock (PRC) - eldritch blast (+ versions modified by various eldritch essences) and if it's possible to scale beam effect, maybe I could also add proper eldritch line?

TextureReplace would be nice for some spell effects (iron body, crystalize psionic power etc).

If you could softcode them, many people (including myself) would be grateful '<img'>
               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0


               

virusman wrote...
So what kind of ideas do you have about these VFX and what would you want to see first?

You never cease to amaze me, VirusMan!  Please excuse my wordy responses (and horning-in on Alex's request),  I have no idea how much CC you do so I included what I hope is some helpful information, if you need it.

Beam (600 series ProfFX) have my vote for first to be investigated.  To be able to make new beams would be insanely cool.  The unique thing about beams is that they connect two different models on the fly.  Each beam has it's own model (vim_*.mdl) and I think NWN replaces the ref_node (fx_ref) in the beam model with the target models' impact node.  Does that make any sense to you?  Most if not all beams are actually lightning emitter types which (I believe) basically broadcast lightning from the player to the target.  I should have taken better notes.  I never thought anyone would go after the ProgFX functions!

Texture Replace (1000 series ProgFX) would be my second choice.  Also very cool.  The way I think this works is a bit more limited because it applies the texture to the entire model but it would still be very nice.  If there were some way to configure which parts of the model for the texture to be applied to that would be incredible but I think that might not be possible.  I think if you can get this working, and if the creature's model used a single texture for all its pieces, you could maybe switch the entire texture of the creature.  Which means you could make variations of the creature's appearance without needing a new model. (!)  If that worked like I think, that could be a big deal.

MIRV (900 series) would be my third choice, but not a big deal.

virusman wrote...
I'm not sure if this will work if you just change the model name.

I don't know how to express myself because I haven't had much time to mod NWN in about two months, but I don't think that will work.  There's a similar issue with beams.  Basically, sometimes the wrong (color, for instance) MIRV or beam displays.  Anyway, the MIRV seems to be a hardcoded and slightly tweaked version of the "burst" projtype.  It's possible to fake something that almost looks just like a magic missile MIRV by "overcasting".

I don't know how much custom content you do, VirusMan but this post of mine might help or give an idea or two:
"Monster" nodes on a player, ProjType demo module

I also have to say, if you're right about ProgFX 100 series, you just made my day.  I had noticed vdu_envmap%03u in a string dump from NWMain but since the next series of strings are from the 1000 series (starting with vdu_tex_stone, ProgFX 1010), I always assumed the proper ProgFX was 1000, not 100!  If that works, being able to change environment maps like that would almost be as cool as the Texture Replace functionality!  Aside from shiny stuff, I think the possibilities for tinting via environment maps is promising:
HowTo: Recolor a texture conventionally or with an envmap for an "infinite" recolor

Thank you for doing so much to help expand the game!
               
               

               


                     Modifié par OldTimeRadio, 06 juin 2012 - 09:48 .
                     
                  


            

Legacy_virusman

  • Sr. Member
  • ****
  • Posts: 448
  • Karma: +0/-0


               I think you got me wrong: aside from some minor emitter and retexturing CC for my haks, I don't make any CC, so I wasn't planning to do an original CC now: I leave it to the talents like you, The Amethyst Dragon and others. After all, I also need a motivation to work on NWNCX, and imagining things that might be done using my extensions motivates me to dig into the NWN code again and again. '<img'>
               
               

               


                     Modifié par virusman, 06 juin 2012 - 03:31 .
                     
                  


            

Legacy_The Amethyst Dragon

  • Hero Member
  • *****
  • Posts: 2981
  • Karma: +0/-0


               virusman:

If you can provide us a way to add and/or modify such things as the texture replace and the beam effects, I'm sure we can come up with some good ways to make use of that capability.  '<img'>
               
               

               
            

Legacy_virusman

  • Sr. Member
  • ****
  • Posts: 448
  • Karma: +0/-0


               While I'm at it, could anyone try the EnvironmentMap FX?
               
               

               
            

Legacy_Dark_Ansem

  • Full Member
  • ***
  • Posts: 148
  • Karma: +0/-0


               how do we try it?
               
               

               
            

Legacy_virusman

  • Sr. Member
  • ****
  • Posts: 448
  • Karma: +0/-0


               Create a new line in visualeffects.2da with "101" in one of the ProgFX columns (ProgFX_Duration, probably). Then create an environment map texture named "vdu_envmap001", then try to apply the effect in game.
               
               

               


                     Modifié par virusman, 06 juin 2012 - 08:53 .
                     
                  


            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0


               Virusman, you're amazing!  I had to leave earlier today and take care of business but I just got back.  Before I left I confirmed that the functionality you describe works and cycled through about 30 environment maps on an object.  Demo video is compressing and I'm packing up the bits of the demo module.

It works!  I haven't had any problems yet.  '<img'>
               
               

               
            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0


               ---------->BEST VIEWED IN HD<----------

'Posted

---------->BEST VIEWED IN HD<----------
               
               

               


                     Modifié par OldTimeRadio, 07 juin 2012 - 04:57 .
                     
                  


            

Legacy_OldTimeRadio

  • Hero Member
  • *****
  • Posts: 2307
  • Karma: +0/-0


               And here's the demo module!  Hak goes in hak folder, module goes in module folder.  Load up the module and start pulling the lever.  More sample environment maps are included than I actually have entered in the visualeffects.2da but you get the idea.

'Posted