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: ERM help and discussion
Thread: ERM help and discussion This Popular Thread is 384 pages long: 1 2 3 4 5 ... 80 160 240 320 ... 380 381 382 383 384 · «PREV / NEXT»
fanofheroes
fanofheroes


Known Hero
posted June 21, 2020 10:19 PM

Hello all

I wanted to make an ultimate Might hero and ultimate Magic hero.

so for example I wanted to combine the specialties of Crag Hack and Tazar so that every level up they get 5% bonus to offense and armor. And then something similar to Magic heroes.  I tried putting them in a line but when I tested it, it won't let me overlap them.  Is this hard coded into the game so that this is prevented, or is it possible?

!!HE102:X0/22 X0/23;offense + armor
!!HE90:X0/25 X0/26;sorcery + resistance

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


Promising
Famous Hero
Researching Magic
posted June 22, 2020 07:20 AM

fanofheroes said:
Hello all

I wanted to make an ultimate Might hero and ultimate Magic hero.

so for example I wanted to combine the specialties of Crag Hack and Tazar so that every level up they get 5% bonus to offense and armor. And then something similar to Magic heroes.  I tried putting them in a line but when I tested it, it won't let me overlap them.  Is this hard coded into the game so that this is prevented, or is it possible?

!!HE102:X0/22 X0/23;offense + armor
!!HE90:X0/25 X0/26;sorcery + resistance


Just like this it is not possible, I think it will always take the last one.
In the Chinese forum is a way to apply several specialties to one hero. You can search there if you want.

My suggestion would be to just write a script that simulates the second specialty, so basically you just reduce or increase the damage with every hit based on your hero level.  

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


Known Hero
posted June 22, 2020 08:15 PM

RerryR said:
fanofheroes said:
Hello all

I wanted to make an ultimate Might hero and ultimate Magic hero.

so for example I wanted to combine the specialties of Crag Hack and Tazar so that every level up they get 5% bonus to offense and armor. And then something similar to Magic heroes.  I tried putting them in a line but when I tested it, it won't let me overlap them.  Is this hard coded into the game so that this is prevented, or is it possible?

!!HE102:X0/22 X0/23;offense + armor
!!HE90:X0/25 X0/26;sorcery + resistance


Just like this it is not possible, I think it will always take the last one.
In the Chinese forum is a way to apply several specialties to one hero. You can search there if you want.

My suggestion would be to just write a script that simulates the second specialty, so basically you just reduce or increase the damage with every hit based on your hero level.  


Thanks for the tip!! So I'll start with the first, using Crag Hack by just adding the defense bonus text and battle outcome.

!#VRz10:S^Receives a 5% per level bonus to Offense and Armor Skill percentage^;
!!UN:G2/102/2/10;give specialty texts (the 10 is for the z10 variable)
!?MF1; trigger for stack taking damage
!!HE-1:102; sets hero who activates trigger
!!HE102:E1=v1; sets hero 102 experience as variable v1
!!MF:F*(1-(0.05*v1); sets receiver damage @ 5% per level (v1) reduction


My ERM coding is about as good as my Chinese, meaning I'm no good haha.  But I'll keep trying to see what I can find.

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


Admirable
Omnipresent Hero
Wog refugee
posted June 22, 2020 08:18 PM

Yeah, that code will maybe work in Era 9.23 but as now it won't.

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


Known Hero
posted June 22, 2020 09:37 PM

Salamandre said:
Yeah, that code will maybe work in Era 9.23 but as now it won't.


I've been trying to follow the ERM coding from:

file:///C:/gog%20games/homm%203%20complete/Help/Erm%20Help%202.81/index.html

is there another guide I can use to follow then?

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


Legendary Hero
Therefore I am
posted July 03, 2020 10:23 PM

Dear!

I prayer you give full script. I want BANK (47) is Necropolis town. So AI to build and buy troops from BANK (47). Given name? Showdown.

Ok thanks

I'm using WoG/ERA II version 2.9.13
____________
Fight MWMs - stand teach

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


Promising
Famous Hero
Researching Magic
posted July 04, 2020 12:11 PM

Ghost said:
Dear!

I prayer you give full script. I want BANK (47) is Necropolis town. So AI to build and buy troops from BANK (47). Given name? Showdown.

Ok thanks

I'm using WoG/ERA II version 2.9.13


I don't understand. Please try to explain in detail what you want.

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


Admirable
Omnipresent Hero
Wog refugee
posted July 04, 2020 12:32 PM
Edited by Salamandre at 12:40, 04 Jul 2020.

he explained in detail, but Ghost's style

He wants that def to replace Necropolis town. Which is rather impossible because towns have evolving defs (up to castle) so that would require graphical work, not erm at all.

Ghost, what you can do is browse new towns threads and borrow a town adventure map defs you like. There are many now, look at this picture

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


Legendary Hero
Therefore I am
posted July 04, 2020 05:08 PM

Ok you say ERM is impossible. I think !?OB and etc. But ok. Yes yesterday I tested advanced properties: type. No work, only object works. Thank you!
____________
Fight MWMs - stand teach

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


Admirable
Omnipresent Hero
Wog refugee
posted July 04, 2020 07:11 PM

One advice: don't go Era for your mapmaking. You will have only trouble.

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


Legendary Hero
Therefore I am
posted July 04, 2020 07:34 PM

Earlier I did Homecoming, but the hard drive is broken. H3 and H4 mixtures. Ok now I'm doing the map again. Fun to create a map. Later ERA because unknown to me - or I don't think I will reach deeper. And from the map I don't make ERA Scripts. When my ERA version 1.46. Someone uses 1.46f, etc Ok I'll come back again if I have a question. I love WoG. Thanks!
____________
Fight MWMs - stand teach

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


Known Hero
posted July 14, 2020 12:41 AM

I know I may be asking a lot beyond my purview, but could someone write me a script on how to change the battlefield background when attacking a creature dwelling defended by it's native units with a custom image (which I have made)

I'm trying to figure out the !BA modifiers but there isn't much on examples that are easy for me to find.  

If the script could be written for one dwelling (IE: angels), with a side note of the location of that dwelling in the script, then i'll copy and paste the rest myself to make it easier.  

I'm attempting to make my first mod, graphic mod that is, and I've made custom backgrounds for every unit.  I have some artistic skills for an amateur, but no real scripting expertise.

Oh and also, if in the script, all obstacles are disabled.  

thank you

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


Promising
Famous Hero
Researching Magic
posted July 15, 2020 09:16 AM

fanofheroes said:
I know I may be asking a lot beyond my purview, but could someone write me a script on how to change the battlefield background when attacking a creature dwelling defended by it's native units with a custom image (which I have made)

I'm trying to figure out the !BA modifiers but there isn't much on examples that are easy for me to find.  

If the script could be written for one dwelling (IE: angels), with a side note of the location of that dwelling in the script, then i'll copy and paste the rest myself to make it easier.  

I'm attempting to make my first mod, graphic mod that is, and I've made custom backgrounds for every unit.  I have some artistic skills for an amateur, but no real scripting expertise.

Oh and also, if in the script, all obstacles are disabled.  

thank you


If you mean the Battlefield Background you can maybe check here if that is helpful:
https://vk.com/wog_era?w=wall-39912656_8311

If you mean the grid itself there is the custom "New Battlefield" mod and the use of !!BA receiver is very simple, you just need to add a check for your dwelling. All obstacles on the battlefield can also be cleared with !!BA:C I think.
But I dont know how or where to place your new pictures. You need to study other mods for that.

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


Known Hero
posted July 15, 2020 07:56 PM

RerryR said:
fanofheroes said:
I know I may be asking a lot beyond my purview, but could someone write me a script on how to change the battlefield background when attacking a creature dwelling defended by it's native units with a custom image (which I have made)

I'm trying to figure out the !BA modifiers but there isn't much on examples that are easy for me to find.  

If the script could be written for one dwelling (IE: angels), with a side note of the location of that dwelling in the script, then i'll copy and paste the rest myself to make it easier.  

I'm attempting to make my first mod, graphic mod that is, and I've made custom backgrounds for every unit.  I have some artistic skills for an amateur, but no real scripting expertise.

Oh and also, if in the script, all obstacles are disabled.  

thank you


If you mean the Battlefield Background you can maybe check here if that is helpful:
https://vk.com/wog_era?w=wall-39912656_8311

If you mean the grid itself there is the custom "New Battlefield" mod and the use of !!BA receiver is very simple, you just need to add a check for your dwelling. All obstacles on the battlefield can also be cleared with !!BA:C I think.
But I dont know how or where to place your new pictures. You need to study other mods for that.


Do you know the link for the "new battlefield" mod? It's not the same as Morn battlefields is it? I've been trying to find it so I can study the scripts and see what I can work with.

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

Tavern Dweller
posted August 02, 2020 03:19 AM
Edited by 3300330033 at 03:21, 02 Aug 2020.

hi,everyone!! I play era 2.46 with new castle upgrading script but i found it didn't work, Can you help me to make this work?
Here is the script below:

ZVSE
_WARNING_#1=IMPORTANT! This file is not in a plain text format. NEVER use any editor except ERM_S for making any kind of changes!
ERMS_PoweredBy=ERM Scripter v. 2004.6.29.918
ERMS_ScriptName=Castle upgrading
ERMS_ScriptAuthor=Alexis Koz
ERMS_ScriptVersion=1.0.0
ERMS_ScriptDate=25.2(February).2009
ERMS_ScriptERMVersion=2,6
ERMS_ScriptLanguage=Russian or 痼耨觇?(native)
** Castle Upgrading by Alexis Koz
** Wogify name: script45.erm
** Last Updated: July 18, 2006 to let you check (but not make) your castle upgrades when it's not your turn
** Previously Updated: August 12, 2005

** This script lets a player upgrade once per day and town a dwelling or Gold Reserve.
** To upgrade, in the town screen click on the Town (Gold Reserve) or Castle (dwelling)
** icon left of and below the town's name.
**
** The Gold Reserve gives you 1000 gold per day for each upgrade level. An upgraded
** dwelling increases the creature growth by 7 (for L1), 6 (L2), 5 (L3) ... 1 L7) per week.
**
** To prevent unlimited upgrades, the gold costs for each upgrade increases POTENTIAL!
** This means, the first upgrade costs f.e. 1000 gold, the second 2000, the third
** 4000, the fourth 8000 and so on. The costs for other resource increases are linear
** (+1, +2, +3, +4 ...)
**
** The AI tries daily to build either a Gold Reserve (chance is 33 %) or to upgrade
** a dwelling in every second town (randomly chosen). The AI may upgrade a dwelling
** or the gold reserve more than once per day (if the odds are very good) and
** pays only the basic, not increased upgrade price (7000 gold + 2 mithril for
** the Gold Reserve or the usual building costs for the upgraded dwelling for the dwellings).
** The AI will never build more than 7 upgrades of a dwelling or the Gold Reserve in a town.
**
** As well, the player (including the AI) has to build at least the City Hall to build a Gold
** Reserve or the usual upgraded dwelling, before a dwelling upgrade can be built.

** @Scripters / Mapmakers: if you want to know how much bonus a town gets, use
** the FU862 (see description at the end of the script)

** Used v1600-v1984 EXCLUSIVE, v1-v9 not exclusive
** Flag 432
** FU819, FU859-864


!#UN45/=1;
!#IF&1:V432/1; // enable v432, if script is enabled

!?PI&432; // post instruction (start of the map) - Init Vars v1600-v1984 (used to save which upgrades are built)
!!VRv1600:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0; // there are 48 towns and 8 possible upgrades (town hall + 7 dwellings)
!!VRv1616:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
!!VRv1632:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
!!VRv1648:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
!!VRv1664:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
!!VRv1680:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
!!VRv1696:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
!!VRv1712:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
!!VRv1728:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
!!VRv1744:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
!!VRv1760:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
!!VRv1776:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
!!VRv1792:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
!!VRv1808:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
!!VRv1824:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
!!VRv1840:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
!!VRv1856:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
!!VRv1872:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
!!VRv1888:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
!!VRv1904:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
!!VRv1920:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
!!VRv1936:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
!!VRv1952:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;
!!VRv1968:C0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0;

!?TM2&432/$once$=1;
!!UN:U98/-1/?y-1; // count towns
!!VRv7:S-1; // init
!!DO859/1/y-1/1&y-1>0; // loop through them, give gold, increase creatures

!?TM2&432;
!!OW:I$lastplayer$/=1; // check if the last player was AI
!!FU&-1:E; // exit, if not

!!OW:W$lastplayer$/?y-1; // get number of his towns
!!FU&y-1<1:E; // exit, if he has no towns
!!VRy-2:Sy-1 :2; // halve the number of towns
!!DO863/0/y-2/1$lastplayer$/y-1; // tries to  build / upgrade a random dwelling (or Gold Reserve) in every 2nd AI-town
*********


-------------------------------Click handling-----------------------------------
!?CM1&432; // click inside a town
** y-1  - clicked field
** y-2  - flags of the click
** y-3  - owner of town
** y-4  - town number
** y-5  - current player
** y-6  - creature level (1..7)
** y-7  - type of town
** y-8  - number of already existing upgr. dwellings
** y-9  - total bonus of creatures of the chosen level
** y-10 - bonus per dwelling of the chosen level
** y-11 - creature that is available in this dwelling
** y-12 - subtype of click

** v1-v7 - prices for the upgrade

!!CM:I?y-1 F?y-2 S?y-12;  // clicked field and flags
!!FU|y-2>0/y-12=13:E; //Exit if no left-click or it's a click-release
!!FU&y-1<>150/y-1<>158:E; // exit, if not clicked on the hall- or town icon

!!CA-1?y-3 U?y-4 T?y-7; // get owner, town number, and town type
!!OW:C?y-5; // get current player
!!FU$LocalPlayer$; [Get local player: y-100]
!!FU&y-3<>y-100:E; // exit, if owner <> local/current player (f.e. allied)

!!CM:R0; // disable standard function of the icons

** Gold Reserve:
!!FU860&y-1=158y-4/y-5; // Hall icon click: Build Gold Reserve; give town number and owner
!!FU&y-1=158:E; // exit after that

** upgrade Creature dwellings

!!IF:V2/0 V3/0;           [Initialize Flag 2 and 3 to False]
!!DO819/1/7/1y-4; // Check for dwellings built and set z1-z7 to the correct texts;
*                  // flag 2 will be set, if there is at least one upd. dwelling
*                  // flag 3 will be set, if you already built an upgrade in this town today

!!IF&-2:M1/z145020; // message: no upgraded dwellings in this town
!!FU&-2:E; // exit

!!VRz-9:Sz145017;  // Upgrade-Question    [Set strings for radio button box]
!!VRz-8:Sz145018; // have changed my mind
!!IF:G1/1/128/-9/1/2/3/4/5/6/7/-8; // ask for the dwelling
!!FU&v1=128:E; // exit if don't update chosen

!!IF&y-5<>y-100:M1/z145024; [Msg: you can only upgrade a dwelling on your own turn]
!!FU&y-5<>y-100:E; [Exit if not player's turn]

!!VRy-6&v1=1:S1; !!VRy-6&v1=2:S2; !!VRy-6&v1=4:S3; !!VRy-6&v1=8:S4; !!VRy-6&v1=16:S5; !!VRy-6&v1=32:S6; !!VRy-6&v1=64:S7; // set y-6 to the chosen level

!!VRy-99:Sy-6 -1; // correct level (0..6) for UN:T
!!UN:Ty-7/y-99/1/?y-11 N3/-10/y-11/1; // get creature to hire in this town and make a name lookup (to z-10)
!!VRy-10:Sy-6 *-1 +8; // additional number of creatures per dwelling: 7 for each L1, 6 for each L2 ... 1 for each L7

!!FU862y-4/y-6/0/?y-8/?y-9; // get current number of upgrades of the dwelling to y-8, y-9 will be the number of bonus creatures
!!CA-1:N?z-9; // get name of town
!!VRz-1:Sz145000; // set status-text

!!VRz-1&3:+z145008; // add "already improved today"
!!IF&3:Q1/21/y-11/1/z-1; // show the message
!!FU&3:E; // and exit

!!FU861y-7/y-6;  // get price of a simple upgrade, return in v1-v7
!!VRy-8:+1; // increase number of upgrades by one
!!FU$bit$y-8; // get the xth power of 2 (1, 2, 4, 8, 16 ...) depending on the number of built upgrades, return in y-100
!!VRv7:*y-100;// calc new price (gold): it is increased potential depending on the already built upgrades, other resources are untouched
!!VRv1&v1>0:+y-8; !!VRv2&v2>0:+y-8; !!VRv3&v3>0:+y-8; !!VRv4&v4>0:+y-8; !!VRv5&v5>0:+y-8; !!VRv6&v6>0:+y-8; // increase the resource costs linear
!!VRz-1&v7>0:+z145001;
!!VRz-1&v1>0:+z145002;
!!VRz-1&v3>0:+z145003; // add resource-costs to z-1
!!VRz-1&v2>0:+z145004;
!!VRz-1&v4>0:+z145005;
!!VRz-1&v5>0:+z145006;
!!VRz-1&v6>0:+z145007;

!!OW:R-1/0/?y-21 R-1/1/?y-22 R-1/2/?y-23 R-1/3/?y-24 R-1/4/?y-25 R-1/5/?y-26 R-1/6/?y-27; // get players resources
!!IF:V4/0; // init flag 4
!!IF|y-21<v1/y-22<v2/y-23<v3/y-24<v4/y-25<v5/y-26<v6/y-27<v7:V4/1; // enable flag, if the player has not enough resources
!!VRz-1&4:+z145010; // msg can not afford update
!!IF&4:Q1/21/y-11/1/z-1; // show message
!!FU&4:E; // and exit

!!VRz-1:+z145009; // msg: ask to improve
!!IF:Q1/21/y-11/2/z-1; // show message
!!FU&-1:E; // exit, if no chosen

!!VRy-8:*-1; // negate the new number of upgrades (to mark it as built today)
!!FU862y-4/y-6/1/y-8; // set the new value
!!VRy-21:-v1; !!VRy-22:-v2; !!VRy-23:-v3; !!VRy-24:-v4; !!VRy-25:-v5; !!VRy-26:-v6; !!VRy-27:-v7; // take resources
!!OW:R-1/0/y-21 R-1/1/y-22 R-1/2/y-23 R-1/3/y-24 R-1/4/y-25 R-1/5/y-26 R-1/6/y-27; // write reduced resources back

*********

-------------------------Mouse Move trigger (for hint text)---------------------

!?MM1&432/999;
!!CM:I?y-1; //Area mouse moves over
!!VRz-1&y-1=158:Sz145021;
!!VRz-1&y-1=150:Sz145022;
!!CM&y-1=150|y-1=158:Mz-1; //Display mouse-over hint text
*********


------------------------- Functions --------------------------------------------

!?FU819; // check, if upgr. dwelling is built and set z1-z7
!!VRy1:Sx16 +36; // get the correct building number
!!CA0/x1:B3/y1; // check, if it is built
!!VRy1&-1:S-1; [If not built, initialize y1 to -1]
!!VRy1&-1/y-7=0/x16=3:S19; [Castle horde building for Royal Griffins (L3) is #19: y1]
!!VRy1&-1/y-7=1/x16=2:S19; [Rampart horde building for Battle Dwarves (L2) is #19: y1]
!!VRy1&-1/y-7=1/x16=5:S25; [Rampart horde building for Dendroid Soldiers (L5) is #25: y1]
!!VRy1&-1/y-7=2/x16=2:S19; [Tower horde building for Obsidian Gargoyles (L2) is #19: y1]
!!VRy1&-1/y-7=3/x16=1:S19; [Inferno horde building for Familiars (L1) is #19: y1]
!!VRy1&-1/y-7=3/x16=3:S25; [Inferno horde building for Cerberi (L3) is #25: y1]
!!VRy1&-1/y-7=4/x16=1:S19; [Necropolis horde building for Skeleton Warriors (L1) is #19: y1]
!!VRy1&-1/y-7=5/x16=1:S19; [Dungeon horde building for Troglodytes (L1) is #19: y1]
!!VRy1&-1/y-7=6/x16=1:S19; [Stronghold horde building for Hobgoblins (L1) is #19: y1]
!!VRy1&-1/y-7=7/x16=1:S19; [Fortress horde building for Gnoll Marauders (L1) is #19: y1]
!!VRy1&-1/y-7=8/x16=1:S19; [Conflux horde building for Sprites is #19: y1]
!!CA0/x1&-1/y1>0:B3/y1; [Check if horde building is built]
!!VRzx16&-1:S^^; // set z-var to blank, if there is no upgr. building
!!FU&-1:E; // and exit

!!IF:V2/1; // set flag 2 to mark, that there is (at least one) upgr. dwelling

!!VRy2:Sx16 -1; // correct creature level
!!CA0/x1:T?y3; // get type of town
!!UN:Ty3/y2/1/?y4 N3/-10/y4/1; // get creature to hire in this town and make a name lookup (to z-10)

!!FU862x1/x16/0/?y98/?y99; // check number of already build upgrades
!!VRzx16:S145019; // set text "Level X16 (z-10)"
!!IF&y98<0:V3/1; // enable flag, if a dwelling was already upgraded today

*********


!?FU859; // called by TM2; loop through towns, give gold, increase creatures
!!UN:U98/-1/-1/7; // get next town
!!CAv7/v8/v9:U?y1 O?y2; // get town number and owner
!!FU862&y2>-1y1/0/0/?y3/?y4; // get gold resources and gold bonus
!!OW&y2>-1:Ry2/6/dy4; // give additional gold from gold reserve
!!VRy5&y3<0:Sy3 *-1; // get positive value, if gold reserve was upgraded the day before
!!FU862&y3<0y1/0/1/y5; // write this value back

!!IF:V1/0; !!IF&$weekday$=1:V1/1; // set flag 1 on mondays

!!FU862y1/1/0/?y3/?y4; // get L1-Upgrades
!!CAv7/v8/v9&y4>0/1:M1/0/d/dy4; // add creatures to town
!!VRy5&y3<0:Sy3 *-1; // get positive value, if dwelling was upgraded the day before
!!FU862&y3<0y1/1/1/y5; // write this value back

!!FU862y1/2/0/?y3/?y4; // get L2-Upgrades
!!CAv7/v8/v9&y4>0/1:M1/1/d/dy4; // add creatures to town
!!VRy5&y3<0:Sy3 *-1; // get positive value, if dwelling was upgraded the day before
!!FU862&y3<0y1/2/1/y5; // write this value back

!!FU862y1/3/0/?y3/?y4; // get L3-Upgrades
!!CAv7/v8/v9&y4>0/1:M1/2/d/dy4; // add creatures to town
!!VRy5&y3<0:Sy3 *-1; // get positive value, if dwelling was upgraded the day before
!!FU862&y3<0y1/3/1/y5; // write this value back

!!FU862y1/4/0/?y3/?y4; // get L4-Upgrades
!!CAv7/v8/v9&y4>0/1:M1/3/d/dy4; // add creatures to town
!!VRy5&y3<0:Sy3 *-1; // get positive value, if dwelling was upgraded the day before
!!FU862&y3<0y1/4/1/y5; // write this value back

!!FU862y1/5/0/?y3/?y4; // get L5-Upgrades
!!CAv7/v8/v9&y4>0/1:M1/4/d/dy4; // add creatures to town
!!VRy5&y3<0:Sy3 *-1; // get positive value, if dwelling was upgraded the day before
!!FU862&y3<0y1/5/1/y5; // write this value back

!!FU862y1/6/0/?y3/?y4; // get L6-Upgrades
!!CAv7/v8/v9&y4>0/1:M1/5/d/dy4; // add creatures to town
!!VRy5&y3<0:Sy3 *-1; // get positive value, if dwelling was upgraded the day before
!!FU862&y3<0y1/6/1/y5; // write this value back

!!FU862y1/7/0/?y3/?y4; // get L7-Upgrades
!!CAv7/v8/v9&y4>0/1:M1/6/d/dy4; // add creatures to town
!!VRy5&y3<0:Sy3 *-1; // get positive value, if dwelling was upgraded the day before
!!FU862&y3<0y1/7/1/y5; // write this value back
*********


--------------------------Dialog to build gold reserve-----------------------------
!?FU860;
** x1 - town
** x2 - owner
** y1 - players gold
** y2 - players mithril
** y3 - already built reserves
** y4 - amount of gold you already get
** y5 - gold price for the next upgrade
** y6 - mithril price for the next upgradee

!!CA0/x1:B3/12 T?y99; // check for city hall and get type
!!CA0/x1&-1:B3/13; // check for capitol
!!VRy99:+22; // add 22 to get the correct building number for IF:Q
!!IF&-1:Q1/y99/12/1/z145014; // message: you need at least city house
!!FU&-1:E; // and exit, if it is not built

!!OW:Rx2/6/?y1 Rx2/7/?y2; // get amount of players gold and mithril to y1/y2
!!FU862x1/0/0/?y3/?y4; // get current number of built reserves to y3, y4=amount of gold earned

!!IF:V2/0; !!IF&y3<0:V2/1; // set flag 2, if already built today
!!VRz1:Sz145011; // current number of gold by reserve (status)
!!VRz1&2:+z145012; // msg: you have already built today
!!VRy4&2:*-1; // negative value for correct picture
!!IF&2:Q1/6/y4/1/z1; // show message
!!FU&2:E; // and exit (if already built)

!!VRz1&y-5<>y-100:+z145023; [Msg: you only upgrade the gold reserve on your turn]
!!IF&y-5<>y-100:Q1/6/y4/1/z1; [Show message]
!!FU&y-5<>y-100:E; [Exit if not the player's turn]

!!VRy3:+1; // increase y3 by one to get the correct bit
!!FU$bit$y3; // get the xth power of 2 (1, 2, 4, 8, 16 ...), return in y-100
!!VRy5:S10000; // increase the price (gold) for each new gold reserve potentially (7000, 9500, 12000, 17000, 24500, 44500, 84000 ...)
!!VRy6:S1; // increase mithril linear (2, 3, 4, 5, 6 ...)

!!VRz1|y1<y5/y2<y6:+z145016 +z145015; // combine price info and not-enough-gold-message
!!IF|y1<y5/y2<y6:Q1/6/y5/7/y6/1/z1; // show message
!!FU|y1<y5/y2<y6:E; // and exit

!!VRz1:+z145013; // add: Ask to upgrade
!!IF:Q2/6/y5/7/y6/2/z1; // show question (get answer to flag 2)
!!FU&-2:E; // exit, if no chosen

!!VRy3:*-1; negate the value of built reserves (to prevent further upgrades today)
!!FU862&2x1/0/1/y3; // increase number of gold resources in the town
!!VRy1:-y5; !!VRy2:-y6; // substract gold / mithril from the players gold / mithril
!!OW:Rx2/6/y1 Rx2/7/y2; // remove the gold and mithril

***********************


!?FU861; // get price of a simple upgrade, return in v1-v7
!!VRv1&x1=0/x2=1:C0/0/7/0/0/0/1000/5; //pikeman
!!VRv1&x1=0/x2=2:C5/0/5/0/0/0/1500/4; //archers
!!VRv1&x1=0/x2=3:C0/0/5/0/0/0/2500/3; //griffins
!!VRv1&x1=0/x2=4:C0/0/5/0/5/0/2500/2; //swordman
!!VRv1&x1=0/x2=5:C5/2/5/2/2/2/3000/2; //monk
!!VRv1&x1=0/x2=6:C10/0/0/0/0/0/5000/1; //cavalier
!!VRv1&x1=0/x2=7:C0/10/0/10/10/10/6000/1; //angel

!!VRv1&x1=1/x2=1:C7/0/0/0/0/0/1000/5; //centaur
!!VRv1&x1=1/x2=2:C0/0/5/0/0/0/2000/4; //dwarf
!!VRv1&x1=1/x2=3:C5/0/0/0/0/0/2500/3; //elf
!!VRv1&x1=1/x2=4:C0/0/5/0/5/0/2500/2; //pegasi
!!VRv1&x1=1/x2=5:C5/0/0/0/0/0/4200/2; //dendroid
!!VRv1&x1=1/x2=6:C5/0/5/0/0/5/4500/1; //unicorn
!!VRv1&x1=1/x2=7:C0/0/15/0/10/0/10000/1; //dragon

!!VRv1&x1=2/x2=1:C5/0/5/0/0/0/1000/5; //gremlin
!!VRv1&x1=2/x2=2:C0/0/10/0/0/0/1200/4; //gargobli
!!VRv1&x1=2/x2=3:C3/3/3/0/0/0/2000/3; //golem
!!VRv1&x1=2/x2=4:C0/3/0/3/3/3/2200/2; //magi
!!VRv1&x1=2/x2=5:C0/5/0/0/5/5/2500/2; //genie
!!VRv1&x1=2/x2=6:C5/2/5/2/2/2/4500/1; //nagas
!!VRv1&x1=2/x2=7:C10/0/10/0/0/15/6000/1; //titan

!!VRv1&x1=3/x2=1:C4/0/4/0/0/0/1000/5; //imps
!!VRv1&x1=3/x2=2:C0/5/5/0/0/0/1250/4; //gog
!!VRv1&x1=3/x2=3:C5/0/0/5/0/0/1750/3; //cerbers
!!VRv1&x1=3/x2=4:C5/0/5/0/0/0/2700/2; //demon
!!VRv1&x1=3/x2=5:C0/5/0/5/0/0/3000/2; //pit
!!VRv1&x1=3/x2=6:C0/5/10/5/5/5/3500/1; //efreet
!!VRv1&x1=3/x2=7:C10/10/10/0/0/0/8000/1; //devils

!!VRv1&x1=4/x2=1:C0/0/7/0/0/0/1000/5; //skeleton
!!VRv1&x1=4/x2=2:C5/0/5/0/0/0/1500/4; //zombie
!!VRv1&x1=4/x2=3:C3/3/3/0/0/0/2000/3; //wights
!!VRv1&x1=4/x2=4:C5/0/5/0/10/10/2500/2; //vampire
!!VRv1&x1=4/x2=5:C0/0/5/5/0/0/3200/2; //lich
!!VRv1&x1=4/x2=6:C10/2/10/2/2/2/5000/1; //knights
!!VRv1&x1=4/x2=7:C5/10/5/5/5/5/7000/1; //dragon

!!VRv1&x1=5/x2=1:C7/0/0/0/0/0/1000/5; //troglodyte
!!VRv1&x1=5/x2=2:C0/0/0/2/2/0/2000/3; //harpies
!!VRv1&x1=5/x2=3:C0/2/0/2/2/2/2000/3; //eyes
!!VRv1&x1=5/x2=4:C5/0/10/0/0/0/2500/2; //medusa
!!VRv1&x1=5/x2=5:C0/0/10/0/0/10/2500/2; //minotaur
!!VRv1&x1=5/x2=6:C5/5/5/5/0/0/4000/1; //manticore
!!VRv1&x1=5/x2=7:C9/0/9/10/0/0/10000/1; //drg

!!VRv1&x1=6/x2=1:C5/0/5/0/0/0/1000/5; //goblin
!!VRv1&x1=6/x2=2:C10/0/5/0/0/0/1000/4; //wolf
!!VRv1&x1=6/x2=3:C5/0/5/0/0/0/2200/3; //orc
!!VRv1&x1=6/x2=4:C5/0/5/0/0/5/2200/2; //ogre
!!VRv1&x1=6/x2=5:C5/0/10/0/0/10/2200/2; //roc
!!VRv1&x1=6/x2=6:C5/0/10/0/10/0/3000/1; //cyclop
!!VRv1&x1=6/x2=7:C5/0/5/0/10/0/10000/1; //behemoth

!!VRv1&x1=7/x2=1:C7/0/0/0/0/0/1000/5; //gnoll
!!VRv1&x1=7/x2=2:C5/0/0/0/0/0/2000/4; //lizard
!!VRv1&x1=7/x2=3:C0/3/0/3/0/0/2200/3; //flies
!!VRv1&x1=7/x2=4:C0/0/10/0/0/5/2000/2; //bas
!!VRv1&x1=7/x2=5:C10/0/10/0/0/10/2000/2; //gorgons
!!VRv1&x1=7/x2=6:C10/10/0/0/0/0/3500/1; //wyvern
!!VRv1&x1=7/x2=7:C10/0/10/10/0/0/7000/1; //hydra

!!VRv1&x1=8/x2=1:C5/0/5/0/0/0/1000/6; //sprites
!!VRv1&x1=8/x2=2:C2/2/5/0/0/2/2000/3; //air
!!VRv1&x1=8/x2=3:C0/5/5/0/0/0/2000/3; //water
!!VRv1&x1=8/x2=4:C5/5/5/0/0/5/2000/2; //fire
!!VRv1&x1=8/x2=5:C0/0/10/5/0/0/3000/2; //earth
!!VRv1&x1=8/x2=6:C5/3/5/3/3/3/4000/1; //magic
!!VRv1&x1=8/x2=7:C10/10/10/0/0/0/5000/1; //phoenix
***********************


----------------------------- AI upgrades town ---------------------------------

!?FU863; // tries to  build / upgrade a random dwelling (or Gold Reserve) in every 2nd AI-town
!!VRy1:Sx2 -1; // correct number of total towns for further usage
!!VRy2:S0 Ry1; // random town
!!FU864x1/y2; // build / upgrade a random dwelling (or Gold Reserve) there
*********


!?FU864;
** x1 - the last player ($lastplayer$)
** x2 - town number in players list

** y1 - real town number on the map
** y2 - random 0-2, if 0 AI builds a gold reserve (33% chance), if > 0 it upgrades a dwelling
** y3 - random 0 = town hall, 1-7 the dwelling to upgrade
** y4 - already build upgrades
** y5 - town type
** y6 - bonus creatures for one dwelling upgrade (depends on level y3)

** y21-y28 - players resources

!!OW:Wx1/x2/?y1; // get the real town number on the map
!!FU|y1<0/y1>48:E; // exit, if town is out of range (should never happen)
!!VRy2:S0 R2; // random 0-2
!!VRy3&y2>0:S1 R6; // if y2 is not 0: get random dwelling (1-7)  (means: Gold Reserve has a chance of 33% to built, dwelling 66%)

!!CA0/y1:B3/12; !!CA0/y1&-1:B3/13; // check, if cityhall or capitol are built
!!FU&y2=0/-1:E; // exit, if not and random = GRes

!!OW:Rx1/0/?y21 Rx1/1/?y22 Rx1/2/?y23 Rx1/3/?y24 Rx1/4/?y25 Rx1/5/?y26 Rx1/6/?y27 Rx1/7/?y28; // get players resources
!!FU862y1/y3/0/?y4/?y5; // check, how much of the random GRes / Dwelling are already build, return in y4 (y5 is a dummy)
!!FU&y4>7:E; // exit, if there are already 7 upgrades of the chosen type in this town
!!VRy4&y2=0/y27>6999/y28>1:+1; // increase number of GRes, if player has 7000 gold and 2 mithril
!!OW&y2=0/y27>6999/y28>1:Rx1/6/d-6000 Rx1/7/d-2; // take the resources (takes only 6000 gold, because he gets 1000 back from the GRes)
!!FU862&y2=0/y27>6999/y28>1y1/0/1/y4; // set the new number of GRes
!!FU&y2=0:E; // exit, if AI "chose" to upgrade the gold reserve

!!VRy99:Sy3+36; // get building number for the upgraded dwelling
!!CA0/y1:B3/y99; // check, if it is built
!!FU&-1:E; // exit, if not

!!CA0/y1:U?y5; // get town type
!!VRy3:-1; // correct dwelling (to get 0..6 instead of 1..7)
!!FU861y5/y3; // get costs for the dwelling upgrade to v1-v7
!!FU|y21<v1/y22<v2/y23<v3/y24<v4/y25<v5/y26<v6/y27<v7:E; // exit, if player has not enough resources

!!VRy4:+1; // increase dwelling upgrade by one
!!FU862y1/y3/1/y4; // set the new value
!!VRy21:-v1; !!VRy22:-v2; !!VRy23:-v3; !!VRy24:-v4; !!VRy25:-v5; !!VRy26:-v6; !!VRy27:-v7; // take resources
!!OW:Rx1/0/y21 Rx1/1/y22 Rx1/2/y23 Rx1/3/y24 Rx1/4/y25 Rx1/5/y26 Rx1/6/y27; // write reduced resources back
!!FU&$weekday$<>$monday$:E; // exit, if not monday

!!VRy6:Sy3 *-1 +8; // get number of bonus creatures for this level
!!CA0/y1:M1/y3/d/dy6;// add them (necessary on monday, because the usual bonus-routine is already ran and we simulate, that the AI built at the end of the day before
*********

-----------------------------Get / set current values---------------------------------
!?FU862;
** x1 = number of town
** x2 = index of building (0 if hall 1-7 dwellings)
** x3 = if 0 then get (return in x4, if 1 then set to x4)
** x4 = return value / new value
** x5 = returns the bonus for gold or creatures (ignored if x3 = 1)
!!VRy1:Sx1 *8 +1600 +x2;               ;index of variable where saved
!!VRvy1&x3=1:Sx4; // set value
!!FU&x3=1:E; // exit, if set-call

** get values
!!VRy2:Svy1; // the number of built upgrades
!!VRx4:Sy2; // return this number in x4
!!VRy2&y2<0:*-1; // correct, if negative value (sign, that is built today)
!!VRx5&x2=0:S1000 *y2; // city hall
!!VRx5&x2>0:Sx2 *-1 +8 *y2; // dwellings: 7 for each L1, 6 for each L2 ... 1 for each L7
***********************

____________

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


Legendary Hero
Therefore I am
posted August 26, 2020 05:58 PM

Hi!

!!MA:A196/32 D196/32 P196/300 M196/56 E196/80 S196/4 C196/6/4000 C196/4/2 G196/2 N196/8;

Why C196/4/2 doesn't work? When another scripts

!!MA:A193/28 D193/28 P193/100 M193/40 E193/68 S193/14 C193/6/4000 C193/1/2 G193/2 N193/4;

It works.. What is wrong with C196/4/2? Can you give me full script? Thanks

EDIT: I can't remember, and my WoG scripts note in broken hard disk.
____________
Fight MWMs - stand teach

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


Promising
Famous Hero
Researching Magic
posted August 26, 2020 10:02 PM
Edited by RerryR at 22:05, 26 Aug 2020.

3300330033 said:
hi,everyone!! I play era 2.46 with new castle upgrading script but i found it didn't work, Can you help me to make this work?



Try this script. It is castle upgrading mod with increasing costs.

https://dropmefiles.com/wNzvr

@Ghost
maybe this:
"  If you set more than one other resource (0...5) the only the first one will be used.
 If you want to change a second resource (in addition to gold) from one to another, set the previous resource to 0."

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


Legendary Hero
Therefore I am
posted August 26, 2020 10:46 PM

@RerryR

Mercury can't change a crystal or other. Now's C196/1/2. I'm satisfied with solution. Thx
____________
Fight MWMs - stand teach

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


Responsible
Supreme Hero
posted August 27, 2020 11:56 AM

I've seen in the ERA III thread a feature where Magogs were made to not attack allied forces with the Fireball attack. Was this made through ERM? Is it possible to do this on previous versions as well (like v2.75)?
____________
Not idly do the leaves of Lorien fall.

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


Promising
Famous Hero
Researching Magic
posted August 27, 2020 12:05 PM

Hero_of_Light said:
I've seen in the ERA III thread a feature where Magogs were made to not attack allied forces with the Fireball attack. Was this made through ERM? Is it possible to do this on previous versions as well (like v2.75)?


Yes it was made with ERM. Should work in 2.75 as well. Just try it out.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This Popular Thread is 384 pages long: 1 2 3 4 5 ... 80 160 240 320 ... 380 381 382 383 384 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.2181 seconds