• 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.

How to put the specific pieces of code, special library on the top of all others?

Status
Not open for further replies.
Level 3
Joined
Mar 27, 2018
Messages
23
Say that we have a library named SuperBasicLib, which I need to put it on top of all other libraries.
(To solve the problem like function foooooooo is not defined)

How to achieve this?

Is there any method that I could change the priority of the library in vJass/Zinc?



(I know that I could add my library into other libraries' require list, but there are plenty of libraries, it's hard to do that, and also hard to maintain.)
 
But you're right that using require is the way to go. It's actually better for maintenance, as you can see if other code is required for your library to work.
You could make like one standard library for your map, which will require all important libraries that are frequently used. And new libs then could only require the standard library.
 
Level 3
Joined
Mar 27, 2018
Messages
23
But you're right that using require is the way to go. It's actually better for maintenance, as you can see if other code is required for your library to work.
You could make like one standard library for your map, which will require all important libraries that are frequently used. And new libs then could only require the standard library.
It's true, but the situation is that there are lots of third part libraries, and my library needs to apply to every one of them.

I want to setup a counter system to record every location, unit, effect, etc..

I want to know how many locations and units on my map, I watch every one of them.
In this case, it's ugly to replace every RemoveLocation or DestroyEffect manually.
I'm trying to put the essential function like LeakCounter_RemoveLocation on the top of all others, and replace every RemoveLocation to LeakCounter_RemoveLocation by a compile tool.
The hard part is the priority of the library, or just put the specific piece on the top of all.
 
Level 3
Joined
Mar 27, 2018
Messages
23
AFAIK directly putting the library in the map’s custom script section gives it slightly elevated priority (over putting it in a blank trigger). Instead of replacing the functions, you may find the the hook keyword to be helpful for you in this endeavor.
Thank you!
 
Status
Not open for further replies.
Top