Aller au contenu

Photo

Implementing Dragon breath


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

#1
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
In the toolset I see special abilities for many types of dragons, but when I give the dragon the special ability, it does not use it.  The one I tested was white.  Do they work?  I know red works but do the others? 

#2
kevL

kevL
  • Members
  • 4 061 messages
I'm guessing it's an AI issue, but that's a guess. (that if the AI doesn't specifically say "use dragon breath, white" it won't)


i'm halfway through workin on this stuff, but got sidetraked,

no ETA sry. I notice there's only 4 basic dragon types in the Toolset (black, blue, bronze, & red) - which means i might be doing a lot of research into Dragons over the next few months ..


or i might just kick back & watch UFO videos ;) What kind of breath does a white dragon have, Cold? If yer up to it, MR, you should use Dann's dragon fixes and if necessary set up a special combat script to use breath weapon ( with a % chance, else Return; & let the default AI attack)


:\\

#3
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
Hey, thanks kevL. That is really useful! By the way, you are correct that a white uses cold. I'll check out Dann's dragon fixes.

#4
kevL

kevL
  • Members
  • 4 061 messages
right on :)

#5
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
I tried putting the scripts and vfx in my mod via hak. The dragon's behavior didn't change. This makes me think I may have to actually tinker with the AI. Have you ever made a dragon breathe white dragon breath? I know that with the default AI, a red dragon will breathe fire.

I saw screenshots on Dann's page of a dragon breathing white breath but I have no idea how he did it.

#6
kevL

kevL
  • Members
  • 4 061 messages
could try this :

On the dragon, put a string variable "X2_SPECIAL_COMBAT_AI_SCRIPT" and give it a value like "ai_dragonbreath_white" <- name of the custom AI script that needs to be written, which goes something like this:

// 'ai_dragonbreath_white'
//
// - script to fire off White Dragon breath weapon.

#include "x0_i0_enemy" // (object)GetNearestPerceivedEnemy


void main()
{
  object oPC = GetNearestPerceivedEnemy();

  if (GetIsObjectValid(oPC)
      // app. range of breath weapon (although Spells.2da says its got Range = Touch ???)
      && GetDistanceBetween(oPC, OBJECT_SELF) < 20.0f)
      // 15% chance
      && d100() < 16)
  {
    location lPC = GetLocation(oPC);

    // #237 Dragon Breath, Cold
    ActionCastSpellAtLocation(SPELLABILITY_DRAGON_BREATH_COLD, lPC, METAMAGIC_NONE, TRUE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE);
  }
}


in Spells.2da, line 237 Dragon_Breath_Cold has impact script "NW_S1_DragCold" (which is a script in Dann's pack) and SPELLABILITY_DRAGON_BREATH_COLD is its 'readable' constant. Nothing strange there. Give the dragon a use of Special Ability, Dragon Breath, Cold and the CastSpell function should fire it off again and again; in fact, since bCheat is set TRUE you don't even have to assign Breath as a Special Ability, at all (in my exp).

if Dann wants to add something to this, i'm hoping he does.

ps. If the conditions are not met, the AI should fall through to a normal DCR AI round ( DetermineCombatRound )



( I really don't want to go digging through 'proper' AI scripts, but you might well have to code up WingBuffets and Tailswipes similar to above, if wanted )


nb. I've actually got this part of Dragons o Doom done, in much much greater detail, but so far it's only good for Red & Blackys. The Ai there will be self-contained, no calls to DCR ( no potion-drinking dragons in other words ), but i feel I have to tidy up the offensive casting section before moving onto the various types. So ... try it, the more nasty dragons the better!

Modifié par kevL, 09 octobre 2011 - 01:38 .


#7
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
Many thanks. I'm going to try this out. I'll let you know how it goes.

#8
Shaughn78

Shaughn78
  • Members
  • 637 messages
Rieder you may want to look at User defined events as well for this. Here is a good link that explains using them. Bouncy Rock Forums

#9
Dann-J

Dann-J
  • Members
  • 3 161 messages
I didn't change any of the AI - I just gave the dragon the cold breath special ability instead of the fire breath. The default AI took care of the rest of it. In my test module, I used three trolls as dragon bait (since anything but a red or black dragon can't kill them).

One thing I've noticed about dragon AI is that they generally don't bother using their breath weapons against creatures that are immune to the damage type. Red dragons won't breath fire against fire elementals, for instance. They often don't seem to use their breath weapons against single opponents either.

#10
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
Okay, I'll try again. I do recall that when I was testing, I had myself warded against energy attacks. Just to clarify that I am giving the dragon the ability properly:

Under special abilities, I select the dragon breath, cold, then give it however many fires I want, correct? Did you change the caster level for the ability or leave it at 0?

#11
Dann-J

Dann-J
  • Members
  • 3 161 messages
The caster level isn't important, since the scripts use the hit dice of the dragon to determine the damage.

I've found that some abilities don't work properly if you try to limit the number of times they're used. All the other dragon blueprints in the game seem to let them use a breath weapon an unlimited number of times. I usually just give the dragon the breath weapon ability, then don't touch any of the default values. That seems to work.

There shouldn't be more than one instance of the special ability in the dragon's ability list though.

Modifié par DannJ, 10 octobre 2011 - 03:24 .


#12
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
I tried going back to the default scripts, but your animation did'nt play and the dragon breath only did 18 hp of damage. I think maybe I installed your scripts improperly.

Here is what I did:

I took the VFX and scripts and put them all into a .hak and then associated that hak with my mod. That seems like it should work. Have I done something wrong?