TheXXI Posted April 9 Share Posted April 9 I have a script with fragments of the quest stages, and I'm adding a function enableObjectsAtFirstStop. Scriptname QF_TXXI_DC_CarriageQuest_02002DAF Extends Quest Hidden Function enableObjectsAtFirstStop() ;some code EndFunction ;BEGIN FRAGMENT Fragment_2 Function Fragment_2() ;BEGIN CODE enableObjectsAtFirstStop() ;END CODE EndFunction ;END FRAGMENT ;BEGIN FRAGMENT Fragment_0 Function Fragment_0() ;BEGIN CODE SetStage(10) ;END CODE EndFunction If you try to compile the script from the quest scripts section, the script compiles successfully. But if I open the code of a specific stage of the quest and try to compile the code from there, I get an error: enableObjectsAtFirstStop is not a function or does not exist How do I access this feature? (I've done this several times before, but I don't understand the principle of operation) Link to comment Share on other sites More sharing options...
dylbill Posted April 9 Share Posted April 9 Fragments are a special case. If you want separate functions you have to put them in a separate script. You can attach another script to the same quest then do: (GetOwningQuest() as YourScriptName).EnableObjectsAtFirstStop() 1 Link to comment Share on other sites More sharing options...
scorrp10 Posted April 9 Share Posted April 9 Indeed, it is generally best to put any non-fragment code in an additional script. That said, you could: Put the extra function(s) at the very end of the fragments script, and In the fragment, use Self.EnableObjectsAtFirstStop() 1 Link to comment Share on other sites More sharing options...
Recommended Posts