If so, how would I go about doing this?
To give an example, let's say the .exe image (i.e. the icon that's clicked to open the game) is the game's logo to start with. Then, when the player makes a specific choice while going through the game, the .exe image automatically changes to a picture of the MC's face.
If this can be done only after closing the game window, that would be fine, too! Automatic would be more ideal, but the ability to accomplish something even close to this is what's most important.
Any and all help is greatly appreciated!
EDIT: I'm also referring to and want to change the icon that shows on the dock/taskbar when the game is open.
Is it possible to change a game's .exe image based on variables within the game?
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
- Offworlder
- Regular
- Posts: 114
- Joined: Mon Aug 20, 2018 6:33 pm
- Contact:
Re: Is it possible to change a game's .exe image based on variables within the game?
The icon you click to launch the game: No, I don’t think this is possible. That image is built into the exe - “compiled in” when you build your distribution. Modifying it requires a change to the physical executable. In theory, you could build a .lnk file that POINTED to your executable and which had a different icon, but I’ve never done that with Python. Google might be your friend there. But don’t forget that Windows isn’t the entire world - any techniques for that won’t work on MacOS or Linux.
The icon that shows up at the top left of the game window itself MIGHT be changeable since it comes from a different place, but this would probably require you to dig deep into the Ren’py Python to get hold of the required windowing objects.
The icon that shows up at the top left of the game window itself MIGHT be changeable since it comes from a different place, but this would probably require you to dig deep into the Ren’py Python to get hold of the required windowing objects.
- Offworlder
- Regular
- Posts: 114
- Joined: Mon Aug 20, 2018 6:33 pm
- Contact:
Re: Is it possible to change a game's .exe image based on variables within the game?
Thank you responding! Unfortunately, I'm not quite advanced enough to understand how to accomplish your suggestions. x_x;;
The game I'm making is going to be a gift, so it's fine if it only works on Windows.
The game I'm making is going to be a gift, so it's fine if it only works on Windows.
- PyTom
- Ren'Py Creator
- Posts: 16088
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Is it possible to change a game's .exe image based on variables within the game?
What you could do - might work, might not, might trigger your anti-virus - would be to build the game with the second icon. Grab the .exe from the zip file, store it in the game directory. Then when the game runs, it could copy the exe file from one place to another. The exe file isn't game specific, so you can copy one game's exe into another and it will probably work.
Something like:
You may then need to run commands to clear the windows icon cache.
Something like:
Code: Select all
python hide:
data = renpy.file("new.exe").read()
with open(os.path.join(config.basedir, "old.exe")) as f:
f.write(data)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3785
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: Is it possible to change a game's .exe image based on variables within the game?
Which unfortunately, won't take effect until explorer.exe service has been shut down and restarted - something the user will definitely notice (it causes Windows to go completely blank for a second)
And if you do it incorrectly, you end up with this:
(This is my own PC, I'm too lazy to bother fixing it)
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Who is online
Users browsing this forum: Bing [Bot], Google [Bot], trailsiderice