Author Topic: Climbing combat  (Read 328 times)

Legacy_Sarcose

  • Newbie
  • *
  • Posts: 34
  • Karma: +0/-0
Climbing combat
« on: February 24, 2012, 01:05:05 am »


               Hi, me again with another question pertaining to combat functions I probably can't script for.

Let's say I have a climbing system - any kind of climbing system that allows a player to go from point A to point B by making checks will do. Now let's say I would like to change the way the checks are handled visually by adding delays to account for the amount of combat rounds it would take to get from point A to point B. I know I could disable player movement using whatever available cinematic commands, I could use waits or something to create the pauses. All that's stuff I could easily look up on nwnlexicon when it comes time to script it.

But what I'd like to do is change the way combat would be handled while this particular set of actions is going on. Without adding anything and just using the wait system, assuming the PC stays right where he initiated the climb and we "pretend" the climb is happening (in other words, click "climb", player stays put and it says "climbing... 10 feet climbed... 20 feet climbed..." etc.), NPCs will be able to attack the player. I like this concept because it lets me play with all kinds of ways to interrupt the climbing, cause the player to fall down, etc.. However what I'd like to do is essentially disable melee attacking during this time, and furthermore, disable attacks of opportunity reprisals from the PC.

Now from my previous thread about Attacks of Opportunity, I understand that combat is all hardcoded, and I therefore cannot disable anything directly. I need to use some kind of trick.

My most immediate thought is to 1) prevent player from climbing while melee engaged (to avoid having to deal with the enemy NPCs being in melee range in the first place) and 2) use ActionEquipMostDamagingRanged(oPC) on all enemies nearby. However it occurs to me that doing this would only work for the initial combat rounds during which the ranged attack is used, and if at any time the foe's attention is grabbed and it would happen to prefer a melee attack, it could easily revert to attacking the PC.

Other than overriding the combat system altogether by jumping the player and enemies to another room and handling it all with a complicated series of cinematic scripting and custom checks, or perhaps placing an invisible barrier placeable between oPC and his enemies upon initiating the climb (which has a high chance of glitching in my estimation given the way locations and creating objects works), I am positively stumped as to what I could do that is simple and elegant. I suppose I might be able to create a trigger on the pallete and then spawn it in x/y location relative to the PC that would have an OnEnter script which affects targetting AI and how it's handled. If that's the best option I would need some tips on how to do this.

I appreciate everyone's help, as usual. Feel free to tell me what I'm trying to do is impossible.
               
               

               


                     Modifié par Sarcose, 24 février 2012 - 01:09 .
                     
                  


            

Legacy_Sarcose

  • Newbie
  • *
  • Posts: 34
  • Karma: +0/-0
Climbing combat
« Reply #1 on: February 24, 2012, 02:45:50 am »


               A real quick addition to the thought processes: if there were a way of continuously setting the PC as flatfooted - taking him out of combat over and over, would this eliminate any attacks of opportunity? I might need to do this anyway come to think of it, to prevent the PC from being able to go into combat mode while climbing.

(let's assume for right now that this particular line of scripting won't involve any NPCs climbing after the PC and any contests of trying to knock each other off that might result)
               
               

               


                     Modifié par Sarcose, 24 février 2012 - 02:46 .
                     
                  


            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Climbing combat
« Reply #2 on: February 24, 2012, 10:32:15 pm »


               

Sarcose wrote...

A real quick addition to the thought processes: if there were a way of continuously setting the PC as flatfooted - taking him out of combat over and over, would this eliminate any attacks of opportunity? I might need to do this anyway come to think of it, to prevent the PC from being able to go into combat mode while climbing.

(let's assume for right now that this particular line of scripting won't involve any NPCs climbing after the PC and any contests of trying to knock each other off that might result)


You might try adding a custom spells.2da line with a climbing animation, user type 1 (to allow AoO), and script running on the side that causes the player to make short "jumps" during the conjuration time, if short enough these jumps will look like continuous movement.
               
               

               
            

Legacy_eeriegeek

  • Jr. Member
  • **
  • Posts: 75
  • Karma: +0/-0
Climbing combat
« Reply #3 on: February 25, 2012, 06:41:25 pm »


               One of the spell mind effects has a behavior kind of what you are looking for, Daze, I think. The PC can move slowly, but is unable to perform combat actions.
               
               

               
            

Legacy_Sarcose

  • Newbie
  • *
  • Posts: 34
  • Karma: +0/-0
Climbing combat
« Reply #4 on: February 28, 2012, 02:39:38 am »


               Alright so, I can use a Daze effect + cutscene immobilize to effectively prevent combat reprisals. Does Daze also interfere with AC however? The ideal situation is as follows:

1) PC is flatfooted and unable to take turns in combat or click places to move, affecting said combat only by his flatfooted AC - Daze interferes with combat animations, and I can use the cutscene immobilizing function for movement disabling. I can imagine that Daze also affects the AC, but I'm unsure how - if it simply sets the player to flatfooted, this entire issue is easily solvable.

2) Enemies are able to attack PC with range only, and again, ignore any AC bonuses that being flatfooted would take away, when calculating ranged damage. (If I could script a way to temporarily immunize the PC to melee would the opponents naturally not attack with melee (dunno if the AI reacts to being immune to damage), and furthermore choose ranged, which is not an immune-to damage?)

2a(Optional)) A penalty to ranged to-hit during the climbing function, that would simulate the distance the PC has climbed. I could emulate this as a strict debuff on all ranged opponents but I can just imagine the amount of lag this might cause in large situations. Better to somehow call it from within the combat mechanics themselves -- MAYBE if I could hijack another spell (man, I'm hijacking all kinds of spells for my scripting) that gives a straight ranged dodge buff that is stackable, I could emulate this (but then enemy feats that affect distance fired, and similar things like item properties, would be a pain to work in).


Additionally, on custom animations: continuous movement would be useful, but correct me if I'm wrong that the jump function moves the PC only to valid map locations (observed by myself in part because my first ever module had a really screwy "proto" version of this climbing script which had the PCs going all over the place because I tried to simulate ledges with unwalkable placeables), meaning I would not be able to simulate the effect of climbing over a distance that does not have walkable terrain? My entire module in which this is being implemented has climb nodes that pass over nonwalkable terrain, so I'm unsure if this would be possible. If it is, and it is possible to place a PC on a nonwalkable spot, that easily solves my 2a condition, and mostly my 2 condition.

Edit: sorry, I really should have just checked the wiki in the first place:

"Dazed creatures are in a partial state of stupor. They are unable to initiate attacks, cast spells or use skills and feats, but they can flee from combat at a reduced movement rate.  Player characters can also drink potions while dazed."

Not using feats can be a problem unless that just means they don't get active feats (and still have any passive feats that would affect flatfooted AC - really, the only feats I would need. Not sure if NWN even has any but I know the full 3.5 has them), and I still wanna figure out how to flatfoot said PCs during this process.
               
               

               


                     Modifié par Sarcose, 28 février 2012 - 02:41 .