HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

import an external library on the top of the war3map.j of a map ?

07-28-2008, 10:29 AM#1
Troll-Brain
I have read the GrimexManual.html but i still don't figure how to do that.
Is it possible ?

There is a kind of library that i should always use :

Collapse JASS:
library CommonFunctions initializer Init

    globals
        boolexpr B_TRUE
    endglobals
    
    function B2S takes boolean b returns string
        if b then
            return "true"
        endif
        return "false"
    endfunction
    
    private function FuncTrue takes nothing returns boolean
        return true
    endfunction
    
    public function Init takes nothing returns nothing
        set B_TRUE= Condition(function FuncTrue)
    endfunction
    
endlibrary

Maybe because of the globals and the initializer, i must use needs for the other library even if it's possible to export a .j file to write in on the top of the warmap.j

But it would be great if i could without that.
07-28-2008, 01:39 PM#2
Vexorian
You've been reading the wrong manual.
07-28-2008, 01:52 PM#3
Troll-Brain
Could you tell me more that this simple sentence ?
07-28-2008, 02:33 PM#4
Captain Griffen
vJASS manual.
07-28-2008, 02:51 PM#5
moyack
Add to the other libraries the requires keyword:

Collapse JASS:
library foo requires CommonFunctions
   // yer stuff....
endlibrary

In this way vJASS will sort the libraries properly
07-28-2008, 03:00 PM#6
Troll-Brain
Hmm you didn't understood me.
I said that i know the word "needs" which is equal to "requires".
But i will use this library in all my maps, and i don't need to see the functions, because i know them.
It would be fine if i can add on the top of the script this library without add needs to all other libraries ...
07-30-2008, 01:26 PM#7
Troll-Brain
I used the command //! import "scriptfile" but the library is added the last in the script.
So i will use the attributes needs in all other libraries ...
08-01-2008, 07:24 PM#8
Troll-Brain
If i use the jasshelper default folder (and yes i know how to change it in the jasshelper.conf), then i need only to use the relative path.
It's short and fast, but can i edit a file in the JNGP to import it automatically when i save a map ?