SC4 Devotion Forum Archives

SimCity 4 Devotion Custom Content Showcase => Other Projects => Topic started by: CasperVg on September 06, 2019, 02:47:31 AM

Title: DLL-modding for Hotkeys - AutoSave & AutoHistorical
Post by: CasperVg on September 06, 2019, 02:47:31 AM
I've recently found that, by combining simmaster07's excellent work on gzcom-dll (https://github.com/nsgomez/gzcom-dll) and ebina's work on KEYCFG modding (https://sc4devotion.com/forums/index.php?topic=9503.0) in 2009 - we can actually use DLL plugins to create new programming functions that are triggered by hotkeys.

So far, what we can actually do within those functions is still somewhat limited by the classes that simmaster07 decoded, but a number of things that I have been able to do:

- Assign a hotkey that automatically adds/removes $100k to your city budget each time it is pressed
  * Uses cISC4BudgetSimulator
- Assign hotkeys to automatically make all lots in a city historical, or to stop all lots in a city from being historical, or to toggle historical status of all lots in the city.
  * Uses cISC4LotManager and cISC4Lot
  * sim_16 has recently managed something similar over on Simtropolis (https://community.simtropolis.com/forums/topic/758258-modifying-sc4-savegames-it-is-possible/), but his solution requires savegame editing - which means you need a separate tool and need to close to game.

The hotkeys I have added are as following:

For good measure I have also added an extra cheatcode: AutoHistorical.
When this cheat code is activated, the game will automatically mark all lots as historical every 1st day of the Month. To disable it, just enter it again.

To test what I have so far:
1. Download the ZIP file in the attachment
2. Move the files CAS_AutoHistorical_v0.0.1.dat and CAS_AutoHistorical_v0.0.1.dll to your plugin folder root.

If you have suggestions on other things you would like hotkeys for, let me know in the comments  ;)

EDIT: Attachment removed. A newer version is available here (https://sc4devotion.com/forums/index.php?topic=18501.msg532936#msg532936)
Title: Re: DLL-modding for Hotkeys - Automatically mark all lots as historical
Post by: metarvo on September 06, 2019, 05:29:37 AM
This is one of those things I didn't even consider until I saw it... but now I can see the potential.  Certain types of city-building styles benefit greatly from historic status.  For instance, I could imagine it would work wonders for diagonal residential neighborhoods when one has taken the time to grow a row of houses just so.

Nice work, Casper! :thumbsup:
Title: Re: DLL-modding for Hotkeys - Automatically mark all lots as historical
Post by: Barroco Hispano on September 06, 2019, 06:00:10 AM
Is it possible to force the alpha blend with your method?

https://en.wikipedia.org/wiki/Alpha_compositing

https://docs.microsoft.com/en-us/windows/win32/direct3d11/d3d10-graphics-programming-guide-blend-state

https://docs.microsoft.com/en-us/windows/win32/direct3d9/texture-alpha

No Alpha Blend:

(https://cdn.discordapp.com/attachments/393834822696697866/612034605058621451/nobleding.png)

Alpha blend:

(https://cdn.discordapp.com/attachments/393834822696697866/612034600256012328/50be.png)
Title: Re: DLL-modding for Hotkeys - Automatically mark all lots as historical
Post by: Andreas on September 06, 2019, 11:57:23 AM
This is rather intriguing alright! You guys never cease to amaze me, impressive what you can do with such an old game. I wonder if you could create a hotkey for "fixing" the "water graphics bug" that always occurs when using lots with no base texture, and you switch to underground view and back.
Title: Re: DLL-modding for Hotkeys - Automatically mark all lots as historical
Post by: Tyberius06 on September 06, 2019, 01:51:19 PM
Casper, these are really awesome developments! The make things historical hotkey and cheat alread my favoutire, since my gameplay is heavily depending on certain buildings to grow next to each other and I only want to keep certain buildings.
I don't know if the +1 reputation option is still available with the new SC4D, but I would like to give you +1 for this development.

- Tyberius
Title: Re: DLL-modding for Hotkeys - Automatically mark all lots as historical
Post by: mattb325 on September 06, 2019, 11:10:57 PM
Wow, this is excellent stuff indeed, Casper!
It's these sorts of amazing new findings that will really help keep this old game alive.  :thumbsup:
Title: Re: DLL-modding for Hotkeys - Automatically mark all lots as historical
Post by: mgb204 on September 07, 2019, 02:48:08 AM
Quote from: Tyberius06 on September 06, 2019, 01:51:19 PM
I don't know if the +1 reputation option is still available with the new SC4D, but I would like to give you +1 for this development.

Done!
Title: DLL-modding for Hotkeys - AutoSave & AutoHistorical
Post by: CasperVg on September 07, 2019, 08:57:52 AM
Title: Re: DLL-modding for Hotkeys - AutoSave & AutoHistorical
Post by: AsimPika3172 on September 07, 2019, 03:52:09 PM
Cool!  :thumbsup: &apls &apls &apls :bnn:
Title: Re: DLL-modding for Hotkeys - AutoSave & AutoHistorical
Post by: Shiftred on September 07, 2019, 07:28:39 PM
This is great! In just a few minutes it has proven to make my play style much easier.
Title: Re: DLL-modding for Hotkeys - AutoSave & AutoHistorical
Post by: Jasoncw on September 13, 2019, 12:34:54 PM
Incredible!!