Jump to content


Photo

Add a new door to the area (with tiles!)


31 replies to this topic

#31 Sam.

Sam.
  • Modders
  • 117 posts
  • Gender:Male
  • Location:USA

Posted 01 October 2017 - 06:59 PM

I have updated the library with a new function, ps_tileset_replace_palette_entry, that replaces palette entries with a new color.  So say there was a tileset with a tile that contained a pure green pixel, which would look odd.  You can use this function to replace every pure green pixel with some other color.  I feel like there was a fixpack somewhere that did something like this.  A problem arises if you need to replace the color of a single pixel without entirely removing that color from the tile (like if that bad green pixel was in a door or water overlay tile that intentionally uses green for the transparent sections).  To replace the color of this pixel, you would first look to see if the color you want to replace it with was already in the palette.  If it is, great you're done.  If it isn't, you would next have to look for an unused palette entry.  If every palette entry is used, you would look for duplicate palette entries, combine them, and then use the free entry.  If there are no duplicates, you're left with calculating the nearest-neighbor color within the existing color pool.  I have basically already done this for BAMs in a different language (AHK) so I know how to do this, but rewriting it in WeiDU would constitute significant time and effort.  While this last function would complete my initial vision for this tileset function library, I'm a bit hesitant to put forth the effort if there is no need for it.  Other than this, my library (along with Tile2EE) includes the capability to do anything with a tileset I could envision anyone wanting to do that couldn't be done better with just a well placed WRITE_BYTE.

 

Thoughts?  Anyone know which fixpack I vaguely remember or how it went about replacing green pixels?


"Ok, I've just about had my FILL of riddle asking, quest assigning, insult throwing, pun hurling, hostage taking, iron mongering, smart-arsed fools, freaks, and felons that continually test my will, mettle, strength, intelligence, and most of all, patience! If you've got a straight answer ANYWHERE in that bent little head of yours, I want to hear it pretty damn quick or I'm going to take a large blunt object roughly the size of Elminster AND his hat, and stuff it lengthwise into a crevice of your being so seldom seen that even the denizens of the nine hells themselves wouldn't touch it with a twenty-foot rusty halberd! Have I MADE myself perfectly CLEAR?!"

-- to Portalbendarwinden

--------------------

Posted Image
___________Old pen and paper modules of the 70s and 80s.___________

CA Forums CA Homepage


#32 Sam.

Sam.
  • Modders
  • 117 posts
  • Gender:Male
  • Location:USA

Posted 05 October 2017 - 11:13 AM

I broke down and wrote it anyway, which concludes my initial vision for the project.  The first beta release containing the full feature set can be found on GitHub.


"Ok, I've just about had my FILL of riddle asking, quest assigning, insult throwing, pun hurling, hostage taking, iron mongering, smart-arsed fools, freaks, and felons that continually test my will, mettle, strength, intelligence, and most of all, patience! If you've got a straight answer ANYWHERE in that bent little head of yours, I want to hear it pretty damn quick or I'm going to take a large blunt object roughly the size of Elminster AND his hat, and stuff it lengthwise into a crevice of your being so seldom seen that even the denizens of the nine hells themselves wouldn't touch it with a twenty-foot rusty halberd! Have I MADE myself perfectly CLEAR?!"

-- to Portalbendarwinden

--------------------

Posted Image
___________Old pen and paper modules of the 70s and 80s.___________

CA Forums CA Homepage




Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users