How do I avoid the Image Cache?

ArkDG

Veteran
Veteran
Joined
May 26, 2013
Messages
143
Reaction score
48
First Language
portuguese
Primarily Uses
I'm having a problem. I can save a picture of my preference in the folder that I want, but I want that picture to be replaced after some events, and when you reload it, with hte same name in the same folder, it will be a refreshed version, diferent.

Well, the images are saved and then replaced, but in the game, when it have to show the image, it shows the previous version of it, even if it don't exist anymore. (but in the game folder it was replaced with a new version, as I can see because I'm with the folder oppened in the win explorer)

Trying to make it more understandable:

I have the "Image_01.png"

I loaded this to the menu. It shows the image, I'm happy!

But now, without restarting the game (cause restart makes the problem "vanish"), I replace "Image_01.png" with anoter version on the same folder with the same name. (the file is still "folder/Image_01.png")

When I open the menu I want the game to reload the image and show me the new version, but the game shows me the previous version of the picture.

What do I understood? The game just do not load the new version beacuse it's using its cached temporary files version, and is not loading it from the folder as I want it to do.

I researched for answers, but I can't understand how to use these functions in the rpg maker:

http://stackoverflow.com/questions/1077041/refresh-image-with-a-new-one-at-the-same-url

http://stackoverflow.com/questions/17479748/refresh-image-in-jsp-avoiding-cache

http://websistent.com/javascript-reload-image/

http://stackoverflow.com/questions/684917/can-i-delete-file-from-temporary-internet-files-in-javascript

Someone here can understand what to do? I need to know, it would help me a lot.
 
Last edited by a moderator:

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
What exactly are you trying to achieve? Every image loaded through the ImageManager is stored in a cache, so it doesn't have to be reloaded everytime it's requested.
 

ArkDG

Veteran
Veteran
Joined
May 26, 2013
Messages
143
Reaction score
48
First Language
portuguese
Primarily Uses
Yes, I know what the cache does. I don't know how do I do to avoid it.

I just want to be capable to reload a image when I need to. ^^

The people in the links I posted wants the same thing, but for websites. D:
I don't know how to apply the codes in the rpg maker.
 

Make it possible to avoid this little problem with the ImageManager cache that do not refresh the image contents after I change it in the folder. Understand? o.o
 
Last edited by a moderator:

Zalerinian

Jack of all Errors
Veteran
Joined
Dec 17, 2012
Messages
4,696
Reaction score
935
First Language
English
Primarily Uses
N/A
If you really want to clear an item from the cache, you'll need to do something like this:

delete ImageManager._cache["Path/To/Image:hue"]This will remove the cache entry of the bitmap, though I'm not entirely sure if that will have the garbage collector properly dispose of the bitmap. But that will remove it from the cache, so that it will reload the file again.
 

Iavra

Veteran
Veteran
Joined
Apr 9, 2015
Messages
1,797
Reaction score
863
First Language
German
Primarily Uses
I strongly advise against changing any game files except the saves, since this will apply to all games.


- If you want to switch to a fixed image, better save both and simply overwrite your picture.


- If the image is generated at runtime, better directly display it via sprite, which is much faster than having to save it first.


- If the image is generated by PHP or something else on the server side, consider using it directly via Bitmap.load, which does not cache.
 

Zalerinian

Jack of all Errors
Veteran
Joined
Dec 17, 2012
Messages
4,696
Reaction score
935
First Language
English
Primarily Uses
N/A
- If the image is generated by PHP or something else on the server side, consider using it directly via Bitmap.load, which does not cache.
I thought of suggesting this method, but it sounded like they want the event's image to change, and those will automatically make calls through the Image Manager, so that wouldn't help in this case.
 

ArkDG

Veteran
Veteran
Joined
May 26, 2013
Messages
143
Reaction score
48
First Language
portuguese
Primarily Uses
Thank you guys! You are awesome! ^^

The problem is solved! 
 

DarknessFalls

Rpg Maker Jesus - JS Dev.
Veteran
Joined
Jun 7, 2013
Messages
1,393
Reaction score
210
First Language
English
You dont. You use it. You can clear it after if you wish.
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.
time for a new avatar :)

Forum statistics

Threads
106,017
Messages
1,018,356
Members
137,802
Latest member
rencarbali
Top