Jump to content

SKSE functions won't compile


Recommended Posts

I've been running into a strange issue whenever I try to compile scripts that use SKSE functions: I receive a "________ is not a function or does not exist" error message, despite the fact that SKSE scripts show up in the script manager, and that SKSE-dependent mods run flawlessly in-game.

 

I've opened up the specific script I need at the moment (ActorBase), and everything in there seems to be in order, so it doesn't appear to be a problem with the script itself. It's almost as if the CK is searching the wrong directory for the SKSE scripts when I try to compile.

 

I've tried updating and re-installing SKSE, but that didn't solve anything. I have the most current version of Skyrim. Does anyone out there have any insights into this problem?

 

EDIT: In case it helps, the exact syntax of the (topic script) fragment is:

 

akspeaker.setcombatstyle(JFADCSMeleeFL.GetAt(0) as CombatStyle)

 

The form list has already been declared.

 

The error message reads:

 

c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__0201BB91.psc(9,10): setcombatstyle is not a function or does not exist
Edited by JanusForbeare
Link to comment
Share on other sites

This seems to be an issue of scope.

 

What did you set the script yor are making to extend? I'm not quite sure how Papyrus handles extension and implementation, but from what you copied, there doesn't seem to be anything in your line that tells the compiler what script has the "SetCombatStyle" function. I haven't tried doing what you are trying to do before, but here are a number of things you might try:

 

ActorBase.akspeaker.setcombatstyle(JFADCSMeleeFL.GetAt(0) as CombatStyle)

 

That would be similar to doing something such as Game.GetPlayer().AddItem(someitem) . By putting "ActorBase." you specify where the function is. However, if that doesn't work, you can try putting

 

import ActorBase

 

into the first area of the script. I may be wrong, but I think that that is how Papyrus uses implementation. For example, to use the default Wait() function from the default Utility script, you would have to include:

 

import Utility

Utility.Wait(5)
;pauses the script for 5 seconds

 

Good luck on figuring it out.

Link to comment
Share on other sites

Thank you both for your replies!

 

The script has finally compiled successfully. It still needs to be tested in-game, but I'm feeling hopeful that the problem has been solved. EDIT: Tested and passed with flying colours.

 

I integrated aspects of both of your suggestions into the solution. Basically, I imported ActorBase at the beginning of the root script (since I was working out of a fragment), and replaced the ActorReference property "akspeaker" with an ActorBase property, "Atvir". The working line is now:

 

Atvir.setcombatstyle(JFADCSMeleeFL.GetAt(0) as CombatStyle)

 

Thanks again for your help!

Edited by JanusForbeare
Link to comment
Share on other sites

  • Recently Browsing   0 members

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