"CALL" Statement Problem

Post » Thu May 03, 2012 12:34 am

When Im trying to run my mod, i get the following problem:
In console I get the mesage:

Could not extract Function script in Call statement
File: TES3 Refugees.esp Offset: 0x0755 Command: Call

and my code is like this...

ScriptName NPCClassGenerator

......
......

If NPCClass == 1
if NPC.GetItemCount NPCClassWarriorToken == 0
NPC.additem NPCClassWarriorToken 1
endif
if NPC.GetItemCount NPCClassWarriorToken == 1
NPC.SetClass Warrior
endif
call NPCClassWarrior
endif

If NPCClass == 2
if NPC.GetItemCount NPCClassWarlockToken == 0
NPC.additem NPCClassWarlockToken 1
endif
if NPC.GetItemCount NPCClassWarlockToken == 1
NPC.SetClass Warlock
endif
call NPCClassWarlock
endif

If NPCClass == 3
if NPC.GetItemCount NPCClassThiefToken == 0
NPC.additem NPCClassThiefToken 1
endif
if NPC.GetItemCount NPCClassThiefToken == 1
NPC.SetClass Thief
endif
call NPCClassThief
endif

If NPCClass == 4
if NPC.GetItemCount NPCClassSorcererToken == 0
NPC.additem NPCClassSorcererToken 1
endif
if NPC.GetItemCount NPCClassSorcererToken == 1
NPC.SetClass Sorcerer
endif
call NPCClassSorcerer
endif

If NPCClass == 5
if NPC.GetItemCount NPCClassRogueToken == 0
NPC.additem NPCClassRogueToken 1
endif
if NPC.GetItemCount NPCClassRogueToken == 1
NPC.SetClass Rogue
endif
call NPCClassRogue
endif

If NPCClass == 6
if NPC.GetItemCount NPCClassPriestToken == 0
NPC.additem NPCClassPriestToken 1
endif
if NPC.GetItemCount NPCClassPriestToken == 1
NPC.SetClass Priest
endif
call NPCClassPriest
endif

If NPCClass == 7
if NPC.GetItemCount NPCClassNightbladeToken == 0
NPC.additem NPCClassNightbladeToken 1
endif
if NPC.GetItemCount NPCClassNightbladeToken == 1
NPC.SetClass Nightblade
endif
call NPCClassNightblade
endif

If NPCClass == 8
if NPC.GetItemCount NPCClassMageToken == 0
NPC.additem NPCClassMageToken 1
endif
if NPC.GetItemCount NPCClassMageToken == 1
NPC.SetClass Mage
endif
call NPCClassMage
endif

If NPCClass == 9
if NPC.GetItemCount NPCClassKnightToken == 0
NPC.additem NPCClassKnightToken 1
endif
if NPC.GetItemCount NPCClassKnightToken == 1
NPC.SetClass Knight
endif
call NPCClassKnight
endif

If NPCClass == 10
if NPC.GetItemCount NPCClassAcrobatToken == 0
NPC.additem NPCClassAcrobatToken 1
endif
if NPC.GetItemCount NPCClassAcrobatToken == 1
NPC.SetClass Acrobat
endif
call NPCClassAcrobat
endif

If NPCClass == 11

if NPC.GetItemCount NPCClassAssassinToken == 0
NPC.additem NPCClassAssassinToken 1
endif
if NPC.GetItemCount NPCClassAssassinToken == 1
NPC.SetClass Assassin
endif
call NPCClassAssassin
endif

If NPCClass == 12
if NPC.GetItemCount NPCClassBarbarianToken == 0
NPC.additem NPCClassBarbarianToken 1
endif
if NPC.GetItemCount NPCClassBarbarianToken == 1
NPC.SetClass Barbarian
endif
call NPCClassBarbarian
endif

If NPCClass == 13
if NPC.GetItemCount NPCClassBardToken == 0
NPC.additem NPCClassBardToken 1
endif
if NPC.GetItemCount NPCClassBardToken == 1
NPC.SetClass Bard
endif
call NPCClassBard
endif

If NPCClass == 14
if NPC.GetItemCount NPCClassBardToken == 0
NPC.additem NPCClassMonkToken 1
endif
if NPC.GetItemCount NPCClassBardToken == 1
NPC.SetClass Monk
endif
call NPCClassMonk
endif

Call NPCBirthsign
End

........
........
User avatar
Colton Idonthavealastna
 
Posts: 3337
Joined: Sun Sep 30, 2007 2:13 am

Post » Thu May 03, 2012 3:05 am

I found it...
My OBSE had problems and i had to replace it.
User avatar
Kelly Osbourne Kelly
 
Posts: 3426
Joined: Sun Nov 05, 2006 6:56 pm

Post » Thu May 03, 2012 9:46 am

It can also happen in a couple of other instances. Keep in mind my examples come from experience with shadeMe's CSE, so if you're using the vanilla CS you probably won't ever experience the second case (educated guess).

  • A function script that is being called from the script raising the error has been removed and added back in. When this is the case, the called function script's FormID is different from what was compiled into the calling script, despite the fact that the scriptname in the calling script's code is correct. All you need to do in this case is recompile the script. In the CSE, making and removing any kind of change will allow you to do it. Vanilla CS might just let you recompile by hitting the save button.
  • The calling script is compiled with the desired scriptname, but the actual scriptname is different (typo, perhaps). The CSE will sometimes let you get away with this with a rap on the knuckles and a warning that the scriptname is being interpreted as a string var. Changing the target function script's scriptname to match the scriptname used by the calling script won't help because the calling script was never compiled correctly. Recompiling here will also correct the problem.

[Unsolicited scripting advice removed]
User avatar
Shae Munro
 
Posts: 3443
Joined: Fri Feb 23, 2007 11:32 am

Post » Thu May 03, 2012 1:13 am

It can also happen in a couple of other instances. Keep in mind my examples come from experience with shadeMe's CSE, so if you're using the vanilla CS you probably won't ever experience the second case (educated guess).

  • A function script that is being called from the script raising the error has been removed and added back in. When this is the case, the called function script's FormID is different from what was compiled into the calling script, despite the fact that the scriptname in the calling script's code is correct. All you need to do in this case is recompile the script. In the CSE, making and removing any kind of change will allow you to do it. Vanilla CS might just let you recompile by hitting the save button.
  • The calling script is compiled with the desired scriptname, but the actual scriptname is different (typo, perhaps). The CSE will sometimes let you get away with this with a rap on the knuckles and a warning that the scriptname is being interpreted as a string var. Changing the target function script's scriptname to match the scriptname used by the calling script won't help because the calling script was never compiled correctly. Recompiling here will also correct the problem.

[Unsolicited scripting advice removed]


Thanks for that, mate!
User avatar
Bigze Stacks
 
Posts: 3309
Joined: Sun May 20, 2007 5:07 pm


Return to IV - Oblivion