Jump to content


Photo

WMP - new area icons


  • Please log in to reply
28 replies to this topic

#1 Lava Del'Vortel

Lava Del'Vortel

    Fiction Enforcer

  • Modder
  • 2299 posts

Posted 14 June 2010 - 02:12 AM

Hi, guys! I have a question. I would like to add new area icon. All existing icons are in one bam file, so I gues I have to add mine to those. Here some questions appears:
- How to do it without overriding whole file with brand new one? (I guest COPY_EXISTING shoud be used here...)
- When the new bam becomes a part of new one how to make universal numer or something for it? In area coding there is a line:
 OUTER_SET mapIcon = 15 	// map icon
so what should be here? If other mods allso added icons then the number would change....
- 3rd question is connected with previous: how does it look with compatibility then?

I'm starting to think that there is no way to make it nice and easy... Is it even possible? Thanks for any help. :cheers:

-Lava

#2 GeN1e

GeN1e

    A very GAR character

  • Modder
  • 1604 posts

Posted 16 June 2010 - 03:10 PM

1) I see no reason why it wouldn't be doable, since BAM's structure is detailed in IESDP, neither does it look overcomplicated (like WMP or ARE).
2) Way easier than the first.

From what I understand (may be wrong), however, your should NOT use custom palette. Use what's in the wmp's BAM. If you have new frame ready, attach or upload it somewhere, I'll give it a shot. Or someone else will, should they want to.

Edited by GeN1e, 16 June 2010 - 03:12 PM.

Retired from modding.


#3 Lava Del'Vortel

Lava Del'Vortel

    Fiction Enforcer

  • Modder
  • 2299 posts

Posted 16 June 2010 - 11:23 PM

I think I understood very little from what you wrote :P However, I'm attaching all the frames (when I took a look at the bam in DLTCEP there were all those versions like gray unavailable, with blue 'cause it wasn't visited yet etc) here.

Well, I thought that if that's impossible to make it easy, then maybe it would be a good idea to make a new mod that would override the old mapicons with new one, but also with more icons that could be used in mods. That would be something like... mode that must be installed before for example Innershade, FFT etc, 'cause it updates a map icons...

(I made those myself so all, excluding innershade.bmp, may have wrong palette of colours...)

Attached File  innershade.zip   44.15K   220 downloads

#4 GeN1e

GeN1e

    A very GAR character

  • Modder
  • 1604 posts

Posted 18 June 2010 - 08:32 AM

The first thing I did was to try and convert them into bams naturally, so I've re-saved as a gif and loaded the BAMWorkshop. Palette was most different, I've applied mapicons's one - heap of pixels scattered at random. Tried to export mapicons.bam into bmp - resulted in different palette (???). Well, dunno what else to try. Went to PPG modlist, found a link to BAMWorkshop 2. DLed it, seems to be more functional, great. Out of curiosity, have tried to have it load the ACT palette file I've extracted in Photoshop several minutes ago. Whoah, CTD! Whatever, I'll try again. Why it doesn't load??? Seems the window is glitching, close it and re-open, Start->My Computer, wtf it's talking about, something about drive Z instead of opening, realod all (had I had some sense left in me head I'd at least read what it was saying *sigh*). Now, where all user accounts would be residing??? To make it worse, I can't get into internet and find out about what happened, neither do I know it myself. Then again, it's been two years already since I've re-installed OS, so let's proceed with it. Works, good. Now, off to internets. I can swear I've setup the connection right, then why half the links from 'bookmark' aren't working? Could it have been I've caught a nasty virus, that's killing my stuff after OS re-install and I have no means of stopping, because my AV is quite outdated and all AV links not working? T'is real bad, I go to ISP forum and discover I can't post because it needs registration, and I can't register as it needs mail verification, something I can't pull off with my mailbox service unaccessible. And it's already too late, 1 AM, to call phone. I turn everything off and go sleep, wondering wtf's been happening all the evening.

Morning. All sites open fine, I go check ISP's forum, it's full of 'not working!' posts, from the late night and early morning :D
Nonetheless, been a fun adventure, I think you should change your title to Mysterious Wizard :D

may have wrong palette of colours..

And that's the main problem, since as I've said a BAM can have only one palette, and WMP can have only one BAM. I tried to fix it without re-drawing, but failed, seems to be impossible. Sorry. Unless someone knows it better, the only way is to draw using MAPICONS's palette.

Retired from modding.


#5 Lava Del'Vortel

Lava Del'Vortel

    Fiction Enforcer

  • Modder
  • 2299 posts

Posted 18 June 2010 - 10:59 AM

Thanks for trying GeN1e :cheers:
Kwiat_W made for me a file that may override exsiting mapicons.bam. That will be incompatibile with some other mods... I just added that possibility as a 3rd option of "Add Innershade to Worldmap" component. Well, if someone plays without megainstalls, then it should be fine.

I was wondering... maybe it should be like that with other mods too... it would work with FFT, however when a mod is released the mod that has this component too must be updated as well to avoid problems like "duplication of map icon nr 29" etc.

Nonetheless, been a fun adventure, I think you should change your title to Mysterious Wizard :D

I have no doubts that it was fun :P Yeah... Mysterious Wizard... hehe :P

Edited by Lava Del'Vortel, 18 June 2010 - 11:00 AM.


#6 Mike1072

Mike1072
  • Modder
  • 539 posts

Posted 19 June 2010 - 03:04 AM

If you can provide a .bam with your new icons in them (even the complete mapicons.bam you have now) that uses the same palette as the original mapicons.bam, you should be able to patch your new icons into the existing file pretty easily with some basic WeiDU ninjary.

#7 Lava Del'Vortel

Lava Del'Vortel

    Fiction Enforcer

  • Modder
  • 2299 posts

Posted 19 June 2010 - 04:58 AM

yeah, but still remember that when you code an area you have to type an icon number for particular area and adding some frames is not enough. The number would be different acording to previous mods installed (keeping in mind that those may have added other icons too)

#8 Mike1072

Mike1072
  • Modder
  • 539 posts

Posted 19 June 2010 - 05:34 AM

yeah, but still remember that when you code an area you have to type an icon number for particular area and adding some frames is not enough. The number would be different acording to previous mods installed (keeping in mind that those may have added other icons too)

If there are preexisting entries in mapicons.bam labelled 0 to n and you add your entry at the end, then your entry will be (n+1). Getting this number is a simple read of the number of cycles in mapicons.bam; inserting the new data without messing something up is the harder part.

I don't have the time now, but in a few days I can try to whip something up if nobody beats me to it.

#9 Lava Del'Vortel

Lava Del'Vortel

    Fiction Enforcer

  • Modder
  • 2299 posts

Posted 19 June 2010 - 05:43 AM

I'm not really good at that... and what's more it's not one bam. One icon is 13 different bams - available not-yet-visited, available visited, non available, when cursor is on the icon, when area icon is clicked... Discouraging, isn't it? :P
Now I have ready version that overrides mapicons.bam and it's as optional component. Normally new area will have icon of Umar. However if in you (or someone else) would like to help in future, then it would be great :)

#10 GeN1e

GeN1e

    A very GAR character

  • Modder
  • 1604 posts

Posted 19 June 2010 - 10:50 AM

What I and Mike were saying is that as long as the palette is the same we can handle the rest.

Compare palettes between old and new MAPICONS (if you don't know how, attach new one here), if they're the same then it's codable. Otherwise, well, an optional component as you say.

Retired from modding.


#11 Lava Del'Vortel

Lava Del'Vortel

    Fiction Enforcer

  • Modder
  • 2299 posts

Posted 19 June 2010 - 11:04 AM

well, since Kwiat_W added new frames and those work quite fine (maybe the shade of red is slightly different to original - however, those frame works) I gues the palette is fine. There were no problems with that.
Since Kwiat is the one who prepared the bam, I have aready new fixed mapicons.bam. Could you work on those or is it a problem?
Attached File  mapicons.zip   679.92K   303 downloads

#12 sotona

sotona
  • Member
  • 58 posts

Posted 27 June 2010 - 09:51 AM

well, since Kwiat_W added new frames and those work quite fine (maybe the shade of red is slightly different to original - however, those frame works) I gues the palette is fine. There were no problems with that.
Since Kwiat is the one who prepared the bam, I have aready new fixed mapicons.bam. Could you work on those or is it a problem?
Attached File  mapicons.zip   679.92K   303 downloads

I have the same problem (to add new sequence of frames to the existing bam) as well. So if anyone could do it it would be great.
Whoa lord, it's hard to be humble, when you're perfect in every way.

Altered Knock Spell

#13 Miloch

Miloch

    Barbarian

  • Modder
  • 6579 posts

Posted 27 June 2010 - 10:06 AM

You need to read the frame data of the new BAM with a big fat READ_ASCII (number of bytes). Maybe several of those if the frame data isn't sequential, I dunno offhand. Then write it to the existing mapicons.bam with an INSERT_BYTES and update the frame and cycle data with a WRITE_SHORT 0x8 (frames) and a WRITE_BYTE 0xa (cycles). I thought Mike1072 or GeN1e said they were going to code this.

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#14 Mike1072

Mike1072
  • Modder
  • 539 posts

Posted 30 June 2010 - 04:45 PM

Okay, I've whipped something up. It seems to do the job from what I can tell, but if you could give it a test, that'd be great.

There is an explanation of the function in the .tpa, but here's a quick example of how to use it.
INCLUDE ~MyMod/add_map_icons.tpa~

LAUNCH_ACTION_FUNCTION ~ADD_MAP_ICONS~
 INT_VAR icon_index = 29
 STR_VAR path_to_icons = ~MyMod/bam/mapicons.bam~
 RET icons_added = icons_added new_icon_index = new_icon_index
END

PRINT ~%icons_added% icon(s) added, new icon index is %new_icon_index%~ // this just prints out the return values
This would take all icons from MyMod/bam/mapicons.bam with a cycle number equal to or greater than 29 and append them to the map icon .bam associated with worldmap.wmp. The new cycle number of your first icon is returned as new_icon_index, so you can use it later. If you want to append to the .bam associated with worldm25.wmp instead of worldmap.wmp, you can do that like this:
LAUNCH_ACTION_FUNCTION ~ADD_MAP_ICONS~
 INT_VAR icon_index = 29
 STR_VAR worldmap = ~worldm25~ path_to_icons = ~MyMod/bam/mapicons.bam~
 RET icons_added = icons_added new_icon_index = new_icon_index
END

If the function could be tested a bit and evaluated, maybe it could get added to WeiDU sometime. Then it could easily be used by anyone looking to do the same thing, plus any latent bugs could be fixed for all mods simultaneously.

Edit: Updated file with some code improvements and tidiness.
Edit2: Updated file to convert palettes automatically. Can find file attached to post 27.

Edited by Mike1072, 04 July 2010 - 02:25 PM.


#15 sotona

sotona
  • Member
  • 58 posts

Posted 01 July 2010 - 09:19 AM

Okay, I've whipped something up. It seems to do the job from what I can tell, but if you could give it a test, that'd be great.

Thank you! But I've the following problem with your lib:
Copying and patching 1 file ...
Copying and patching 1 file ...
Copying and patching 1 file ...
ERROR: cannot convert THIS or %THIS% to an integer
ERROR: [MAPICONS.bam] -> [override] Patching Failed (COPY) (Not_found)
Stopping installation because of error.
Stopping installation because of error.
Stopping installation because of error.
Stopping installation because of error.
Stopping installation because of error.
Stopping installation because of error.

ERROR Installing [1], rolling back to previous state
Will uninstall   0 files for [SETUP-TEST2.TP2] component 0.
Uninstalled      0 files for [SETUP-TEST2.TP2] component 0.
ERROR: Not_found

Whoa lord, it's hard to be humble, when you're perfect in every way.

Altered Knock Spell

#16 Wisp

Wisp
  • Modder
  • 1353 posts

Posted 01 July 2010 - 10:11 AM


Okay, I've whipped something up. It seems to do the job from what I can tell, but if you could give it a test, that'd be great.

Thank you! But I've the following problem with your lib:

Make sure you are using the latest version of WeiDU. "THIS" was added in WeiDU 214.

#17 sotona

sotona
  • Member
  • 58 posts

Posted 01 July 2010 - 12:13 PM

Make sure you are using the latest version of WeiDU. "THIS" was added in WeiDU 214.


Thanks! That was the case.

Okay, I've whipped something up. It seems to do the job from what I can tell, but if you could give it a test, that'd be great.


It worked, BUT it definitely messes with the palette of the newly added frames. New icons are inserted to the bam file all right, but with their palette corrupted!!! :(

Edited by sotona, 01 July 2010 - 12:14 PM.

Whoa lord, it's hard to be humble, when you're perfect in every way.

Altered Knock Spell

#18 Mike1072

Mike1072
  • Modder
  • 539 posts

Posted 01 July 2010 - 01:48 PM

It worked, BUT it definitely messes with the palette of the newly added frames. New icons are inserted to the bam file all right, but with their palette corrupted!!! :(

The palette of your .bam file needs to match the palette of the .bam file these are getting added to (for worldmap.wmp, this should be mapicons.bam). One way to do this is to open mapicons.bam and import your images there, then save that as your custom .bam.

For what it's worth, mapicons.bam and 25mapic.bam (the worldm25.wmp icon file) use different palettes.

#19 sotona

sotona
  • Member
  • 58 posts

Posted 02 July 2010 - 12:57 AM


It worked, BUT it definitely messes with the palette of the newly added frames. New icons are inserted to the bam file all right, but with their palette corrupted!!! :(

The palette of your .bam file needs to match the palette of the .bam file these are getting added to (for worldmap.wmp, this should be mapicons.bam). One way to do this is to open mapicons.bam and import your images there, then save that as your custom .bam.

For what it's worth, mapicons.bam and 25mapic.bam (the worldm25.wmp icon file) use different palettes.

Why my own mapicons.bam with manually added icons works fine in-game then? I can copy it to override and play the game with new icons just fine. The palette is altered somehow only in the resulting bam file.

Edited by sotona, 02 July 2010 - 01:00 AM.

Whoa lord, it's hard to be humble, when you're perfect in every way.

Altered Knock Spell

#20 Miloch

Miloch

    Barbarian

  • Modder
  • 6579 posts

Posted 02 July 2010 - 01:38 AM

Why my own mapicons.bam with manually added icons works fine in-game then? I can copy it to override and play the game with new icons just fine. The palette is altered somehow only in the resulting bam file.

Open both BAMs with DLTCEP and edit the palettes. Are they exactly the same, same order and everything? Could be when you inserted your frames to the BAM (using BAM Workshop or however you did it) it reoptimised the palette.

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle