okokokok Posted December 20, 2010 Share Posted December 20, 2010 (edited) So, The purpose of the script is so get advanced enchantments on a blade when attacking different things. Also different enchantments whether you play a good or evil character (infamy/fame) Attacking creatures works as it should different effects for fame and infamy works and enchantments go off right, now the problem really lies the attacking NPC's enchantments. I even think i narrowed it down to the if statements, if that helps you, help me at all :P anyway, I'm posting the whole s*** here now i trust assholes won't take credit for someone else's broken work.... so here it is: scn GreatHalbredOfDualismSCRIPT Ref playerRef Ref TargetRef Ref MyRef Ref BoneRef begin ScriptEffectStart if GetPCInfamy >= GetPCFame && TargetRef.GetCreatureType == -1 && TargetRef.GetDead == 1 playerRef.cast GreatCurseSoulExtraction player ;summons lich -- broken last i tested PlayMagicShaderVisuals effectreanimate playsound "SPLConjurationHit" elseif GetPCInfamy >= GetPCFame && TargetRef.GetCreatureType != -1 && getrandompercent >= 90 Set BoneRef to PlaceAtMe SkelBoneThin01 Set MyRef to GetSelf BoneRef.Cast GreatCurseBurden MyRef ;Slow, and damage fatuige -- Works like a charm when i last tested it BoneRef.Disable elseif GetPCInfamy < GetPCFame && TargetRef.GetCreatureType == -1 && TargetRef.GetDead == 1 playerRef.cast GreatGiftHolyFury player PlayMagicShaderVisuals effectrestorehealth ;Speed bonus, and fortify health and a bunch of otherstuff -- doesnt work at all last i tested. playsound "SPLRestorationHit" elseif GetPCInfamy < GetPCFame && TargetRef.GetCreatureType != -1 && getrandompercent >= 80 Set BoneRef to PlaceAtMe SkelBoneThin01 Set MyRef to GetSelf BoneRef.Cast GreatGiftFieryFury MyRef ;Fire damage -- works like a charm last i tested. BoneRef.Disable endif end begin ScriptEffectFinish StopMagicShaderVisuals effectreanimate StopMagicShaderVisuals effectrestorehealth end Help me out. If you can point out the problem GREAT! if you can't.....well suggestions are always welcome! Tyty Edited December 21, 2010 by okokokok Link to comment Share on other sites More sharing options...
Amayakyrol Posted December 21, 2010 Share Posted December 21, 2010 Why not write a script that switches 2 weapons back and forth instead? You could just use the dawnfang/duskfang one that's in KotN I think. Link to comment Share on other sites More sharing options...
okokokok Posted December 21, 2010 Author Share Posted December 21, 2010 Why not write a script that switches 2 weapons back and forth instead? You could just use the dawnfang/duskfang one that's in KotN I think.shivering isles, but the whole point is different enchantments on a SINGLE sword.what i want to know is why my target isnt being recognized by the script. Link to comment Share on other sites More sharing options...
Maskar Posted December 21, 2010 Share Posted December 21, 2010 First thing I noticed is that you don't seem to set all your references. Link to comment Share on other sites More sharing options...
grmblf Posted December 22, 2010 Share Posted December 22, 2010 (edited) PlayerRef variable isn't assigned to any reference, you're missing a line like "set PlayerRef to player" ps: there's nothing wrong in nesting code, ieif GetPCInfamy >= GetPCFame if TargetRef.GetCreatureType == -1 ;do stuff elseif getrandompercent >= 90 ;do stuff endif else if TargetRef.GetCreatureType == -1 ;do stuff elseif getrandompercent >= 90 ;do stuff endif endif Edited December 22, 2010 by grmblf Link to comment Share on other sites More sharing options...
okokokok Posted December 22, 2010 Author Share Posted December 22, 2010 PlayerRef variable isn't assigned to any reference, you're missing a line like "set PlayerRef to player" ps: there's nothing wrong in nesting code, ieif GetPCInfamy >= GetPCFame if TargetRef.GetCreatureType == -1 ;do stuff elseif getrandompercent >= 90 ;do stuff endif else if TargetRef.GetCreatureType == -1 ;do stuff elseif getrandompercent >= 90 ;do stuff endif endif you can have an "if" within another "if"? Link to comment Share on other sites More sharing options...
Amayakyrol Posted December 22, 2010 Share Posted December 22, 2010 Why not write a script that switches 2 weapons back and forth instead? You could just use the dawnfang/duskfang one that's in KotN I think. Isn't the goal to have a weapon that does X damage if you have more fame and Y damage if you have more infamy? Easiest way to do that is to modify the dawnfang/duskfang script. Link to comment Share on other sites More sharing options...
Deleted1848331User Posted December 22, 2010 Share Posted December 22, 2010 PlayerRef variable isn't assigned to any reference, you're missing a line like "set PlayerRef to player" ps: there's nothing wrong in nesting code, ieif GetPCInfamy >= GetPCFame if TargetRef.GetCreatureType == -1 ;do stuff elseif getrandompercent >= 90 ;do stuff endif else if TargetRef.GetCreatureType == -1 ;do stuff elseif getrandompercent >= 90 ;do stuff endif endif you can have an "if" within another "if"? You can have as many "elseif"s in a script as you want, as long as you have one if before the elseif(s). EX scn Randomness short Target Begin GameMode set target to TargetRef if (Target.GetAv Health <= 90) Target.Kill Elseif (Target.GetAv Health >= 90) Target.MoveToMarker SomeMarkerREF Elseif (Target.GetAV Health <= 180) Target.ResetHealth endif end Just some random example that shouldn't be used ingame for any reason lol And I can think of quite a few ways that are easier than editing the Dusk/Dawnfang script :D Link to comment Share on other sites More sharing options...
okokokok Posted December 22, 2010 Author Share Posted December 22, 2010 Thanks guys, I fixed it now, it now totaly works like it should!! :) Link to comment Share on other sites More sharing options...
Recommended Posts