Jump to content


Photo

Adding a Map Icon to mapicons.bam

worldmap mapicon

  • Please log in to reply
9 replies to this topic

#1 Lollorian

Lollorian

    smiley addict

  • Member
  • 4150 posts

Posted 23 November 2015 - 08:28 AM

I want to prevent Innershade and Rukraria from overwriting mapicons.bam for their respective new locations in the worldmap. During discussions with Nightfarer over PMs, he pointed me to this thread and specifically, this TPA which would enable me to do what I wanted.

 

I tried using the code for Rukraria and the issue is I can't seem to make it work.. I get this error:

ERROR: icon_index specified (30) outside of range 0 to 15 cycles in rukrakia/WMP/mapicon1.bam; no map icons added

 

Thing is, if I open Rukraria's mapicons.bam in NearInfinity, I properly see 30 cycles in it :unsure: I'm not versed in the BAM structure at the moment and not too inclined to get into its details at the moment so need help.

 

The code I'm using is this:

INCLUDE ~rukrakia/LIB/add_map_icons.tpa~
LAUNCH_ACTION_FUNCTION ~ADD_MAP_ICONS~
  INT_VAR
    icon_index = 30
  STR_VAR
    path_to_icons = ~rukrakia/WMP/mapicon1.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%~

 

I have attached the faulty version of the mod to this post for anyone to try further. (these are only changed files to keep the archive small - you'll need the main Rukraria package from here) Thanks in advance! :cheers:

 

PS: I know this should be in the Help forums but come on - this is the only active place to be in SHS right now :lol:

Attached Files


"I am the smiley addict, yellow and round, this is my grin :D when I'm usually around :P.
When there's trouble brewing, see me post, cuz it's usually a wall o' yellow and your eyes are toast!!!"

BWP GUIDE - BWP FIXES - impFAQ - NPC LIST - KIT LIST - AREA LIST

GitHub Links : BWP Fixpack | Lolfixer | BWP Trimpack | RezMod


#2 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5148 posts

Posted 23 November 2015 - 09:07 AM

The mapicon1.bam file doesn't have anything in the cycle 28 frame number 1... it could be throwing the fuction off. But the circles 29 and 30 have 40 frames.


Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#3 Lollorian

Lollorian

    smiley addict

  • Member
  • 4150 posts

Posted 23 November 2015 - 09:14 AM

I literally didn't understand a word :ermm: Sorry :crying:

 

Any chance you could fix? :P


"I am the smiley addict, yellow and round, this is my grin :D when I'm usually around :P.
When there's trouble brewing, see me post, cuz it's usually a wall o' yellow and your eyes are toast!!!"

BWP GUIDE - BWP FIXES - impFAQ - NPC LIST - KIT LIST - AREA LIST

GitHub Links : BWP Fixpack | Lolfixer | BWP Trimpack | RezMod


#4 Argent77

Argent77
  • Administrator
  • 1397 posts

Posted 23 November 2015 - 09:21 AM

NI's BAM viewer uses one-based indices to display cycle and frame numbers. The WeiDU function uses zero-based indices, however. MAPICON1.BAM only contains 30 cycles (cycle 0 .. cycle 29), so cycle 30 is out of range. To inspect the file more closely, you could import the file into NI's BAM Converter.
 



#5 Lollorian

Lollorian

    smiley addict

  • Member
  • 4150 posts

Posted 23 November 2015 - 09:24 AM

Yes I tried 29 - it says the range is 0 to 15 :blink:

 

EDIT: Ok importing the BAM in NI helped me understand what the Imp said :P I also had a look at the vanilla mapicons.bam - its cycle 28 is also empty :( So that doesn't seem to be the issue


Edited by Lollorian, 23 November 2015 - 09:29 AM.

"I am the smiley addict, yellow and round, this is my grin :D when I'm usually around :P.
When there's trouble brewing, see me post, cuz it's usually a wall o' yellow and your eyes are toast!!!"

BWP GUIDE - BWP FIXES - impFAQ - NPC LIST - KIT LIST - AREA LIST

GitHub Links : BWP Fixpack | Lolfixer | BWP Trimpack | RezMod


#6 Argent77

Argent77
  • Administrator
  • 1397 posts

Posted 23 November 2015 - 09:50 AM

It looks like there is a bug in the ADD_MAP_ICONS function, if you're using compressed BAM files (BAMC) as source. The function incorrectly attempts to read data from the compressed data buffer, which, of course, doesn't work. The "15 cycles" mentioned in the error message is the byte value that happens to be at the file offset where the number of cycles should have been. Try again with an uncompressed MAPICON1.BAM (you can use NI to uncompress the file).
 



#7 Lollorian

Lollorian

    smiley addict

  • Member
  • 4150 posts

Posted 23 November 2015 - 09:56 AM

FFFFFFFFUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU!!!! AWESOME! :woot: Uncompressing it fixed it! Thanks a million!

 

Anyone wanna go ahead and patch the TPA to handle compressed BAMs now? :P


"I am the smiley addict, yellow and round, this is my grin :D when I'm usually around :P.
When there's trouble brewing, see me post, cuz it's usually a wall o' yellow and your eyes are toast!!!"

BWP GUIDE - BWP FIXES - impFAQ - NPC LIST - KIT LIST - AREA LIST

GitHub Links : BWP Fixpack | Lolfixer | BWP Trimpack | RezMod


#8 Argent77

Argent77
  • Administrator
  • 1397 posts

Posted 23 November 2015 - 10:05 AM

There's another issue with this function when used in the Enhanced Editions. It doesn't check for the new BAM V2 format. The function finishes without error, but produces an unreadable MAPICONS.BAM. Since modifying BAM V2 with WeiDU alone is pretty much impossible without help from external tools, it should produce an error message in this case.



#9 Lollorian

Lollorian

    smiley addict

  • Member
  • 4150 posts

Posted 23 November 2015 - 10:37 AM

Ok found the issue about compression - apparently the TPA does handle it but had a booboo:

 

Changing line 63 from:

READ_ASCII 0x00 sig

to

READ_ASCII 0x00 sig (4)

fixed it - the mod's compressed BAMs install fine now :) Thanks for pointing me in the right direction.


"I am the smiley addict, yellow and round, this is my grin :D when I'm usually around :P.
When there's trouble brewing, see me post, cuz it's usually a wall o' yellow and your eyes are toast!!!"

BWP GUIDE - BWP FIXES - impFAQ - NPC LIST - KIT LIST - AREA LIST

GitHub Links : BWP Fixpack | Lolfixer | BWP Trimpack | RezMod


#10 Mike1072

Mike1072
  • Modder
  • 539 posts

Posted 23 November 2015 - 09:35 PM

I updated the function to fix the typo and it will now FAIL if errors are encountered (including dealing with a BAM V2 file).

From glancing at the BAM V2 format, it seems like it would be easier to modify than BAM V1, but I'm not planning on doing anything like that soon.

Edited by Mike1072, 23 November 2015 - 10:28 PM.






Also tagged with one or more of these keywords: worldmap, mapicon