Jump to content

Scripting related


Recommended Posts

Greetings.

 

I'm new to DAO modding, so i will describe my problems as easy understandable as possible: i want to create some custom scripts for my game, using elements from existing mods like Combat Tweaks and Fereldon Stratagems.

 

In the toolset i have created a new module, set it up to extend single player, and set the hierarchy Core Game Resources>Single Player>[Own Module]. I checked out various scrips and edited their content. Then after trying to compile them there's a error message "combat_damage_h.nss - combat_damage_h.nss(260): Unknown state in compiler" for most scripts (talent_singletarget, talent_modal etc.). This refers to:

 

float Combat_Damage_GetTalentBoni(object oAttacker, object oDefender, object oWeapon)
{

//float fBase = 0.0;
float fMod = 1.0;


if (HasAbility(oAttacker, ABILITY_TALENT_SHATTERING_BLOWS))
{
if (IsObjectValid(oDefender))
{
if ( IsUsingMeleeWeapon(oAttacker, oWeapon) && IsMeleeWeapon2Handed(oWeapon))
{
if (GetCreatureAppearanceFlag(oDefender, CORRECT_CONSTRUCT_FLAG)) //denl: fixed flag bug
{
//denl: damage against constructs gain 25% bonus
fMod += SHATTERING_BLOWS_BONUS_DAMAGE_FACTOR_CONSTRUCT;
}
}
}
}

// denl: damage bonus of 5% per enemy engaged for bravery
if (HasAbility(oAttacker, ABILITY_TALENT_BRAVERY))
{
if (IsObjectValid(oDefender))
{
int nEnemies = Max(0,GetArraySize(GetCreaturesInMeleeRing(oAttacker,0.0, 359.99f,TRUE,0))-2);
fMod += IntToFloat(nEnemies) * BRAVERY_DAMAGE_BONUS_FACTOR;
}
}
//own tweaks: powerful swings
if (IsModalAbilityActive(oAttacker, ABILITY_TALENT_POWERFUL_SWINGS))
{
fMod += POWERFUL_SWING_DAMAGE_BONUS;
}
if (IsModalAbilityActive(oAttacker, ABILITY_TALENT_BLOOD_FRENZY))
{
//denl: change scaling to up to 25%
fMod += (BLOOD_FRENZY_DAMAGE_BONUS_FACTOR_MAX * MaxF(0.0,1.0 - _GetRelativeResourceLevel(oAttacker, PROPERTY_DEPLETABLE_HEALTH)));
}
//own tweaks: shield wall damage reduction
if (IsModalAbilityActive(oAttacker, ABILITY_TALENT_SHIELD_WALL))
{
fMod -= SHIELD_WALL_DAMAGE_PENALTY_FACTOR;
}
//own tweaks: converted berserker flat damage bonuses into percentages
if (IsModalAbilityActive(oAttacker, ABILITY_TALENT_BERSERK)) && -----------------------------------> this is the line 260 in question
!HasAbility(oAttacker, ABILITY_TALENT_CONSTRAINT)
{
fMod += CONSTRAINT_DAMAGE_BONUS;
}
else if (IsModalAbilityActive(oAttacker, ABILITY_TALENT_BERSERK)
{
fMod += BERSERK_DAMAGE_BONUS;
}
//own tweaks
return fMod;
}

I tried rewording only the affected line, replacing the whole script with the unaltered fereldon stratagems version or even the completly untouched vanilla script version, in all cases i get the same error message, even if the content of the line is completly changed (due to the different amount of scripts lines in it, line 260 isn't uniform in all script versions), each time it is error in line 260.

Related to that, i don't need to check in edited content again (that would mess with core game resources), right? And when scripts compile they don't read from the packages/core/override folder while compiling or do i need to delete all my mods first (just trying to figure out where the problem comes from)?

 

 

Second problem:

All weapons swing unusually fast, for example ~1s delay even for two-handed weapons. I have a edited APR_base.GDA, but this file just controls the movement speed (among other things), not attack speed, correct? In my custom ItemStats.GDA i set for example greatswords to -0.5 (colum Dspeed). Together with the unaltered vanilla value

 

const float BASE_TIMING_TWO_HANDED = 2.5;

 

in core_h this should result in a delay of 2 seconds. However, that's not what i observe ingame, it's lightning fast. So where else does it get defined?

 

 

Third problem: for those who don't know Fereldon Stratagems, it adds a custom abilty

 

// SWG - To simulate enemies having health potions
case ABILITY_HEALTH_POT:
{
float fHeal = GetCreatureProperty(stEvent.oTarget,7,PROPERTY_VALUE_TOTAL);
eEffect = EffectHeal(fHeal / 3.25f);
eEffect = SetEffectEngineInteger(eEffect, EFFECT_INTEGER_VFX, Ability_GetImpactObjectVfxId(stEvent.nAbility));
ApplyEffectOnObject(EFFECT_DURATION_TYPE_INSTANT, eEffect, stEvent.oTarget, 45.0f, stEvent.oCaster, stEvent.nAbility);

break;
}

However it doesn't seem to work for enemies anymore, the drinking animation plays, but no healing occurs. For testing purposes i gave myself this abilty with a cheat and for my character i does indeed work correctly/heals me. Where does the difference come from??

 

 

To figure out the problems i can provide all the .nss script files etc. if necessary.

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...