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

Same name library causing error

Status
Not open for further replies.
Level 13
Joined
Aug 19, 2014
Messages
1,111
Hello guys Ive encounter another error here because I got two ''Table'' libraries in my map. One is from Vexorian and the other is from Bribe, is there way to fix the error without deleting one of the libraries?
 
Level 13
Joined
Aug 19, 2014
Messages
1,111
Hello once again guys, I already copied the TableBC library and replace Bribes Tale with Vexorians. However it gave me this error Pic. 1.jpg
 
Level 13
Joined
Aug 19, 2014
Messages
1,111
Yeah I have spells that uses Cohadars Jasshelper, I tried renaming Vexorians Table library in to Table copy or other names. But there's still an error occur something like Damagetype requires Table. It looks like renaming the Table library causes other libraries not to locate the required library once I renamed it. I had spells that needed Bribes Table and I just currently add Vexorians Table to copy the Orianna Spell pack on my map, Daffa told me to add the TableBC and replace Bribes Table with Vexorians Table instead, the Damagetype library by Cokemonkey didn't error now because I had done what Daffa said. However the SpellEffectEvent errors. I'm guessing maybe theres a function in that library that really needed Bribes Table?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,286
This is a name space collision. You need to remove one of the libraries and revise all code that referenced it to either reference the kept library or to reference a new differently named library (even if it was the removed library just renamed).

This is what happens if people write code without a good structure. Vexorian being slightly egocentric (in a good way) and the author of vJASS thought that only 1 table system, his, would be sufficient for everyone to use which is why it was named "Table" (the Table library). People like Bribe invented other alternative "Table" libraries for various reasons (maybe they thought they could do it better, or maybe they just designed one for their own purposes) which were also publically released. The reality is that doing this caused a massive name space collision since the interfaces used are different between the two tables.

If anything you should replace Vexorian's Table with Bribe's Tabe since as far as I know he wrote his long after Vexorian lost interest in WC3. Hopefully he would have the same methods as Vexorian with extra methods added (interface extension) otherwise there is no other way than to modify code. This is why interfaces are important and need to be standardized, if they share similar interfaces Bribe's should easily replace Vexorian without any code modification.

Depending on implementation, one could modify either Bribe's or Vexorian's to add the missing methods, possibly in the form of adapters. This may or may not be easy to do. The other way is to modify the code referencing methods from the removed system (either Vexorian or Bribe Table) to reference methods in the system you have.

This would never have happened if Vexorian or Bribe named their libraries less laconic. For example Vexorian could have named his VTable (Vexorian Table) and Bribe named his BTable (Bribe Table). In that case both could have co-existed in the same map and never interfered with each other's name space and map makers like you would not have to deal with a name space collision error. This however brings other problems which is why standard interfaces are recommended.
 
Level 13
Joined
Aug 19, 2014
Messages
1,111
I guess I won't be using some spells that uses Vex table as I had already been using a lot of spells that uses Bribes table. Anyway tnx for the info Doc, you really provide such good information.
 
Status
Not open for further replies.
Top