• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[vJASS] Library nesting isn't allowed...

Status
Not open for further replies.
Level 19
Joined
Oct 12, 2007
Messages
1,821
Hey there.

For some reason I can't save my map properly and I was wondering how I should deal with the problem I have.

I got 3 systems that have to cooperate together.

1) library QuestSystem
2) library QuestItemSystem initializer init requires QuestSystem
3) library DropSystem requires HandleData

(HandleData isn't important at the moment)

Alright this is how they work together:

In DropSystem there's a line that directs to a function I wrote in QuestItemSystem. In QuestItemSystem there are some lines that direct to a function in QuestSystem.
QuestSystem and Dropsystem have been in my map for very long already. Now I just added a function to it which is in the QuestItemSystem.

I'm getting an error saying 'Library nesting isn't allowed'.

I tried changing the QuestItemSystem to a scope, but then it doesn't recognize some actions anymore.

So what should I do?
 
What line does the syntax checker highlight with the error?

'Nested' typically refers to something being placed within another thing. So in your case, it would be doing something like:
JASS:
library A

    library B

    endlibrary

endlibrary

Which is not allowed. Make sure you haven't accidentally typed two library declarations (sometimes happens when you have big comment blocks) or that you don't have two endlibrary keywords written.

Otherwise, post the code with the error or a screenshot of the error.
 
Level 19
Joined
Oct 12, 2007
Messages
1,821
EDIT: Wait it's still not working!

Here are some smaller versions of the systems to only show the important stuff:

JASS:
library QuestSystem

globals
blablabla
endglobals

///Functions in this system look like this:///

function IsPlayerOnQuest takes unit u, integer questid returns boolean
endfunction

function IsQuestReqComplete takes unit u, integer questid returns boolean
endfunction

endlibrary

JASS:
library QuestItemSystem initializer init

globals
blabla
endglobals

function QuestItemCheck takes player p, integer ItemId returns nothing

///somewere in this function///
if IsPlayerOnQuest(u, int) then
do something
endif
endfunction

private function init takes nothing returns nothing

/// here I just set some values of globals. nothing interesting///

endfunction
endlibrary

JASS:
library DropSystem requires HandleData

struct 

static method itemPickUp takes nothing returns nothing

///somewere in the method///
call QuestItemCheck(GetOwningPlayer(u), GetItemTypeId(GetManipulatedItem()))
endmethod

endstruct
endlibrary


The error I'm getting right now is "Undeclared function 'IsPlayerOnQuest'" so for some reason the QuestItemSystem doesnt want to cooperate with the QuestSystem...
 
Last edited by a moderator:
Level 19
Joined
Oct 12, 2007
Messages
1,821
JASS:
library QuestItemSystem initializer init requires QuestSystem

    //blah blah

endlibrary

Tried that but it gave me nearly the same error.
Guess tiredness made me think it was exactly the same.
This time the error was about the QuestItemCheck function.
So I added a requirement to the dropsystem too and now it saved properly.

Thanks for pointing out my stupid mistakes... lol
 
Status
Not open for further replies.
Top