Author Topic: Questions about possible modifications?  (Read 939 times)

Legacy_LindsayReynolds

  • Newbie
  • *
  • Posts: 20
  • Karma: +0/-0
Questions about possible modifications?
« on: August 29, 2012, 01:54:06 am »


                My apologies if this is posted in the wrong forum. I think
this is the most appropriate for my questions, but I’m not completely sure!

I’m a PhD candidate at Cornell University, and I’m hoping to
use NWN as a platform for my dissertation to study aspects of group
collaboration. I am interested in learning about the possibility of several
types of GUI or environmental modifications. Therefore, I’m hoping to find out whether it is
possible to make several modifications, and if so, whether
anyone has any tips on how to go about doing so.

For the study I’d like to do, it should be noted that people
will be playing in a multiplayer situation, but I’d like each player to see different things. Therefore, ideally these modifications would be made client side
only!

Here are some of the modifications I’d like to be able to
do:

1.       1. Create a visual effect around a player’s
portrait when their health is low. For example, once a player reaches 20% of
their HP, their portrait turns red.

2.       2. Display an enemy’s health bar above their head
during battle.

3.       3. Create a “halo” or other visual indicator around
the target of an enemy during battle.

4.       4. Provide some visual indicator to others about
the spell that a player is casting.

5.      5.  Alter the “Respawn” screen such that a player can’t respawn
immediately, but rather must wait a set period of time before respawning.

If anyone has any information about the viability of these
changes, or would be willing to talk with me more in-depth about these changes,
please let me know. I’d greatly appreciate it =)




Thanks!




Lindsay Reynolds
               
               

               
            

Legacy_Pearls

  • Full Member
  • ***
  • Posts: 194
  • Karma: +0/-0
Questions about possible modifications?
« Reply #1 on: August 29, 2012, 11:06:02 am »


               1. Possible, player health model iirc
2. Possible probably only through lots of custom models and scripting with getcurrenthp and a fake hp bar
3. Possible, theres models for targeted enemies
4. Possible, modify casting animation
5. Possible, OnRespawn event
               
               

               


                     Modifié par Pearls, 29 août 2012 - 10:06 .
                     
                  


            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Questions about possible modifications?
« Reply #2 on: August 29, 2012, 02:11:03 pm »


               Some elaboration

1.       1. Create a visual effect around a player’s
portrait when their health is low. For example, once a player reaches 20% of
their HP, their portrait turns red.

1. Possible, player health model iirc

2.       2. Display an enemy’s health bar above their head
during battle.

2. Possible probably only through lots of custom models and scripting with getcurrenthp and a fake hp bar

3.       3. Create a “halo” or other visual indicator around
the target of an enemy during battle.

3. Possible, theres models for targeted enemies

The problem here, is that in nwn, npc's dont exactly target players and then direct all actions at that target. Sure.. Players can be the target of events, of actions and spells etc, but they are not designated as being the Active target, they are just used as the target for the current action. The Next action that is carried out, could be done on a different target. As such, I dont think you can accurately get the target that the creature is currently trying to attack or target.

GetAttemptedAttackTarget
Determines the last creature that an attempted attack was made on.
The last creature, may not necessarilly be the current creature - depending on how you are calling this script.
Eg - If you call this on a Heartbeat script, then there is 6-7 seconds between each heartbeat, and this gives plenty of time for the target to have changed.
If you are dead set on having a halo - there are halo visual effects in CEP2.3/4
Open up your CEP2.3 / CEP2.4 top hak, and extract the visualeffects.2da - there are halos further down in the list. Apply them to whatever creature you need, in the appropriate event.


4.       4. Provide some visual indicator to others about
the spell that a player is casting.
4. Possible, modify casting animation

You can also investigate using nwnx_funcs : It grants the ability to fire visual effects for one player, but not for others.
Using this, you could have a mage preparing to cast a spell, and then his opponents (if they are mages) could see a visual cue, that everyone else cannot see. I use this in my server in a customized detect mode, it makes sparkly visual effects appear around points of interest, but other players cannot see it.


5.      5.  Alter the “Respawn” screen such that a player can’t respawn
immediately, but rather must wait a set period of time before respawning.
5. Possible, OnRespawn event

Some servers do this, to force people to respawn, but you kinda want the inverse of it.
The onDeath event of your server, is what brings up the death panel I believe.
You can customize it, to bring it up, on a delay of X seconds.
You can also customize the respawn script, so that if you attempt to click the respawn button before the delay has expired, then it wont function, and the panel stays in place.

If you want customized graphics and buttons for the respawn menu, you would need to modify other files, beyond scripts, including but not limited to tlk file modifications etc.


               
               

               
            

Legacy_LindsayReynolds

  • Newbie
  • *
  • Posts: 20
  • Karma: +0/-0
Questions about possible modifications?
« Reply #3 on: August 30, 2012, 01:28:27 am »


               Thanks Pearls! I appreciate the tips. If you don't mind, can I ask a follow up question about #1? I don't actually know where the "player health model" is -- can you point me toward where those files may be located?
               
               

               
            

Legacy_LindsayReynolds

  • Newbie
  • *
  • Posts: 20
  • Karma: +0/-0
Questions about possible modifications?
« Reply #4 on: August 30, 2012, 01:31:16 am »


               Thanks for your detailed elaborations, Baaleos, they were really helpful! Can I ask clarifications about #4? Would that same idea work if the visual effect was for the spells casted by someone else? For example, could I set it up such that Player A is seeing sparkly spell effects for Player B's spells?
               
               

               
            

Legacy_Pearls

  • Full Member
  • ***
  • Posts: 194
  • Karma: +0/-0
Questions about possible modifications?
« Reply #5 on: August 30, 2012, 12:18:56 pm »


               I don't know much about models so I'm going to pm you relevant ui documentation by Rubies in case you were thinking of model changes per computer, but if you wanted a pure script method then as Baaleos said nwnx is a must for client side visual effects and some other things.

edit - nevermind I'll post it here


1. (Credits: Rubies)
ctl_playr_health.mdl

Contains the "red bar" next to the player's portrait, with some awkward positioning data too.

Contains frames of animation (REVERSED) to match the player's current hit points expressed as a percentage - the game automatically loads the correct frame, but the frames themselves can be anything. Note that the GUI only allows one layer of transparency, and some of the transparency appears to be hardcoded - overlaying the health bar at 25% transparency over the portrait resulted in the portrait either being entirely red, or entirely transparent, depending on settings; I concluded that it's incredibly difficult to replicate Baldur's Gate's "portrait HP bar" effect, though due to similar problems with two layers of transparency it appears to be a renderer/engine issue rather than a GUI one.

Additionally, contains frames to express disease and poison (just a colour change).


3. (Credits: Rubies)
gui_hostile, gui_hostileh, gui_hostilel, gui_hostilem, gui_hostiles

These models are placed at a creature's base location when they are the current target in the action queue.

gui_hostile appears to be unused, but the others correspond to "huge", "large", "medium", and "small", and are automatically loaded depending on the creature's size in the appearance.2da. These can be animated, but do not correspond to the creature's animations, and if forced to inherit animations are incredibly crash-happy.


2.
Creatures have an OnDamaged event that can contain anything, using a similar model to ctl_playr_health but contained as multiple models instead of an animated one, you could GetCurrentHP as a percentage and then load the correct model


5.
Almost anything in this can be accomplished with the OnRespawn event which is a standard NWN event in the Module Properties tab of the module.

               
               

               


                     Modifié par Pearls, 30 août 2012 - 11:33 .