|
|
igrik
Promising
Known Hero
|
posted April 07, 2017 07:47 PM |
|
|
majaczek said: Could you help me with orcs yona-like damage, anti-cavalry and yona-like "armoured" ? I want to replace Yona with new options to amethyst2. I don't mind network part or the thing they did to archers. (there would be table allowing to add the ability to any monster )
Try to do it yourself. You will see the addresses in the picture
|
|
szaman
Known Hero
|
posted April 08, 2017 12:49 AM |
|
Edited by szaman at 01:23, 08 Apr 2017.
|
Hey guys i need help...
I have added a gif and a voice to a object.
!?OB63/05;
!!VRz129:S^..Datatemp.gif^;
!!IF:B1/z129/1;
!!IF1;
!!VRz10:S^1901.wav^;
!!SNz10;
!?SN;
!!SN:S?z-10;
!!VRi:S0;
!!VRz-9:S^Mystery.wav^;
!!VRi&z-10=z-9:S1;
!?SN&i=1;
!!VRz-10:S^ZQUIET.WAV^;
!!SN:Sz-10;
The script works fine BUT it first enables the gif then the voice is there a way to combine it to one? So when i visit this object the gif and sound will play the same time?
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted April 08, 2017 08:03 AM |
|
|
Try to reverse order, first wav then gif, I think it should work.
|
|
majaczek
Supreme Hero
Work at Magic Dimmension
|
posted April 08, 2017 01:38 PM |
|
|
I made script for Alchemy. It would have nice Potions.
the problem is that each herb/ingredient is separate artifact, so it clutters backpack a lot. Herbs are artifacts 340-399 and can be collected by owner of SS Monasticism (extension of scholar) by making hero step (there is a chance each step).
Is there any method to increase Backpack size? or is there any trick to be able to store some of herbs outside of backpack but on hero?
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted April 08, 2017 02:00 PM |
|
|
Just create a virtual backpack, as Mop does in his mod then assign a variable to each ingredient. DL.
|
|
majaczek
Supreme Hero
Work at Magic Dimmension
|
posted April 08, 2017 07:16 PM |
|
|
Salamandre said: Just create a virtual backpack, as Mop does in his mod then assign a variable to each ingredient. DL.
Quote:
ZVSE
!?CM2;
!!CM:S?y1;!!FU&y1<>14:E; Must be Rightclick
!!HE-1:N?y3; !!CM:I?y2;
!!FU&y2<>77/y2<>78:E;
** Cleanup
!!SN:W^Virtual Backpack - Current Hero^/y3;
!!SN:W^Virtual Backpack - Current Page^/0;
!!SN:W^Virtual Backpack - Real Backpack Window - Slots Used^/0;
!!SN:W^Virtual Backpack - Virtual Backpack Content - Slots Used^/0;
!!DO55720/0/63/1:P;
!!DO55721/1/999/1:Py3;
!!DO55727/1/999/1:Py3;
!!if&y2=77:; Store in Virtual Backpack
!!DL28:N^0028_BackpackDlg.txt^;
!!DO55723/0/63/1:P;
!!DL28:S;
!!FU:E;
!!en:;
!!if&y2=78:; Store in Real Backpack
!!DL128:N^0128_BackpackDlg.txt^;
!!DO55726/0/63/1:P;
!!DL128:S;
!!FU:E;
!!en:;
!?DL; !!FU&v998<>28:E;
!!if&v999>=4000/v999<=4063:;
!!VRy16:Sv999 -4000;
!!SN:W^Virtual Backpack - Real Backpack Window - Slot %Y16^/?y99;
!!FU|y99=144/y99=145/y99<0:E;
!!if&v1000=14:;
!!VRz1:S^You can Store this Artifact in {Virtual Backpack}^;
!!IF:Q1/8/y99/4^%Z1^; !!FU:E;
!!en:;
!!if&v1000=13:;
!!SN:W^Virtual Backpack - Current Hero^/?y88;
!!SN:W^Hero %Y88 - Virtual Backpack - Artifact %Y99^/d1;
!!HEy88:A3/y99/1/0;
!!en:;
!!en:;
!!DL&v1000=13:C1;
!?DL; !!FU&v998<>128:E;
!!if&v999>=4000/v999<=4063:;
!!VRy16:Sv999 -4000;
!!SN:W^Virtual Backpack - Current Page^/?y77;
!!SN:W^Virtual Backpack - Virtual Backpack Window - Page %Y77 - Slot %Y16^/?y99;
!!FU|y99=144/y99=145/y99<0:E;
!!if&v1000=14:;
!!VRz1:S^You can Store this Artifact in {Real Backpack}^;
!!IF:Q1/8/y99/4^%Z1^; !!FU:E;
!!en:;
!!if&v1000=13:;
!!SN:W^Virtual Backpack - Current Hero^/?y88;
!!SN:W^Hero %Y88 - Virtual Backpack - Artifact %Y99^/?y66;
!!FU&y66<1:E; !!VRy66:-1;
!!SN:W^Hero %Y88 - Virtual Backpack - Artifact %Y99^/y66;
!!HEy88:Ay99;
!!en:;
!!en:;
!!DL&v1000=13:C1;
!?FU55720; Cleanup
!!SN:W^Virtual Backpack - Real Backpack Window - Slot %X16^/145;
!!DO55724/0/64/1:Px16;
!?FU55724;
!!SN:W^Virtual Backpack - Virtual Backpack Window - Page %X16 - Slot %X1^/145;
!?FU55721;
** x1 Hero
** x16 Artifact
!!HEx1:A2/x16/?y2/?y3;
!_!FU&y2=0/y3=0:E;
!!VRy4:Sy2 -y3;
!_!IF:M^ x16=%X16 y2=%Y2 y3=%Y3 y4=%Y4^;
!!FU&y4=0:E;
!!SN:W^Virtual Backpack - Real Backpack Window - Slots Used^/?y5;
!!VRy6:Sy5; !!VRy7:Sy5 +y4; !!DO55722/y6/y7/1:Px16;
!!SN:W^Virtual Backpack - Real Backpack Window - Slots Used^/y7;
!?FU55722;
** x1 artifact
** x16 position
!!SN:W^Virtual Backpack - Real Backpack Window - Slot %X16^/x1;
!?FU55723;
!!VRy16:Sx16 +4000;
!!SN:W^Virtual Backpack - Real Backpack Window - Slot %X16^/?y99;
!!DL28:Ay16/4/y99;
!?FU55725;
!!VRy16:Sx16 +4000;
!!SN:W^Virtual Backpack - Virtual Backpack Window - Page %X2 - Slot %X16^/?y99;
!!DL128:Ay16/4/y99;
!!SN:W^Virtual Backpack - Current Hero^/?y88;
!!SN:W^Hero %Y88 - Virtual Backpack - Artifact %Y99^/?y77;
!!HEy88:Ay99;
!!VRz1:S^%Y77^;
!!VRy55:Sx16 +7000;
!!DL128:Ay55/3/z1;
!?FU55726;
!!SN:W^Virtual Backpack - Current Page^/?y77;
!!DO55725/0/63/1:Py77;
!?FU55727;
** x1 Hero
** x16 Artifact
!!SN:W^Hero %X1 - Virtual Backpack - Artifact %X16^/?y77; !!FU&y77<1:E;
!!SN:W^Virtual Backpack - Virtual Backpack Content - Slots Used^/?y66;
!!VRy65:Sy66 :64; Page
!!VRy64:Sy66 %64; Slot on Page
!!SN:W^Virtual Backpack - Virtual Backpack Window - Page %Y65 - Slot %Y64^/x16;
!!SN:W^Virtual Backpack - Virtual Backpack Content - Slots Used^/d1;
Done but have some obvious bug. When getting out of Virtual Backpack, there goes artifacts with lock symbol and text "-2". Could you help?
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted April 08, 2017 07:33 PM |
|
|
The trigger !?DL is not correctly formulated, it should contain the number of dialogue + the item clicked. In the form you use, if any other activated mod uses other DL's, they will be all called.
Then, if you equip or unequip any artifact using erm codes, make sure you use the specific function for that, it is part of the HMS improved mod. Without this function, emptied slots will be locked.
!?FU338354; equip art
; x1 - hero or - 1 for current
; x2 - art type
; x3 - art subtype or -1 (usually for non-scrolls)
; x4 - slot or -1
!!UN:C6919480/4/?y1; [y1 - BASE]
!!VRy2:Sx1*1170+y1+136736; [y2 - pointer to hero structure]
!!VRy5:S3*4+10784128-4; [y5 - pointer to y3]
!!VRy3:Sx2; [artifact type = 5]
!!VRy4:Sx3; [set y4 to subtype]
!!SN:E5123184/2/y2/y5/x4;
!?FU338357; unequip art
; x1 - hero or - 1 for current
; x2 - slot
!!HE-1&x1=-1:N?x1;
!!UN:C6919480/4/?y1; [y1 - BASE]
!!VRy2:Sx1*1170+y1+136736; [y2 - pointer to hero structure]
!!SN:E5123648/2/y2/x2;
|
|
majaczek
Supreme Hero
Work at Magic Dimmension
|
posted April 08, 2017 07:41 PM |
|
Edited by majaczek at 19:56, 08 Apr 2017.
|
Salamandre said: The trigger !?DL is not correctly formulated, it should contain the number of dialogue + the item clicked. In the form you use, is any other activated mod uses other DL's, they will be all called.
It's not true
Quote:
!?DL; !!FU&v998<>128:E;
is equivalent of:
Quote:
!?DL&v998=128;
also there is only a problem with dialogue 128 not with 28 one. and perhaps it's not exactly in dialogue but in one of functions.
Could you pinpoint real issue? the locks placeholder work proper on 28 but wrong on 128. I checked that "-2" is the name of artifact 145.
EDIT: I found workaround:
Quote:
!!HEy3:A-144 A-145;
|
|
majaczek
Supreme Hero
Work at Magic Dimmension
|
posted April 08, 2017 10:44 PM |
|
|
Quote:
!!SN:L^Era.dll^/?y1 Ay1/^GetButtonID^/?y2 Ey2/0/^Knightmare.Backpack.PutIntoVirtual^;
!!SN:L^Era.dll^/?y1 Ay1/^GetButtonID^/?y2 Ey2/0/^Knightmare.Backpack.PutIntoReal^;
Where is stored result of the button check? (which variable)
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted April 08, 2017 10:47 PM |
|
|
I think is v1, try debug.
|
|
majaczek
Supreme Hero
Work at Magic Dimmension
|
posted April 08, 2017 11:02 PM |
|
Edited by majaczek at 19:50, 11 Apr 2017.
|
Salamandre said: I think is v1, try debug.
Seems to work :)
EDIT: Done fully working virtual backpack.
only 2 problems left:
- support of spell scrolls
- support of battle loser
Could you provide exact code to check if current hero lost battle (no flee and no surrender) against another hero? I will be gratefull.
EDIT: fixed problems with scrolls
EDIT: Is it good code?
Quote:
!?FU55731;
***** move all artifacts of type x16
***** from hero x1 virtual backpack
***** to hero x222 virtual bckpack
** x1 - source hero
** x2 - target hero
** x16 - artifact
!!SN:W^Hero %X1 - Virtual Backpack - Artifact %X16^/?y11;
!!SN:W^Hero %X2 - Virtual Backpack - Artifact %X16^/?y12;
!!VRy12:+y11; !!VRy11:S0;
!!SN:W^Hero %X1 - Virtual Backpack - Artifact %X16^/y11;
!!SN:W^Hero %X2 - Virtual Backpack - Artifact %X16^/y12;
!?BA52; Begin of battle
!!BA:H0/?y90 H1/?y91;
!_!FU&y91=-2:E;
!!SN:W^Virtual Backpack - Battle - Attacker Hero^/y90;
!!SN:W^Virtual Backpack - Battle - Defender Hero^/y91;
!!VRy81:S0 -1; !!HEy91&y91>-2:O?y81/1; !!HEy90:O?y80/1;
!!SN:W^Virtual Backpack - Battle - Attacker Player^/y80;
!!SN:W^Virtual Backpack - Battle - Defender Player^/y81;
!?BG1;
!!SN:W^Virtual Backpack - Battle - Coward^/0;
!!BG:A?y1; !!FU&y1<>4/y1<>5:E;
!!SN:W^Virtual Backpack - Battle - Coward^/1;
!?BA53; End of battle
!!BA:H0/?y90 H1/?y91;
!!SN:W^Virtual Backpack - Battle - Coward^/?y66;
!!FU&y91=-2:E; !!FU&y66=1:E;
!!SN:W^Virtual Backpack - Battle - Attacker Player^/?y70;
!!SN:W^Virtual Backpack - Battle - Defender Player^/?y71;
!!VRy81:S0 -1; !!HEy91&y91>-2:O?y81/1; !!HEy90:O?y80/1;
!!if&y80>=0/y81<0:;
!!DO55731/2/1999/1:Py91/y90;
!!en:;
!!if&y81>=0/y80<0:;
!!DO55731/2/1999/1:Py90/y91;
!!en:;
|
|
Tyrgalon
Tavern Dweller
|
posted April 14, 2017 08:04 PM |
|
|
ERA 2 freeze
Having some issues with ERA 2 randomly freezing up:
WoG Version: 3 . 59
Built on Dec 12 2005
******************************_Exception_(trace_details)_******************************
### Location: 8 : 28
### Location: 6 : 10
### Location: 1 : 75
### Location: 1 : 58
### Location: 1 : 50
EIP = {0x00743212}, Access Violation. Attempt to {read} the inaccessible data at {0x030F7BB6}
The Latest Executed ERM Receiver:
MO7130:R?v7059/1; [get aggression level]
!!VRy-1:Sv7059;
Donīt know anything about ERM coding so no idea what the issue really is :/
|
|
szaman
Known Hero
|
posted April 16, 2017 05:18 PM |
|
|
Is there a way to loop a sound?
!!VRz10:S^1901.wav^;
!!SNz10;
!?SN;
!!SN:S?z-10;
!!VRi:S0;
!!VRz-9:S^Mystery.wav^;
!!VRi&z-10=z-9:S1;
!?SN&i=1;
!!VRz-10:S^ZQUIET.WAV^;
!!SN:Sz-10;
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted April 16, 2017 11:22 PM |
|
|
I don't know why you use so big code, to play a sound it should be:
!!VRz1:S^1901.wav^;
!!SN:Pz1;
thats all, then add conditions if any, one more line.
Then I don't understand that you mean by loop, you need the sound repeat multiple times in a row? then create a new wav file with loop.
|
|
Cavorite
Tavern Dweller
|
posted April 18, 2017 08:24 PM |
|
Edited by Cavorite at 19:04, 22 Apr 2017.
|
scripting help needed
Odvin said: I just thought that some discussion of ERM should be not only in the official forum, but in HC too. So, this thread is for everything connected with ERM scripting. Not only for those who write scripts, I mean. Pehaps it could be interesting (and it's also allows me to get the fresh news about ERM scripting, as I seldom visit the offcial forum... )
I have been trying to make a map where the player can recrute only one hero from each town type. I have a script to disallow heroes from being available in the tavern but can't get it to work. Can someone help please?
Ron at cavorite@hotmail.com
Thanks
Here is the script:
ZVSE
!#TM4:S1/999/1/2; *** timer 4 every day for BLUE
!?TM4; *** trigger
!!OW:H1/55/0; *** how many heroes in v55
!!OW:H1/56/1; *** 1st Hero # in v56
!!OW:H1/57/2; *** 2nd Hero #t in v57
!!OW:H1/58/3; *** 3rd Hero # in v58
!!OW:H1/59/4; *** 4th Hero # in v59
!!OW:H1/60/5; *** 5th Hero # in v60
!!OW:H1/61/6; *** 6th Hero # in v61
!!OW:H1/62/7; *** 7th Hero # in v62
!!OW:H1/63/8; *** 8th Hero # in v63
!!HE-1:B2/?v64; *** current hero class in v64
!!VRv64:Sv64:2; *** current hero town type in v64
!!VRv65:Sv64*16; *** starting hero # for town type v65
!!VRv66:Sv65+16; *** ending hero # for town type v66
!!DO70/v65/v66/1&v55>0; *** do FUNCTION 70 16 times
----------------------------------------------------------------------------------------
FUNCTION #70
ZVSE
!?FU70; *** Function # 70
!!HEx16:R3/0/1; *** disable heroes in tavern for blue
____________
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted April 18, 2017 08:39 PM |
|
|
|
szaman
Known Hero
|
posted April 19, 2017 03:04 AM |
|
|
Where i can find ERM Script, responsible for "Home of the bat" and "transylvania Tavern". Searched all 'S' folder and no luck
|
|
bloodsucker
Legendary Hero
|
posted April 19, 2017 05:09 AM |
|
|
szaman said: Where i can find ERM Script, responsible for "Home of the bat" and "transylvania Tavern".
I'm quite sure all new banks, as well as the new dwellings, were hardcoded.
|
|
szaman
Known Hero
|
posted April 19, 2017 01:56 PM |
|
|
To bad i was hoping to learn how to change rewards there from X lord vampire's to let's say to 100 Hobgoblins.
Is there any kind of script that replaces a rewards? from vampires to Hobgoblins?
|
|
bloodsucker
Legendary Hero
|
posted April 19, 2017 06:44 PM |
|
|
What is ERM is the DragonMaster, I think you will get some ideas there. Anyway, the option to respawn banks is ERM and does all that. However I've always found it quite confusing, I think the DragonMaster is a better example. To place the troops you have an excellent tutorial by Salamandre here.
|
|
|