So I decided to dust off an old mod of mine from back in 1.68 and update it for 1.69. Low and behold my spell scripts won't compile due to this error:
PM: Error. 'nw_s0_acidarrow' did not compile.
x3_inc_string.nss(75): ERROR: FUNCTION IMPLEMENTATION AND DEFINTITION DIFFER
looking at x3 I see the line 75 the error mentions:
string StringReplace(string sSource, string sFind, string sReplace);
I'm afraid I was never great at scripting even at the height of my nwn days and I'm even worse now that what little i did know is covered in cobwebs in my head '>
here's a copy of the example spell script:
//::///////////////////////////////////////////////
//:: Melf's Acid Arrow
//:: MelfsAcidArrow.nss
//:: Copyright (c) 2000 Bioware Corp.
//:://////////////////////////////////////////////
/*
An acidic arrow springs from the caster's hands
and does 3d6 acid damage to the target. For
every 3 levels the caster has the target takes an
additional 1d6 per round.
*/
/////////////////////////////////////////////////////////
//:://////////////////////////////////////////////
//:: Created By: Aidan Scanlan
//:: Created On: 01/09/01
//:://////////////////////////////////////////////
//:: Rewritten: Georg Zoeller, Oct 29, 2003
//:: Now uses VFX to track its own duration, cutting
//:: down the impact on the CPU to 1/6th
//:://////////////////////////////////////////////
//:://////////////////////////////////////////////
//:: Added: by psychospaz
//:: Now uses sneak attack system as well
//:://////////////////////////////////////////////
#include "X0_I0_SPELLS"
#include "x2_inc_spellhook"
#include "x2_i0_spells"
#include "spell_sneak_inc"
float ARROW_TIME_DELAY = 6.0f;
void RunImpact(object oTarget, object oCaster, int nMetaMagic, float nTimeLeft);
void main()
{
object oTarget = GetSpellTargetObject();
//--------------------------------------------------------------------------
// Spellcast Hook Code
// Added 2003-06-20 by Georg
// If you want to make changes to all spells, check x2_inc_spellhook.nss to
// find out more
//--------------------------------------------------------------------------
if (!X2PreSpellCastCode())
{
return;
}
// End of Spell Cast Hook
//--------------------------------------------------------------------------
// This spell no longer stacks. If there is one of that type, thats ok
//--------------------------------------------------------------------------
/*
if (GetHasSpellEffect(GetSpellId(),oTarget))
{
FloatingTextStrRefOnCreature(100775,OBJECT_SELF,FALSE);
return;
}
*/
//--------------------------------------------------------------------------
// Calculate the duration
//--------------------------------------------------------------------------
int nMetaMagic = GetMetaMagicFeat();
int nDuration = (GetCasterLevel(OBJECT_SELF)/3);
if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration * 2;
}
if (nDuration < 1)
{
nDuration = 1;
}
//--------------------------------------------------------------------------
// Setup VFX
//--------------------------------------------------------------------------
effect eVis = EffectVisualEffect(VFX_IMP_ACID_L);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eArrow = EffectVisualEffect(245);
//--------------------------------------------------------------------------
// Set the VFX to be non dispelable, because the acid is not magic
//--------------------------------------------------------------------------
eDur = ExtraordinaryEffect(eDur);
// * Dec 2003- added the reaction check back i
if (GetIsReactionTypeFriendly(oTarget) == FALSE)
{
int nSneakBonus = getSneakDamageRanged(OBJECT_SELF, oTarget);
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId()));
float fDist = GetDistanceToObject(oTarget);
float fDelay = (fDist/25.0);
if(!MyResistSpell(OBJECT_SELF, oTarget))
{
//----------------------------------------------------------------------
// Do the initial 3d6 points of damage
//----------------------------------------------------------------------
int nDamage = MaximizeOrEmpower(6,3,nMetaMagic);
effect eDam = EffectDamage(nDamage+nSneakBonus, DAMAGE_TYPE_ACID);
DelayCommand(fDelay,ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay,ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
float nSpellTime = RoundsToSeconds(nDuration);
//----------------------------------------------------------------------
// Apply the VFX that is used to track the spells duration
//----------------------------------------------------------------------
DelayCommand(fDelay,ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eDur,oTarget, nSpellTime));
object oSelf = OBJECT_SELF; // because OBJECT_SELF is a function
//start recursive
float nRandomDelay = IntToFloat(Random(9))*0.25;
DelayCommand(ARROW_TIME_DELAY+fDelay+nRandomDelay,
RunImpact(oTarget, oSelf,nMetaMagic, nSpellTime) );
}
else
{
//----------------------------------------------------------------------
// Indicate Failure
//----------------------------------------------------------------------
effect eSmoke = EffectVisualEffect(VFX_IMP_REFLEX_SAVE_THROW_USE);
DelayCommand(fDelay+0.1f,ApplyEffectToObject(DURATION_TYPE_INSTANT,eSmoke,oTarget));
}
}
ApplyEffectToObject(DURATION_TYPE_INSTANT, eArrow, oTarget);
}
void RunImpact(object oTarget, object oCaster, int nMetaMagic, float nTimeLeft)
{
//Spell Expired
if (!GetHasSpellEffect(SPELL_MELFS_ACID_ARROW, oTarget))
return;
//expired even if other arrows have hit
if (nTimeLeft<=0.0)
return;
if (GetIsDead(oTarget) == FALSE)
{
//----------------------------------------------------------------------
// Calculate Damage
//----------------------------------------------------------------------
int nDamage = MaximizeOrEmpower(6,1,nMetaMagic);
effect eDam = EffectDamage(nDamage, DAMAGE_TYPE_ACID);
effect eVis = EffectVisualEffect(VFX_IMP_ACID_S);
eDam = EffectLinkEffects(eVis,eDam); // flare up
ApplyEffectToObject (DURATION_TYPE_INSTANT,eDam,oTarget);
DelayCommand(ARROW_TIME_DELAY ,RunImpact(oTarget,oCaster,nMetaMagic, nTimeLeft-ARROW_TIME_DELAY));
}
}
I tried commenting out the includes one by one but that didn't help and I got the same error until I commented out the spellhook inc which gave a different error.
I know that more info is probably needed for anyone to give me input on how to go about tracking down the cause of the error but if anyone can give me any sort of insight as to where to look I'd be grateful. Thanks in advance!