I was coding in galaxy + + when I found that I can't include libCamp functions in the editor (I don't know if this is only for me or something the author overlooked). After search a bit on Blizzard libraries, I found that it is possible to override the libNtve completely and erase it from MapScript ((`Source).
My question is if using pure natives is better than using libNtve, libCamp, and libLbty. The latter two, I can't seem to access in Galaxy + + so I'll either have to copy-paste the entire libraries or, as I decided to do, just copy-paste the ones I need and optimize their scripts a bit. No doubt, using libNtve is a lot easier to write and often times easier to read as well. Should I just resort to the natives similar to the WC3 days or use libNtve functions? It makes sense to use the ones that are longer, but it seems like it'd be better to just use the native for ones like pausing units:
What're some of the general habits and strategies you guys have in using natives and the lib functions, and what do you suggest is the best way to go about using these?
libNtve is a GUI library that uses native functions to build other, easier to use stuff.
In the example above you can also see that some functions are surprisingly bad implemented. For example, the unit pause function should much rather look like this:
Even like this it would add additional overhead because of an additional function call.
To get back to your question: There is basically no reason NOT to use the libNtve functions (since eventually they will save you some time), however if the script needs to be optimized id rather try to avoid libNtve and go for natives only.
libNative often preloads a lot of stuff into memory that you'll probably never use. My 2 cents is, if your script doesnt rely much on libntve functions, build your own custom library instead (copy libntve functions you're using if you need to) and omit the libNative call. Problem is the compiler (built-in) always seems to include it by default. Not sure if its the same for galaxy + +. Therefore it may be necessary to override MapScript. galaxy after making the omission with a text editor.
IMO many of the libNtive functions actually have optimization potential.
For some reason, I can't get rid of the libraries from the dependencies. How do I delete them? For the Liberty library, I actually deleted the entire dependency, but it's still there.
I recall it's quite tricky. I recall you need to export MapScript.galaxy, remove the dependency, then import back in and override the MapScript.galaxy. I think it needs to be done with the trigger editor closed, or the trigger editor would just recompile your existing code and re-insert the library. AFAIK, as long as you're using GUI to do your triggers, nativeLib always seems to be injected by default.
I was coding in galaxy + + when I found that I can't include libCamp functions in the editor (I don't know if this is only for me or something the author overlooked). After search a bit on Blizzard libraries, I found that it is possible to override the libNtve completely and erase it from MapScript ((`Source).
My question is if using pure natives is better than using libNtve, libCamp, and libLbty. The latter two, I can't seem to access in Galaxy + + so I'll either have to copy-paste the entire libraries or, as I decided to do, just copy-paste the ones I need and optimize their scripts a bit. No doubt, using libNtve is a lot easier to write and often times easier to read as well. Should I just resort to the natives similar to the WC3 days or use libNtve functions? It makes sense to use the ones that are longer, but it seems like it'd be better to just use the native for ones like pausing units:
What're some of the general habits and strategies you guys have in using natives and the lib functions, and what do you suggest is the best way to go about using these?
Native functions will have the best performance.
libNtve is a GUI library that uses native functions to build other, easier to use stuff.
In the example above you can also see that some functions are surprisingly bad implemented. For example, the unit pause function should much rather look like this:
Even like this it would add additional overhead because of an additional function call.
To get back to your question: There is basically no reason NOT to use the libNtve functions (since eventually they will save you some time), however if the script needs to be optimized id rather try to avoid libNtve and go for natives only.
libNative often preloads a lot of stuff into memory that you'll probably never use. My 2 cents is, if your script doesnt rely much on libntve functions, build your own custom library instead (copy libntve functions you're using if you need to) and omit the libNative call. Problem is the compiler (built-in) always seems to include it by default. Not sure if its the same for galaxy + +. Therefore it may be necessary to override MapScript. galaxy after making the omission with a text editor.
IMO many of the libNtive functions actually have optimization potential.
For some reason, I can't get rid of the libraries from the dependencies. How do I delete them? For the Liberty library, I actually deleted the entire dependency, but it's still there.
@DieHappy1234: Go
I recall it's quite tricky. I recall you need to export MapScript.galaxy, remove the dependency, then import back in and override the MapScript.galaxy. I think it needs to be done with the trigger editor closed, or the trigger editor would just recompile your existing code and re-insert the library. AFAIK, as long as you're using GUI to do your triggers, nativeLib always seems to be injected by default.