• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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