Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 3.5 - WoG and Beyond > Thread: Alternative Creatures Mod
Thread: Alternative Creatures Mod
Bersy
Bersy


Honorable
Supreme Hero
posted January 17, 2020 10:14 PM
Edited by Bersy at 11:02, 19 Jan 2020.

Alternative Creatures Mod

The first version of the Alt Creatures mod to replace battery is available for download.
Download for testing

Requirements: Era 2.8.5+ (the latest build from daemon_n is suitable)
Era.dll update for Era 2.8.4: https://dropmefiles.com/jn5oR (old version is displayed, do not pay attention)

Brief description:
When you enable a mod, the following functions are available to other mods and scripts:

!?FU(SetTownsDwellingSlot);
; Configures monster slot for all towns of specific type
; x1 - town type (0 for castle, 1 for rampart, etc)
; x2 - dwelling level (0..6)
; x3 - upgraded or not (1 or 0)
; x4 - slot ID (0..3)
; x5 - alternative monster type, -1 to make slot empty
; x6 - growth rate in percents (100 = original, 50 = twice lower, 200 = twice higher)
;
; Example: FU(SetTownsDwellingSlot):P1/0/1/2/13; set Rampart 3-d alternative for upgraded centaures to Archangels.

!?FU(GetTownsDwellingSlot);
; Returns dwelling monster type and growth rate by town type
; x1 - town type (0 for castle, 1 for rampart, etc)
; x2 - dwelling level (0..6)
; x3 - upgraded or not (1 or 0)
; x4 - slot ID (0..3)
; ?x5 - monster type or -1
; ?x6 - growth rate in percents (100 = original, 50 = twice lower, 200 = twice higher)

!?FU(SetTownDwellingSlot);
; Configures monster slot for town with specific ID
; x1 - town ID (same as CA:U)
; x2 - dwelling level (0..6)
; x3 - upgraded or not (1 or 0)
; x4 - slot ID (0..3)
; x5 - alternative monster type, -1 to make slot empty
; x6 - growth rate in percents (100 = original, 50 = twice lower, 200 = twice higher). Must be > 0
;
; Example: FU(SetTownDwellingSlot):P4/0/1/2/13; set 5-th town on map alternative for upgraded 1-st level creatures to Archangels.

!?FU(GetTownDwellingSlot);
; Returns monster type/custom growth rate slot of a town with specific ID
; x1 - town ID (same as CA:U)
; x2 - dwelling level (0..6)
; x3 - upgraded or not (1 or 0)
; x4 - slot ID (0..3)
; ?x5 - alternative monster type or -1
; ?x6 - growth rate in percents (100 = original, 50 = twice lower, 200 = twice higher). Must be > 0
;
; Example: FU(SetTownDwellingSlot):P4/0/1/2/13; set 5-th town on map alternative for upgraded 1-st level creatures to Archangels.

Example:
Let's make it so that at the entrance to the city any non-improved dwelling of the first level offered three monsters:
1) Rust dragons at the rate of 0.25 to 1 unit of the real population.
2) Crossbowmen at the rate of 0.5 to 1 unit of the real population.
3) Griffins at the rate of 1.5 to 1 unit of the real population.

So, if there were 12 skeletons in the crypt, then there will really be a choice of:
3 rusty dragons, 6 crossbowmen, or 18 griffins. When the dialog is closed, the number of creatures in the slots is reduced to the actual number of inhabitants of the dwellings, always rounded down. So, leaving 1 Griffin and closing the dialog, you can find that there are 0 creatures, since the Griffin = 0.66 of 1 unit of the real population (without this rule, cheats are possible).

!?FU(OnOpenTownScreen);
!!CA0/x1:T?y2;
!!FU(SetTownsDwellingSlot):Py2/0/0/0/135/25;
!!FU(SetTownsDwellingSlot):Py2/0/0/2/2/50;
!!FU(SetTownsDwellingSlot):Py2/0/0/3/4/150;

The AI normally sees the first two slots set for cities by type and hires only those types of creatures.
____________
Heroes 3 Era and everything for it. Releases folder for releases.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Hero_of_Light
Hero_of_Light


Responsible
Supreme Hero
posted January 18, 2020 08:47 AM

So If I understand it correctly, this plugin allows third and fourth slots on any dwelling but the growth of the added creatures MUST be directly linked to the growth of the original creature?

Because in my mod, I used the battery plugin to add third creatures that have their own weekly growth, regardless of what you do with the original creatures. This means that it kept growing in its own rate, whether you've build Citadel or Castle, or even wether yoou've recruited the original creatures of the dwelling or not.

Can this new plugin do that sort of thing?
____________
Not idly do the leaves of Lorien fall.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Bersy
Bersy


Honorable
Supreme Hero
posted January 18, 2020 10:20 AM

Nope. It's plugin for truly alternatives, not extra creatures from another source added to normal dwellings dialog. But it's the first version, so I can extend it with new functions. OK, I will add battery functionality in the next version and rename functions.
____________
Heroes 3 Era and everything for it. Releases folder for releases.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
RerryR
RerryR


Promising
Famous Hero
Researching Magic
posted January 18, 2020 10:42 AM

Bersy said:
Nope. It's plugin for truly alternatives, not extra creatures from another source added to normal dwellings dialog. But it's the first version, so I can extend it with new functions. OK, I will add battery functionality in the next version and rename functions.


Awesome! When do you actually sleep ?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Bersy
Bersy


Honorable
Supreme Hero
posted January 18, 2020 11:12 AM

Perry, sleepings is for lazybones. Era golems never sleep
____________
Heroes 3 Era and everything for it. Releases folder for releases.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
xericsin
xericsin


Famous Hero
posted January 18, 2020 02:56 PM
Edited by xericsin at 10:09, 19 Jan 2020.

Gonna try this for sure!

Edit:
I am experiencing lags between clicking creature dwelling and recruitment window popping. using era2.95, wog+alt creature only.
era2.95 installed over era2.82.

Edit2:
This is very strange. The alt creature mod only has a few function definitions. I cannot imagine how this would be associated with the lag.


Edit3:
I found it is the nested for loops in the OnOpenRecruitDlg function taking too long on my laptop i5-7200U CPU @2.5GHz.

Edit4:
It turns out this section of code is looping for 90000+ times. And what is the (num_iterations)? This section of code seems doing nothing except looping.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Bersy
Bersy


Honorable
Supreme Hero
posted January 18, 2020 09:59 PM

Cannot reproduce. Will wait for more reports. Try to install 2.9.5 over clean Heroes, please.
____________
Heroes 3 Era and everything for it. Releases folder for releases.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Bersy
Bersy


Honorable
Supreme Hero
posted January 19, 2020 10:46 AM
Edited by Bersy at 11:02, 19 Jan 2020.

I'm really sorry, didn't delete garbage block of code. Reuploaded.
https://dropmefiles.com/kNhwN
____________
Heroes 3 Era and everything for it. Releases folder for releases.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread »
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0394 seconds