collinsmith / riiablo

Diablo II remade using Java and LibGDX
http://riiablo.com
Apache License 2.0
884 stars 101 forks source link

Add support for D2S creation (character creation) #37

Open collinsmith opened 5 years ago

collinsmith commented 5 years ago

d4858781c99f3bfd874ce6ff240c666c32314bf6 broke character "creation" because I removed support for creating fake characters. Before, created characters would just create a player entity with the correct character and stub out the stats. All characters now require a D2S whether that be a form of a save file or a stub D2S object. Frankly it's about time character creation was added in properly to at least generate a D2S object.

I don't want to add support for writing an actual D2S file until later when most of the game features work (quests, item drops, etc). People who test this need to use their own existing characters -- I may even upload mine.

collinsmith commented 5 years ago

I added in a workaround for this issue that stubs out a D2S instance and prevents loading from the D2S file since the reference is null. Items are not generated yet, and the starting skills are not set.

collinsmith commented 4 years ago

Another workaround for this issue in https://github.com/collinsmith/riiablo/commit/96823c46b3cfd49d51672ab8efcd4d626e96ab0e and https://github.com/collinsmith/riiablo/commit/0249ca2883edf9b26828a9e095a7780bb91cb521

Second fix actually alleviates some of the problems caused by the first -- transformation and alpha update flags were being set regardless of whether or not they had actually changed -- to the transformation and alpha updater were trying to update layers that didn't exist for those entities. By setting transformation and alpha via the created methods in CofComponent, we can see which layers actually changed.

collinsmith commented 4 years ago

Recent changes (56e6eb480208f901d47d71dd3defca768c4283f7) should allow for closing this issue once it is implemented. Writing the D2S is still unimplemented and required, however CharData should allow for creating a new character and giving them their starter items.