Aller au contenu

Photo

Spawn multiple arrows


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

#1
MachinSin

MachinSin
  • Members
  • 35 messages
   Hi to all,

   Lately I'm trying to introduce in our server a talent to shoot multiple arrows at the same target. For the attack/damage mechanics I have no problem, but for the visual projectiles I don't see the light :)

   I'm using

  
    SpawnItemProjectile(oPC, OBJECT_INVALID, lPC, lTarget, BASE_ITEM_LONGBOW,
    PROJECTILE_PATH_TYPE_DEFAULT, OVERRIDE_ATTACK_RESULT_HIT_SUCCESSFUL, DAMAGE_TYPE_ELECTRICAL);  
    DelayCommand(0.2, SpawnItemProjectile(oPC, OBJECT_INVALID, lPC, lTarget, BASE_ITEM_LONGBOW,
    PROJECTILE_PATH_TYPE_DEFAULT, OVERRIDE_ATTACK_RESULT_HIT_SUCCESSFUL, DAMAGE_TYPE_ELECTRICAL));  
    DelayCommand(0.4, SpawnItemProjectile (oPC, OBJECT_INVALID, lPC, lTarget, BASE_ITEM_LONGBOW,
    PROJECTILE_PATH_TYPE_DEFAULT, OVERRIDE_ATTACK_RESULT_HIT_SUCCESSFUL, DAMAGE_TYPE_ELECTRICAL));  

   been oPC the character, lPC its location an lTarget the location of the target creature, but it does not spawn the projectiles. I have also tried assigning it as an action to the PC, but it does not help, no projectile is shown.

   Someone has tried something similar or has an idea of what can be wrong? Thank you in advance,

   MachinSin

#2
dethia

dethia
  • Members
  • 146 messages
Here's an example of me using multiple projectile spells:

while(iSkillMod1 + 1 > 0)
	{
		float	fDmg	= d4(1 + iSkillMod2)*DTDamageModifier(oCaster, oTarget);
		effect	eDamage	= EffectDamage(FloatToInt(fDmg), DAMAGE_TYPE_FIRE, 0, FALSE);
		DelayCommand(0.3f + fDelay, SpawnSpellProjectile(oCaster, oTarget, GetLocation(oCaster),
					GetLocation(oTarget), SPELL_FLAME_ARROW, PROJECTILE_PATH_TYPE_BALLISTIC));
		DelayCommand(0.6f + fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget));
		fDelay	+= 0.5;
		iSkillMod1--;
	}

Modifié par dethia, 27 juillet 2011 - 05:40 .


#3
luna_hawke

luna_hawke
  • Members
  • 88 messages
This works in our module. It will launch 1 arrow.
It seems where I have oTarget, you have OBJECT_INVALID.
Maybe that is the issue?
oTarget is the creature or object the arrows should hit.

I do recall this took me a while to get working to.
Way longer than it should have.
Basically I had a lot of problems with it as well.


SpawnItemProjectile( OBJECT_SELF, oTarget, lSourceLoc, lTarget, BASE_ITEM_LONGBOW, PROJECTILE_PATH_TYPE_HOMING, OVERRIDE_ATTACK_RESULT_MISS, DAMAGE_TYPE_COLD );

#4
MachinSin

MachinSin
  • Members
  • 35 messages
Hi to both,

Sorry for the delay answering: I was on holidays last month, both from work and NWN2 :P

Thank you very much for the input, it has helped me figuring out the problem. For your interest, main issue here is that this was not working when the character was activating one inventory object (I tend to test my stuff that way usually :)): you must create a spell for it to work.

MachinSin