Hi,
as the title states, i scripted the talent sunder armor to have an an aoe effect. While it seems the aoe works right, the one thing that is not working is my script to make it hit even allies.
I previously did this to Weapon Sweep and it worked. Here is the my script for Weapon Sweep:
case ABILITY_TALENT_WEAPON_SWEEP:
{
// if not the caster
if (oTarget != stEvent.oCaster)
{
// if the target is not dead and is hostile
if ((IsDead(oTarget) == FALSE) || (IsObjectHostile(stEvent.oCaster, oTarget) == TRUE) || (IsObjectHostile(stEvent.oCaster, oTarget) == FALSE))
{
object oWeapon = GetItemInEquipSlot(INVENTORY_SLOT_MAIN, stEvent.oCaster);
// if the attack hits
int nResult = Combat_GetAttackResult(stEvent.oCaster, oTarget, oWeapon, 0.0f, stEvent.nAbility);
if (IsCombatHit(nResult) == TRUE)
{
// normal damage
float fDamage = Combat_Damage_GetAttackDamage(stEvent.oCaster, oTarget, oWeapon, nResult, 0.0, TRUE);
eEffect = EffectImpact((GetLevel(stEvent.oCaster) + fDamage), oWeapon,0,stEvent.nAbility);
Combat_HandleAttackImpact(stEvent.oCaster, oTarget, nResult, eEffect);
{ // physical resistance
if (ResistanceCheck(stEvent.oCaster, oTarget, PROPERTY_ATTRIBUTE_STRENGTH, RESISTANCE_PHYSICAL) == FALSE)
{
eEffect = EffectKnockdown(stEvent.oCaster, 0, stEvent.nAbility);
ApplyEffectOnObject(EFFECT_DURATION_TYPE_TEMPORARY, eEffect, oTarget, RandomFloat(), stEvent.oCaster, stEvent.nAbility);
}
else
{
// knockback effect
effect eKnockdown = Effect(1057); // knockback
eKnockdown = SetEffectEngineFloat(eKnockdown, EFFECT_FLOAT_KNOCKBACK_DISTANCE, 0.5f);
ApplyEffectOnObject(EFFECT_DURATION_TYPE_INSTANT, eKnockdown, oTarget, 0.0f, stEvent.oCaster, stEvent.nAbility);
}
}
}
}
}
break;
}
}
This code works perfectly.
Now here is the Sunder Armor code:
case ABILITY_TALENT_SUNDER_ARMOR:
{
//if not the caster
if (stEvent.oTarget != stEvent.oCaster)
{
//if the target is not dead and is hostile
if ((IsDead(stEvent.oTarget) == FALSE) || (IsObjectHostile(stEvent.oCaster, oTarget) == TRUE) || (IsObjectHostile(stEvent.oCaster, oTarget) == FALSE))
{
object oWeapon = GetItemInEquipSlot(INVENTORY_SLOT_MAIN, stEvent.oCaster);
int nResult = Combat_GetAttackResult(stEvent.oCaster, oTarget, oWeapon, 0.0f, stEvent.nAbility);
if (IsCombatHit(nResult) == TRUE)
{
// normal damage
float fDamage = Combat_Damage_GetAttackDamage(stEvent.oCaster, oTarget, oWeapon, nResult, 0.0, TRUE);
eEffect = EffectImpact((GetLevel(stEvent.oCaster) + fDamage), oWeapon,0,stEvent.nAbility);
Combat_HandleAttackImpact(stEvent.oCaster, oTarget, nResult, eEffect);
if (stEvent.nHit == 2)
{
if (IsObjectHostile(stEvent.oCaster, oTarget) == TRUE)
{
// remove stacking effects
RemoveStackingEffects(stEvent.oTarget, stEvent.oCaster, stEvent.nAbility);
// attack debuff
eEffect = EffectDecreaseProperty(PROPERTY_ATTRIBUTE_ARMOR, (GetLevel(stEvent.oCaster) * -0.5f));
eEffect = SetEffectEngineInteger(eEffect, EFFECT_INTEGER_VFX, Ability_GetImpactObjectVfxId(stEvent.nAbility));
ApplyEffectOnObject(EFFECT_DURATION_TYPE_TEMPORARY, eEffect, stEvent.oTarget, SUNDER_ARMOR_DURATION, stEvent.oCaster, stEvent.nAbility);
}
}
}
}
}
break;
}
I have also changed the aoe type for Sunder Armor in ABI Base to 1(for circle arc), and the aoe parameter to 3 (just like with weapon sweep)
Problem is though, when testing in game, the skill seems to hit the enemies like weapon sweep, but surrounding allies are not effected.
I am stumped on this one because I have specifically stated in my script that the target is both a hostile and non-hostile target. And while the two scripts are similar in that category, only the Sweep does it right.
Is there another sub script I need to change for the effect to occur? or is there something wrong in my script that I am missing?
By the way, through troubleshooting, I moved Sunder Armor from the Single Target script to the Aoe Instant script (and changed the script direction path in ABI Base), but that did not help.
One other unrelated question -
what is the proper code for scripting in your own UI message?
I know that the code is UI_DisplayMessage(stEvent.oTarget, UI_MESSAGE_IMMUNE); (for example)
but say I wanted to script in at the end of Sunder Armor, if the target is affected by the armor penalty, a message like "Armor reduced".
I have tried different ways, even tried the toolset wiki for help, but it does not help much.
Thanks in advanced.
I have changed sunder armor to an aoe, but there is one problem i need help with..
Débuté par
SaraiseinAnngelo
, déc. 23 2009 09:22
#1
Posté 23 décembre 2009 - 09:22
#2
Posté 23 décembre 2009 - 10:16
In your sunder armor code, there is a second
if (IsObjectHostile(stEvent.oCaster, oTarget) == TRUE)
line. Did you notice? Maybe it's simply this? It's right before the armor penalty effect.
I'm also unsure what you're missing about the UI message. You could simply append your message line below the last ApplyEffectOnObject() line, for example.
if (IsObjectHostile(stEvent.oCaster, oTarget) == TRUE)
line. Did you notice? Maybe it's simply this? It's right before the armor penalty effect.
I'm also unsure what you're missing about the UI message. You could simply append your message line below the last ApplyEffectOnObject() line, for example.
#3
Posté 23 décembre 2009 - 11:22
Thanks for the response.
It shouldn't be that line though, or I hope it's not because I want the status effects to fire only on the target.
I remember too that I omitted this line during troubleshooting, still no damage effect on allies.
I actually tried putting the message under the ApplyEffect line, I used UI_DisplayMessage(stEvent.oTarget, UI_MESSAGE_ARMORDOWN);
But I got an variable define error for var_constants_h.nss.
I opened the nss file but I didn't even find any UI Message variables strangely enough.
I even tried a code like the one thats showed when my cursor was over the UI_Message line
(the original highlight code was void UI_DisplayMessage(object otarget, int nMessage, string sParam0= "", int nColor=0)
My main problem is I have no knowledge of Programming, what I have created so far was from learning by examples over the last couple days. I am going to continue to try to learn how to program this. I am a quick learner even when teaching myself, but any help is greatly appreciated though. I think the nMessage probably means which target the message will display over, I'll give that a shot when defining the int.
One thing I have got to say, programming can be a pain, especially when you don't know what you're doing - lots of trial and error.
EDIT: Found the solution to the Sunder Weapon, I gave it the wrong target type in ABI Base.
It shouldn't be that line though, or I hope it's not because I want the status effects to fire only on the target.
I remember too that I omitted this line during troubleshooting, still no damage effect on allies.
I actually tried putting the message under the ApplyEffect line, I used UI_DisplayMessage(stEvent.oTarget, UI_MESSAGE_ARMORDOWN);
But I got an variable define error for var_constants_h.nss.
I opened the nss file but I didn't even find any UI Message variables strangely enough.
I even tried a code like the one thats showed when my cursor was over the UI_Message line
(the original highlight code was void UI_DisplayMessage(object otarget, int nMessage, string sParam0= "", int nColor=0)
My main problem is I have no knowledge of Programming, what I have created so far was from learning by examples over the last couple days. I am going to continue to try to learn how to program this. I am a quick learner even when teaching myself, but any help is greatly appreciated though. I think the nMessage probably means which target the message will display over, I'll give that a shot when defining the int.
One thing I have got to say, programming can be a pain, especially when you don't know what you're doing - lots of trial and error.
EDIT: Found the solution to the Sunder Weapon, I gave it the wrong target type in ABI Base.
Modifié par SaraiseinAnngelo, 23 décembre 2009 - 01:15 .
#4
Posté 23 décembre 2009 - 02:47
I'm glad you found a solution. Unfortunately, I can't help debugging at the moment, no toolset being available to me. For the ui messages, I use DisplayStatusMessage() and DisplayFloatyMessage(). Those are engine functions, one directly in the middle of the screen, the other tied to an object. UI_DisplayMessage() is probably defined in a header file where the constant UI_MESSAGE_ARMORDOWN is defined as well. Did you include such a file like "ui_h" or similar? Just a guess though.





Retour en haut






