|
|
Hero_Of_Light
Responsible
Supreme Hero
|
posted November 08, 2014 11:49 PM |
|
|
OK thanks!
____________
Not idly do the leaves of Lorien fall.
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted November 09, 2014 12:56 AM |
|
|
Quote: All I need is these third upgrades:
Creature 142 to 49
Creature 85 to 87
Creature 101 to 173
Creature 57 to 56
Creature 86 to 140
And the four Elementals (112-115) all to upgrade to Storm Elementals (127).
In all towns, or specific towns for each of them?
____________
Era II mods and utilities
|
|
bbvsdd2
Tavern Dweller
|
posted November 09, 2014 01:08 AM |
|
|
Salamandre said: Just paste it for each def you want to redirect, knowing that:
!!SN:L^era.dll^/?y1 Ay1/^RedirectFile^/?y2 Ey2/1/^My old.def^/^My new.def^;
There are heavy restrictions still. You can't redirect maps objects graphics during game. Also in battle you can't redirect once battle started, but can before battle (or in BA trigger, not sure). To be able to replace one def by another, the def must not be loaded by the game at that time, up to you to test various combinations.
Salamandre, do you have an example of code that changes the appearence of a DEF file for each battle? (say your commander have 1 appearance if the hero is a magic class, but has another appearance if the hero is a might class? )
|
|
Hero_Of_Light
Responsible
Supreme Hero
|
posted November 09, 2014 01:27 AM |
|
|
I want these upgrades in these towns:
Inferno and Upg Demon Gate built
Creature 142 to 49
Necropolis and upgraded Horde dwelling for Skeletons built
Creature 57 to 56
Stronghold and Upg Horde dwelling for Goblins built
Creature 85 to 87
Stronghold and Upg Wolf Pen built
Creature 86 to 140
Fortress and Upg Lizard Den built
Creature 101 to 173
Conflux and Upg Fire Elemental built
All four Elementals (112-115) to upgrade to Storm Elementals (127)
____________
Not idly do the leaves of Lorien fall.
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted November 09, 2014 02:10 AM |
|
|
bbvsdd2, such things require multiple checks, there is no one line matter.
First you must find each hero's class:
!?BA0&1000;
!!BA:H0/?y1 H1/?y2; get left/right hero
!!HEy1:B2/?y1; get left hero class
!!HEy2&y2>-1:B2/?y2; get right hero class
!!VRy1:%2; [will be 0 if might class, 1 if magic]
!!VRy2&y2>-1:%2;
;and now that you know who is left/right, you put conditions in redirect code, perform loops through all 41 stacks, find the creature to change, then check if both heroes are magic/might then find 2 defs to replace, and so on.
|
|
bbvsdd2
Tavern Dweller
|
posted November 09, 2014 06:36 AM |
|
|
Thank you, Salamandre. I reversed engineered your code and managed what I was trying to code. I don't know what this forum would become without you!
|
|
bloodsucker
Legendary Hero
|
posted November 09, 2014 08:50 AM |
|
|
Salamandre Thank you for all the help, at this moment every single cheat I wanted to add to my own game is already done or at least started and what I'm doing now I'm doing it cause I've some ERM virus on me and I really want to explore this more. So, the last thing I want is for you to make the mod for me, even if I thank all the help and the amazing learning oportunity that is beyond Trainer, Adventure Pillars and some other mods, even Conquistador Leaders. You have at one point or another coded almost everything I need to know and look for that, see how it is done and try it for myself is the most important part of the learning process.
I have a basic doubt you may have already work with: as you may have notice all my onw creatures have Immunity to Dispel. It is of extreme importance that they are "immune to dispel benefical spells" cause I use Second Henchman and to the end of the game it is normal I enter a fight with 8 benefical spells on every creature and maybe also using the AoD, so the enemy gets 4 negative. The last thing I want in this case is enemy first spell to be Dispel.
But while I have a line similar to these one in every troop in my army,
!!EA136:B6/1/119/78/0/0/0/0/1/1/1/1/1/1/1; Immune to dispel benefical
right now and not for the first time, a level one random hero has dispel them all (magic plains due to Change-Terrain script). Do you know what's going on? I remember to read something about virtual Spheres of Permanency, so maybe it's a known bug but as far as I know it was working in TDS.
|
|
bbvsdd2
Tavern Dweller
|
posted November 09, 2014 05:17 PM |
|
Edited by bbvsdd2 at 17:22, 09 Nov 2014.
|
bbvsdd2 said:
Salamandre said: Just paste it for each def you want to redirect, knowing that:
!!SN:L^era.dll^/?y1 Ay1/^RedirectFile^/?y2 Ey2/1/^My old.def^/^My new.def^;
There are heavy restrictions still. You can't redirect maps objects graphics during game. Also in battle you can't redirect once battle started, but can before battle (or in BA trigger, not sure). To be able to replace one def by another, the def must not be loaded by the game at that time, up to you to test various combinations.
Salamandre, do you have an example of code that changes the appearence of a DEF file for each battle? (say your commander have 1 appearance if the hero is a magic class, but has another appearance if the hero is a might class? )
Salamandre, I now try to redirect spell scroll icons during combat only, although the icon is possibly already loaded in adventure screen. Is that possible? I am having no problem with spell animation but the icons won't be redirected.
I already have loaded revised spells.def and spellint.def into the pac file but the old icons were still in the combat.
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted November 09, 2014 06:23 PM |
|
|
If you use the right code and it does not work, means icons are already loaded. I specified this in my first answer to you.
____________
Era II mods and utilities
|
|
Hero_of_Light
Responsible
Supreme Hero
|
posted November 10, 2014 01:01 PM |
|
|
@Salamander
I had an idea on how to make third upgrades for creatures possible. I'll try to explain through an example.
Let's say we want to upgrade Hobgoblins to Wolf Riders. We start by this command.
!!MA:U85/87;
Then we need this commands:
1st check IF mouse click on creature
2nd check which creature (if not Hobgoblins then exit)
3rd check if in Stronghold town
4th check if appropriate building is built (in this case building 19)
If all of these are true then all you have to do is to apply this command:
!!UN:T6/0/0/85; [Hobgoblins are recruited from slot 1]
!!UN:T6/0/1/87; [Wolf Riders are recruited from slot 2] <-- this may not be necessary
This will give the Hobgoblins in town the abbility to upgrade to Wolf riders since it is like they are meant to be upgraded this way.
In the end when player clicks OK and the creature window is closed there will need to be a command that restores the creatures slots in original states.
What do you think? Do you think it might work? This will give modders the abbility to add third upgrades for creatures in any town and I think it is a nice addition. Do you think you can make it happen?
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted November 10, 2014 08:21 PM |
|
|
This is how it works, as I adapt universal upgrades to your mod. I am done, but needs more testing, will tell you when is ready, is quite long script.
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted November 10, 2014 10:51 PM |
|
|
HoL
Here is what I can do. Those upgrades leaves both me and game mechanics perplex so the results may be a bit different from what you ask.
It is not possible to upgrade all elementals just by upgrading the Altair of fire, for each upgrade the creatures must be assigned a different level, so each elemental needs its building to upgrade. Same thing for skeletons, to "upgrade" skeleton warrior to skeleton (in fact this is downgrade) you need to upgrade skeleton dwelling. So I leaved both unearthed graves and skeletons dwelling as condition, up to you to remove one of them.
I can't do different, I am not familiar with those hack scripts and their area of application does not interest me much, sorry.
ZVSE
!?PI;
!!MA:U142/49;
!!MA:U85/87;
!!MA:U101/173;
!!MA:U57/56;
!!MA:U86/140;
!!MA:U113/127;
!!MA:U114/127;
!!MA:U115/127;
!?CM1;
!!FU330000:P;
!?FU330000;
!!CA-1:T?y1; [Town type: y1]
!!CM:I?y2; [Position clicked: y2]
[Check creature types]
!!CA-1:P?y3/?y4/?y5; [Town's position: y3/y4/y5]
!!POy3/y4/y5:O?y6; [PO:O: y6]
!!FU330200&y6>0/y6<8:Py1; [Restore creatures unless nothing is stored yet]
[Set creature to be upgraded (if upgraded creature dwelling is built)]
!!FU330100&y2>=115/y2<=121:Py1/y2; [Garrison slots]
!!FU330100&y2>=140/y2<=146:Py1/y2; [Visiting hero slots]
[Determine which creature is clicked]
[x1=town type, x2=position clicked]
!?FU330100;
!!VRy1:S-1; !!VRy2:S-1;
!!VRy1&x2>=115/x2<=121:Sx2 -115; [Garrison creature slot number: y1]
!!VRy2&x2>=140/x2<=146:Sx2 -140; [Visiting hero creature slot number: y2]
[Determine creature type: y5]
!!CA-1:H0/?y3 H1/?y4; [Garrison hero: y3, Visiting hero: y4]
!!HEy3&y3>=0/y1>=0:C0/y1/?y5/d; [Garrison hero creature: y5]
!!CA-1&y3<0/y1>=0:M2/y1/?y5/d; [Garrison creature: y5]
!!HEy4&y4>=0/y2>=0:C0/y2/?y5/d; [Visiting hero creature: y5]
!!FU&y5<>142/y5<>85/y5<>101/y5<>57/y5<>86/y5<>112/y5<>113/y5<>114/y5<>115:E;
!!MA:Uy5/?y7; [Check for a custom upgrade: y7]
[Default upgrade for all towns except Conflux]
!!VRy6&y7=-1/y5<=111:Sy5 %2; [Remainder of creature number divided by 2: y6]
!!VRy7&y7=-1/y5<=111/y6=0:Sy5 +1; [If non-upgraded, upgrade is y7]
[Default upgrade for Conflux]
!!VRy7&y7=-1/y5=112:S127; [Air Elemental]
!!VRy7&y7=-1/y5=113:S125; [Earth Elemental]
!!VRy7&y7=-1/y5=114:S129; [Fire Elemental]
!!VRy7&y7=-1/y5=115:S123; [Water Elemental]
!!VRy7&y7=-1/y5=118:S119; [Pixie]
!!VRy7&y7=-1/y5=120:S121; [Psychic Elemental]
!!VRy7&y7=-1/y5=130:S131; [Firebird]
!!VRy6:S1; [Initialize y6 to 1]
!!VRy6&y7>=0:S0; [Set y6 to 0 if y7>=0]
!!FU|y6=1/y7=-2:E; [Exit if no upgrade]
!!MA:Ly5/?v3302; [Store creature's level in v3302/v3]
!!if&y5=142:;
!!CA-1:T?y1;
!!FU&y1<>3:E;
!!CA-1:B3/40;
!!IF&-1:Q1/21/142/21/49/25/40/1^You need to build upgraded Demon Gate to enable a third upgrade for this creature.^;
!!FU&-1:E;
!!VRv3302:S3;
!!en:;
!!if|y5=85/y5=86:;
!!CA-1:T?y1;
!!FU&y1<>6:E;
!!CA-1&y5=85:B3/18;
!!IF&y5=85/-1:Q1/21/85/21/87/28/18/1^You need to build the Mess Hall Pen to enable a third upgrade for this creature.^;
!!FU&y5=85/-1:E;
!!CA-1&y5=86:B3/38;
!!IF&y5=86/-1:Q1/21/86/21/140/28/38/1^You need to upgrade the Wolf Pen to enable a third upgrade for this creature.^;
!!FU&y5=86/-1:E;
!!en:;
!!if&y5=101:;
!!CA-1:T?y1;
!!FU&y1<>7:E;
!!CA-1:B3/38;
!!IF&-1:Q1/21/101/21/173/29/38/1^You need to upgrade the Lizard Den to enable a third upgrade for this creature.^;
!!FU&-1:E;
!!en:;
!!if&y5=57:;
!!CA-1:T?y1;
!!FU&y1<>4:E;
!!CA-1:B3/18;
!!IF&-1:Q1/21/57/26/37/26/18/1^You need to build the Unearthed Graves and upgrade the Cursed Temple to enable a third upgrade for this creature.^;
!!FU&-1:E;
!!en:;
!!if&y5>112/y5<116:;
!!CA-1:T?y1;
!!FU&y1<>8:E;
!!VRy2&y5=113:S41;
!!VRz1&y5=113:S^Earth^;
!!VRy2&y5=114:S39;
!!VRz1&y5=114:S^Fire^;
!!VRy2&y5=115:S40;
!!VRz1&y5=115:S^Water^;
!!CA-1:B3/y2;
!!IF&-1:Q1/21/y5/21/127/30/y2/1^You need to upgrade the Altair of %Z1 to enable a third upgrade for this creature.^;
!!FU&-1:E;
!!en:;
!!VRv3300:Sy5; [Store creature number: v3300]
!!MA:Oy5/?v3301; [Store creature's town type in v3301]
!!MA:Oy5/x1; [Change creature to this town type]
!!VRv3310:Sy7; [Store upgraded creature number: v3310]
!!MA:Oy7/?v3311; [Store upgraded creature's town type in v3311]
!!MA:Ly7/?v3312; [Store upgraded creature's level in v3312]
!!MA:Oy7/x1; [Change upgraded creature to this town type]
[Check & Store creature type and level]
!!CA-1:P?y13/?y14/?y15; [Town's position: y13/y14/y15]
!!POy13/y14/y15:B0/?y16 B1/?y17 O?y18; [PO:B0: y16 PO:B1: y17 PO:O: y18]
!!VRy9:Sy18 -1; [Subtract 1 from y18 to get real creature level: y9]
!!UN&v3302<>y9:Tx1/v3302/0/?y18; [If this level not stored, get non-upgraded type: y18]
!!UN&v3302<>y9:Tx1/v3302/1/?y19; [If this level not stored, get upgraded type: y19]
!!VRy10&v3302<>y9:Sy18 +1; [Non-upgraded type +1: y10]
!!VRy11&v3302<>y9:Sy19 +1; [Upgraded type +1: y11]
!!VRy12&v3302<>y9:Sv3302 +1; [Creature level +1: y12]
!!POy13/y14/y15&v3302<>y9:B0/y10; [If this level not stored, store non-upgraded type (+1)]
!!POy13/y14/y15&v3302<>y9:B1/y11; [If this level not stored, store upgraded type (+1)]
!!POy13/y14/y15&v3302<>y9:Oy12; [If this level not stored, store creature level (+1)]
[Set this town's creature of this level]
!!UN:Tx1/v3302/0/y5; [Set non-upgraded creature]
!!UN:Tx1/v3302/1/y7; [Set upgraded creature]
------------------------------------------------------------------------------------------------------------------
[Reset changed town creature types]
!?FU330200;
!!CA-1:P?y1/?y2/?y3; [Town's position: y1/y2/y3]
[Creature type: y4 (non-upgraded) and y5 (upgraded), y6 (level)]
!!POy1/y2/y3:B0/?y4 B1/?y5 O?y6; [PO:B0: y4 PO:B1: y5 PO:O: y6]
!!VRy4&y4>0:-1; [Subtract 1 from y4 to get non-upgraded creature number]
!!VRy5&y5>0:-1; [Subtract 1 from y5 to get upgraded creature number]
!!VRy6&y6>0:-1; [Subtract 1 from y6 to get creature level]
!!UN&y4>=0:Tx1/y6/0/y4; [Reset non-upgraded]
!!UN&y5>=0:Tx1/y6/1/y5; [Reset upgraded]
!!FU&v3300<0:E; [Exit function if no creature changed]
[Restore creature: v3300]
!!MA:Ov3300/v3301; [Restore creature's town type]
[Restore upgraded creature: v3310]
!!MA:Ov3310/v3311; [Restore upgraded creature's town type]
[Reset v3300 to -1]
!!VRv3300:S-1;
____________
Era II mods and utilities
|
|
Hero_of_Light
Responsible
Supreme Hero
|
posted November 11, 2014 02:44 PM |
|
|
Thanks it worked! It does have some minor setbacks though, but I think theycould be easily solvable. I would really appreciate it If you could help me out since this could make my mod independable from other WoG options and I would really like that.
First of all I don't understand the need for the messages when the building isn't built (You need to build upgraded Demon Gate to enable a third upgrade for this creature.. etc). I already mention it on the building description so I think it is unecessary. Can you please remove these functions?
Secondly, there are some problems with the script.
While it seems to work OK, the Elementals all upgrade in ANY town, just as it did with the universal Upgrades mod. Do you think you can fix this? I only want them to upgrade in Conflux.
As for the problem about the 4th Elemental building upgrading all the elementals can you make it like this?
Air Elementals upgrade to Storm when building 40 is built.
Fire Elementals upgrade to Storm when building 38 is built.
Water Elementals upgrade to Storm when building 39 is built.
Earth Elementals upgrade to Storm when Sprites (upg Horde) building is built (I think it is building 19?).
And once again remove the popup scripts about the upgrade.
Last but not least, the Skeletons are not a downgrade. Like the Boars with the nomads (85 to 140), I want them to be interghangeable and so they can be upgraded back and forth.
I tested it and if the upgraded unearthed graves WASN'T built then the upgrade doesn't happen (even if the upg dwelling is built).
So If you can make the Skeleton Warriors upgrade to Skeletons when EITHER the upg skeleton dwelling OR the Horde building is built. If you cannot do it to work on both conditions then just make it work with unearthed graves only, it will still be OK.
Again, thanks a lot for your time! If you could solve these minor issues then it would be flawless. I appreciate your help!
____________
Not idly do the leaves of Lorien fall.
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted November 11, 2014 03:13 PM |
|
|
No I can't. This is what I explain you: universal upgrades (which I used as base) isn't about upgrading things randomly. You need to have the corresponding dwelling upgraded. So in order to "upgrade" skeletons warriors to skeletons, you need skeleton dwelling upgraded, not unearthed graves. For elementals, you need their dwelling, so to upgrade earth to storm, you need earth altair and so on. Game mechanics look for creature level, in order to enable that upgrade button. Elementals are level 2-5, sprites are level 1, I can't set condition for upgrading level 2-5 as first level dwelling.
For the messages, just remove all lines !!IF&-1:Q[message], they are there in case you need them, and as testing stuff.
In my test, I can't upgrade elementals other than conflux (there is a condition in script). Can you post a save doing that, please?
|
|
Hero_of_Light
Responsible
Supreme Hero
|
posted November 11, 2014 07:06 PM |
|
|
OK I see. It's no big deal really about the Skeletons. As for the Elementals I fixed them by making them all count as level 4 monsters, they all upgrade when 4th upg building is present as it was intended.
So all is well, except that little bug, where the four elementals upgrade in all towns just like in Universal creatures upgrades.
I have prepared a save where you have a Stronghold town (in which the Goblins and Nomads upgrades work OK) and added a few Air Elementals.
I noticed a pecuiliar thing though that might help you. When double clicking on the Air Elementals they become Stronghold creatures and have their upgrade available no matter what building is present. It seems that the upgrade works in every other town unconditionally. Maybe it has something to do with the script I use in my mod I don't know.
Anyway, here it is.
____________
Not idly do the leaves of Lorien fall.
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted November 11, 2014 07:19 PM |
|
|
I can't even open your save, probably you use special plugins. Anyway, if elementals upgrade in all town, means you have some script which interfere. Because in my test, there is no way to do such.
You could add a debug message
!!IF:M^I am here^;
right after the elementals building check (FU&y1<>8:E;) and see if it displays. It should not, if other town.
____________
Era II mods and utilities
|
|
Orzie
Responsible
Supreme Hero
|
posted November 11, 2014 07:24 PM |
|
|
Warning - a total ERM noob itt.
Just a few questions about the WoG Sphinx.
I wonder if it is possible to modify the native WoG Sphinx code in such way that it would allow to set the custom riddle text and answers (in the perfect case - also the reward, i.e. resources and/or artifact, or even the full dialog a la Pandora's Box) directly in the map editor for each Sphinx separately, or at least using the standard event as a script holder. Frankly, the perfect option would be to have the full GUI in the map editor, but I doubt someone will want to make a fully functional patch, so at least a ERM script would be a great help.
|
|
Mister_kalu
Known Hero
|
posted November 11, 2014 07:25 PM |
|
|
sometimes i have an error message that says: CA is not a castle!! or something, and the CA under the 998 coordinates are right. it works with some receivers but with others not .
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted November 11, 2014 07:32 PM |
|
|
Orzie: directly in editor, not sure. But Sphinx has its own text file in lods, and changes can surely be made (mostly about riddles, rewards are hardcoded).
Kalu: inside the town screen you must use CA-1, outside CA998 or CA1. Often errors occur because people invert those commands.
____________
Era II mods and utilities
|
|
Hero_of_Light
Responsible
Supreme Hero
|
posted November 11, 2014 09:34 PM |
|
|
@Salamander
Actually, I noticed the bug only occurs with Air Elementals. When I try to upgrade Fire, Water and Earth in another town nothing happens and so the script works OK. You can test it for yourself and see if it happens on your game as well.
Maybe it has something to do about Air Elementals being upgraded to Storm as a default and so the part of the script that ressembles the one from Universal creatures upgrade kicks in and causes the problem. Maybe the solution is there?
In any case, even If you can't find the solution to this bug I am deeply gratefull. Even with this minor bug my mod is finally independent and I can enjoy heroes III with just the WoG options that I actually want to use (and not the obligatory that my mods needed all these years). Thanks again!
____________
Not idly do the leaves of Lorien fall.
|
|
|