![]() |
#16 | |||
User
Official Map Reviewer
Join Date: Jan 2006
Posts: 363
![]() ![]() ![]() |
![]() Quote:
Quote:
Quote:
|
|||
![]() |
![]() |
Sponsored Links - Login to hide this ad! |
|
![]() |
#17 |
User
Join Date: Jan 2007
Posts: 542
![]() ![]() ![]() |
![]() Looks awesome.
__________________Gonna toy a bit around with it. Btw, whatll happen to levelable fields (in abilities)? Edit: Hrm, so this is run before JassHelper, right? Thats gonna cause some problems with the ObjectMerger and GMSI. Maybe generate valid JASS code directly and run this after JH? Last edited by Deaod : 12-01-2009 at 09:35 AM. |
![]() |
![]() |
![]() |
#18 | |
User
Join Date: Jun 2007
Posts: 99
![]() |
![]() Quote:
I guess you are right. I just hate to manually change the agility -> armour if I would like to do a balance change. But maybe your extra work is too much for my little convenience. ;) |
|
![]() |
![]() |
![]() |
#19 | |
requires vJass
Code Moderator
|
![]() Quote:
If you initialize the data within a struct onInit, and you place that struct within the "ExportedUnitData" library, then it will definitely be initialized before any library that requires ExportedUnitData. Last edited by grim001 : 12-01-2009 at 10:36 AM. |
|
![]() |
![]() |
![]() |
#20 | ||
Obscurity, the Art
|
![]() Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#21 | ||||
User
Official Map Reviewer
Join Date: Jan 2006
Posts: 363
![]() ![]() ![]() |
![]() Quote:
Quote:
Quote:
Quote:
Last edited by PurplePoot : 12-01-2009 at 02:33 PM. |
||||
![]() |
![]() |
![]() |
#22 |
Obscurity, the Art
|
![]() Isn't there any way to avoid having to make a library require UnitExportData? It's very lame that it has to do that.
__________________Also, Mr.Malte raised a good point. ![]() local UnitDataStruct up = GetUnitDataStruct(u) call BJDebugMsg(R2S(up.minDamage)) call BJDebugMsg(R2S(up.maxDamage)) call BJDebugMsg(I2S(up.armor)) call BJDebugMsg(R2S(up.attackRate)) call BJDebugMsg(up.model) ![]() call BJDebugMsg(R2S(GetUnitMinDamage(u))) call BJDebugMsg(R2S(GetUnitMaxDamage(u))) call BJDebugMsg(I2S(GetUnitArmor(u))) call BJDebugMsg(R2S(GetUnitAttackRate(u))) call BJDebugMsg(GetUnitModel(u)) |
![]() |
![]() |
![]() |
#23 | |
requires vJass
Code Moderator
|
![]() Quote:
Struct onInits for structs within libraries run in the same order that the libraries compile. As I said, if you put your init stuff within a struct onInit within the ExportedObjectData library, it will definitely be done before any code is executed from any library that requires ExportedObjectData. Also, structs that are not inside any library run their onInit methods after structs inside libraries are done. That means there would be no issues with struct onInits within scopes or outside of any library/scope. It would be even better if you just inserted the initialization call into the Main function before anything else gets done, and made sure the GetUnitType* functions are declared above all libraries. That would let us drop the library requirement. But I'm not sure if that would be easy for you to do. Last edited by grim001 : 12-01-2009 at 03:55 PM. |
|
![]() |
![]() |
![]() |
#24 | |||
Procrastination Incarnate
Development Director
|
![]() Quote:
Libraries using this system should, if at all possible, be able to declare what data they need within themselves, rather than it being specified within oyur library. The clear advantage of this is that users can just copy a library that uses this system into their map and have it working, rather than being required to edit your system's calibration section for each library they import that uses it (or, the lamer alternative, to simply load all data instead of bothering to eliminate that which is not needed from the list). If things are done this way, steps should be taken to ensure you don't get double loading if two libraries require the same value. Not sure what you mean by the -noinit thing, the data should get initialized before it is used automatically, library requirements should ensure that. Quote:
Quote:
|
|||
![]() |
![]() |
![]() |
#25 | ||||||
User
Official Map Reviewer
Join Date: Jan 2006
Posts: 363
![]() ![]() ![]() |
![]() Quote:
I could support the struct method, but I do not see any need to and it's kinda nice to have some form of standardization. Besides, the current method resembles the natives moreso than structs (which allows them to stick out slightly less), and consistency is nice. Finally, people are way too obsessed with OOP; not everything has to be an object! Quote:
Quote:
Quote:
Quote:
PS: It's going to stay as ExportedUnitData. The only reason I changed it from ExportedObjectData is so that you can (if you want) have units/items/etc separate, which may make sense and if nothing else forces some clarity into the library requirements. Quote:
People are way too obsessed with efficiency for the sake of efficiency these days. EDIT: I should also mention that structs would probably be slower than hashtables for this, for both reading and writing. Last edited by PurplePoot : 12-01-2009 at 06:45 PM. |
||||||
![]() |
![]() |
![]() |
#26 | ||
Obscurity, the Art
|
![]() Quote:
![]() //! LoadUnitData [-noinit] [-struct] fld1 fld2 fld3 fld4 fld5 Quote:
![]() library A requires UnitExportData //! LoadUnitData ... endlibrary ![]() library A //! LoadUnitData ... endlibrary Consider for an instance how lame it would be if any library that used ObjectMerger had to do the following: ![]() library A requires ObjectMergerData //! external ObjectMerger ... endlibrary Last edited by Rising_Dusk : 12-01-2009 at 06:33 PM. |
||
![]() |
![]() |
![]() |
#27 | ||
User
Official Map Reviewer
Join Date: Jan 2006
Posts: 363
![]() ![]() ![]() |
![]() Quote:
Quote:
By that argument the requires keyword is lame in general. I could always make it automatically add that to a library's requirements, but I'm not sure whether I want to (again, see clarity). Last edited by PurplePoot : 12-01-2009 at 06:46 PM. |
||
![]() |
![]() |
![]() |
#28 | ||||||
Obscurity, the Art
|
![]() Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
|
||||||
![]() |
![]() |
![]() |
#29 | ||||||
User
Official Map Reviewer
Join Date: Jan 2006
Posts: 363
![]() ![]() ![]() |
![]() Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
![]() globals hashtable hash endglobals struct fields integer damagebase1 //whatever else they requested. These are all set at map init. endstruct struct UnitData static method [] takes integer uid returns fields return LoadInteger(hash,uid,0) endmethod endstruct //or (using fields again)... function UnitData takes integer uid returns fields return LoadInteger(hash,uid,0) endfunction Saving would look similar. |
||||||
![]() |
![]() |
![]() |
#30 | |
Obscurity, the Art
|
![]() Somehow this Mr.Malte character has done the struct method with GMSI and without hashtables here.
__________________Quote:
|
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
|