Why is my Hellion animated?

Bale

Minion
Okay, this is massively weird. I would swear that until recently my Hellion looked just like the image in the wiki. Am I mistaken about that? When I sign onto KoL without mafia it does look like the image in the wiki. However, when I log on through mafia I see this guy:

meWCX.gif


He apparently resides in /images/adventureimages/hellion.gif

So... I quit mafia and deleted that folder. Then I restarted mafia checked the zone and found him again. Bam! The image is back in /images/adventureimages.

Why? Has it been that way all along, but I for some reason, don't remember it? Is this a known feature of mafia and if so, why?
 

Veracity

Developer
Staff member
I did it (revision 8626 on Sept 16, 2010) and I like it.

If you don't like it, uncheck "Override certain KoL images" on the Relay Browser card of Preferences.
 
Last edited:

Bale

Minion
Well, that was the answer to one of the questions that I asked, (Why?) Never said I didn't like it, just that I was confused.

With that clue I finally found it on the SVN in images/overrides/ so apparently it has been part of mafia since r8626. Huh. How did I not realize for nearly two years.

I certainly do like many of the relay override images so I'm not disabling it. If I ever want the vanilla KoL Hellion, I'll just replace it, but it is cute, so it can stay.
 

Veracity

Developer
Staff member
Shortly before that, KoL replaced an earlier image of the Hellion with the current inferior one.
Hellion, the maintainer of Mr. Script, created an animated one and made Mr. Script override it.
I liked it and made KoLmafia use the same image.

You didn't realize it was there because the option to display it (relayOverridesImages) is off by default.
Apparently, you recently turned it on.
 

Bale

Minion
Yes, that might have happened. I remember clicking though odd options last week. Thanks for the history on that change and for saving my belief in my sanity by proposing a plausible explanation for my ignorance.

It does not appear that there are other relay override images? Have you ever considered adding more?
 

ckb

Minion
Staff member
Is there an easy way to add our own images to this Mafia image override? Something similar to the way we can override data files?
 

Catch-22

Active member
Is there an easy way to add our own images to this Mafia image override? Something similar to the way we can override data files?

Assuming you have relayOverridesImages set to true, you should be able to override images by placing them in the "/images/overrides/" folder (doesn't exist by default) and giving them the same name as the KoL image.
 

ckb

Minion
Staff member
Assuming you have relayOverridesImages set to true, you should be able to override images by placing them in the "/images/overrides/" folder (doesn't exist by default) and giving them the same name as the KoL image.

That is what I expected... though it does not seem to be working.

To test, I copied the image foe the mosquito and saved it as familiar5.gif in the overrides folder.
But looking at the familiar page, the lime image is still http://images.kingdomofloathing.com/itemimages/familiar5.gif

Anything else I should try?
Maybe starting with a clean KolMafia install?
 

Catch-22

Active member
You're possibly one of the first people to ever try using the feature. I am not sure if a clean KoLmafia install would help. I'll try overriding an image later on. Perhaps it simply doesn't work at the moment, or it doesn't work in the way I had guessed it would work? I don't know.
 

Veracity

Developer
Staff member
The problem with image overrides is that there is a whole directory tree of images on images.kingdomofloathing.com.
The ones manipulated by relayOverridesImages are all stored in images/overrides, but there is no indication there as to exactly which image they override. For my initial implementation, I chose to hard-code the replacements. Look at RelayRequest.IMAGES:

Code:
	private static final String [] IMAGES = new String[]
	{
		// Alternating path, original, replacement
		"images/adventureimages/hellion.gif",
		"http://images.kingdomofloathing.com/adventureimages/hellion.gif\" width=100 height=100",
		"/images/adventureimages/hellion.gif\" width=60 height=100",
	};
Notice that it also adjusts the size of the image, since the replacement is not the same size as the original.

I imagine we could set up a mechanism for users to supply their own override images, but it would require adjusting the code beyond simply putting hellion.gif into images/overrides/adventureimages rather than images/overrides, say.
 

ckb

Minion
Staff member
OK, thanks for the update Veracity. I don't feel so bad about my epic fail here then.
Perhaps it would be easiest to just write a relay override script to replace certain images. I'll consider that route if I feel ambitious.
 

Catch-22

Active member
Ah for some reason I thought the IMAGES array was also being populated by whatever was in the overrides folder (hellion being handled separately due to the dimensions). I'd be happy to take a look at making a patch for this at some stage.

The way I would expect it to work would just be that if the file names are the same (ignoring directory structure), it uses the override.

Veracity points out the case of handling image dimensions, I think we could probably just strip the width/height properties from the img tag and the browser could default to using the dimensions of the image itself. I don't think it would need to be too fancy. How does that sound?
 
Last edited:

heeheehee

Developer
Staff member
I think that supplying your own images works (out of the box) if you also check the preference to cache images locally.
 

xKiv

Active member
I think that supplying your own images works (out of the box) if you also check the preference to cache images locally.

I am not so sure about that. I think not all image URLs used by kol are formed in a way that triggers mafia's caching - though the last time I tried was several years ago and I couldn't even find the code in the 5 minutes I "allocated" to the search today/yesterday.
 

heeheehee

Developer
Staff member
Eh. I tried replacing a bunch of familiarX.gif images with familiar5.gif, and my terrarium was suddenly full of sabre-toothed limes :)

(and yes, the images would need the right path, so for familiar icons, images/itemimages/familiar5.gif, e.g.)

edit: Also, I _think_ (not backed up by looking at code) that Mafia will just cache anything that's requested (and not already cached) from images.kingdomofloathing.com/$PATH in images/$PATH. At least, it's likely capable of this (being a proxy and all). And judging from the HTML in the relay browser, it then goes ahead and applies s/https:\/\/images.kingdomofloathing/\/images/g before serving you anything.
 
Last edited:

Catch-22

Active member
Ah, what you're talking about is overwriting images in the local image cache, it's different to an override.
 
Top