|
|
bloodsucker
Legendary Hero
|
posted October 23, 2016 10:14 AM |
|
|
Look for a script called "Load only these scripts" and add the one's you want, you can also copy all mod struture from someother mod and create one for your map.
|
|
majaczek
Supreme Hero
Work at Magic Dimmension
|
posted October 26, 2016 06:00 PM |
|
Edited by majaczek at 14:15, 27 Oct 2016.
|
In ERA you cannot add spells, but you can change/replace ones...
I want to replace some silly adventure spell (ie. one of "view ..." spells) with custom battle offensive spell from water magic school.
Is it possible?
EDIT: what are the names and where are files with war machine battle sprites?
|
|
avatar
Promising
Supreme Hero
|
posted October 27, 2016 03:17 PM |
|
|
Like any others sprites - in h3sprites.lod (I don't have my pc right now to tell you names)
____________
|
|
majaczek
Supreme Hero
Work at Magic Dimmension
|
posted October 27, 2016 06:28 PM |
|
Edited by majaczek at 13:51, 28 Oct 2016.
|
avatar said: Like any others sprites - in h3sprites.lod (I don't have my pc right now to tell you names)
they begin with "SM", now I know :P
EDIT: Why it doesn't work?
Quote:
ZVSE
!?BF;
!!SS1:F299601 L4 O-1 S4 X46 P60 E0/120 E1/240 E2/360 E3/360;
It does nothing when I press scuttle boat in battle?
|
|
bloodsucker
Legendary Hero
|
posted October 28, 2016 06:45 PM |
|
|
majaczek said: I want to replace some silly adventure spell (ie. one of "view ..." spells) with custom battle offensive spell from water magic school.
I don't want to sound rude but if you think View Air is a silly spell I would say you have a lot invested in this game, should learn to play it.
|
|
majaczek
Supreme Hero
Work at Magic Dimmension
|
posted October 28, 2016 07:02 PM |
|
|
bloodsucker said:
majaczek said: I want to replace some silly adventure spell (ie. one of "view ..." spells) with custom battle offensive spell from water magic school.
I don't want to sound rude but if you think View Air is a silly spell I would say you have a lot invested in this game, should learn to play it.
Okay View Air is sometimes useful, but I mostly do not use this. Also View Earth have it uses. But Scuttle Boat and Disguise have almost no uses
Disguise is in my enviroment replaced by reinforcements, so there is at least 1 spell to replace (scuttle boat), could you help me to finish making this spell an battle spell?
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted October 28, 2016 07:15 PM |
|
|
I never saw any mod changing one spell class into another, my conclusion would be that is impossible. Now, if you say that scuttle boat doesn't have any effect in battle, does it returns the right ID when you check what spell is cast?
If yes, then you can manually script some effect, but would have to be mass as there will be no way to target a single stack.
____________
Era II mods and utilities
|
|
majaczek
Supreme Hero
Work at Magic Dimmension
|
posted October 29, 2016 02:39 PM |
|
|
Salamandre said: I never saw any mod changing one spell class into another, my conclusion would be that is impossible. Now, if you say that scuttle boat doesn't have any effect in battle, does it returns the right ID when you check what spell is cast?
If yes, then you can manually script some effect, but would have to be mass as there will be no way to target a single stack.
It doesn't return ID and it doesn't eat mana
I need some memory patch.
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted October 29, 2016 03:01 PM |
|
|
You should try first with a spell which eats mana when you cast it -view air for example. Scuttle boat eats mana only when a boat is clicked.
|
|
majaczek
Supreme Hero
Work at Magic Dimmension
|
posted October 29, 2016 03:48 PM |
|
Edited by majaczek at 18:32, 01 Nov 2016.
|
excuse me, at what address is:
Quote:
Byte *PlaceNPC2(Byte *Bm,int Type, int Side,NPC *npc,_Hero_ *Hp,int *Placed)
from wog sources? why it seems different in code than in source?
I want to change war machine spawning, directly in the code...
EDIT: I tried with View Earth, also doesn't work
would it work for any battle spell? which one you would replace?
Maybe there is a lock in code? I may be able to fix it probably (or somebody)
EDIT: it seems generally spell flags doesn't do much, many things are hardcoded. I couldn't change Weakness into offensive spell.
EDIT: majaczek said: is it possible to add a "WoG Spell" to the battle?
No worry if it wouldn't be saved, it could be get from artifact, or indirectly replace some adventure spell...
EDIT: found the routine
Byte* PlaceNpc2
??? 0x76b7fe probably this
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted November 02, 2016 07:00 PM |
|
|
Well, you can create a virtual DL and virtual spells. Those who played Sagamosa advanced levels know this. He has both battle and adventure map additional spells.
|
|
majaczek
Supreme Hero
Work at Magic Dimmension
|
posted November 05, 2016 06:55 PM |
|
|
Quote:
ZVSE
!?TM2;
!_!FU:E;
!?BA0;
!!SS1:F37457 L4 O-1 S4 X46 P60 E0/120 E1/240 E2/360 E3/360;
!!SS82:F37457 L4 O-1 S4 X46 P60 E0/120 E1/240 E2/360 E3/360;
!!SN:W^SS 82 behaves as^/16;
!!FU:E;
!!SS1:F561745 L4 O-1 S4 X46 P60 E0/120 E1/240 E2/360 E3/360;
!!SS3:F299601 L4 O-1 S4 X46 P60 E0/120 E1/240 E2/360 E3/360;
!!SS5:F299601 L4 O-1 S4 X46 P60 E0/120 E1/240 E2/360 E3/360;
!?BG0;
!!FU:E;
!!BG:A?y1; !!FU&y1<>1:E;
!!BG:S?y2; !!FU&y2<>3:E;
!!IF:M^Gotcha! BG^;
!?MG1;
!!FU:E;
!!VRy1:Sv997;
!!FU&y1<>3:E;
!!IF:M^Gotcha! MG^;
!?BA0;
!!BA: H0/?y10 H1/?y11;
!!if&y10>=0:;
!!HEy10:M1/?y20;
!!SN:W^HE SS %Y10 01 82^/y20;
!!if&y20>=0:;
!!HEy10:M1/0;
!_!HEy10:M82/1;
!!en:;
!!en:;
!!if&y11>=0:;
!!HEy11:M1/?y21;
!!SN:W^HE SS %Y11 01 82^/y21;
!!if&y21>=0:;
!!HEy11:M1/0;
!_!HEy10:M82/1;
!!en:;
!!en:;
!?BA1;
!!BA:H0/?y10 H1/?y11;
!!if&y10>=0:;
!_!HEy10:M82/?y20;
!!SN:W^HE SS %Y10 01 82^/y20;
!!if&y20>=0:;
!_!HEy10:M82/0;
!!HEy10:M1/1;
!!en:;
!!en:;
!!if&y11>=0:;
!_!HEy11:M82/?y21;
!!SN:W^HE SS %Y11 01 82^/?y21;
!!if&y21>=0:;
!_!HEy11:M82/0;
!!HEy10:M1/1;
!!en:;
!!en:;
!?CM4;
!!BG:Q?y3 H?y4;
!!SN:W^BH %Y3 Custom Spell^/?y11;
!!CM&y11=0:R1;
!_!CM:R0;
!!FU&y11=0:E;
!!CM:F?y1 I?y2;
!!FU&y2=2008:E;
!_!FU&y1<>0:E;
!!CM:R0;
!_!FU&y2<>1:E;
!_!FU&y1<>0/y2<>1:E;
!_!IF:M^DEBUG1^;
!_!CM&y2>=2000:R1;
!!FU&y2>=2000:E;
!_!IF:M^DEBUG2^;
!!BG:Q?y3 H?y4;
!!BG:A0;
!!FU&y4<0:E;
!_!IF:M^DEBUG3^;
!_!BG:D?y5;
!_!BG:E?y6;
!_!FU&y6<0:E;
!_!IF:M^DEBUG4^;
!_!CM:R1;
!!CM:D?y5;
!_!BHy3:C16/y5/2/1;
!_!BHy3:Cy11/y5/2/1;
!!SN:W^SS %Y11 behaves as^/?y9;
!!FU55409:Py11/y9/y5/3/1;
!_!BG:A1 Sy11;
!_!BG:A1 S16;
!!SN:W^BH %Y3 Custom Spell^/0;
!!BG:A0; !!CM:R0; !!SN:Q;
!?CM4;
!!CM:F?y1 I?y2;
!!CM:R1;
!!FU|y1<>512/y2<>2008:E;
!!BG:Q?y3 H?y4; !!BHy3:M?y7;
!!FU|y4<0/y7=1:E;
!!IF:M^Custom Spell^;
!!CM:R0;
!_!BG:A1 S82;
!!SN:W^BH %Y3 Custom Spell^/82;
!_!SN:Q;
!?FU55409;
x1 - new spell number
x2 - temp spell
x3 - position to cast
x4 - Magic School level
x5 - check for dead stack
x6 - non-zero is free
store temp spell
!!SSx2:C0/?y80 C1/?y81 C2/?y82 C3/?y83 E0/?y90 E1/?y91 E2/?y92 E3/?y93;
!!SSx2:F?y72 O?y73 P?y74 S?y75 W?y76 X?y77 L?y78;
scan new spell
!!SSx1:C0/?y10 C1/?y11 C2/?y12 C3/?y13 E0/?y20 E1/?y21 E2/?y22 E3/?y23;
!!SSx1:F?y2 O?y3 P?y4 S?y5 W?y6 X?y7 L?y8;
check enough mana
!!BG:Q?y55;
!!BHy55:N?y56;
!!HEy56:I?y57/1;
!!FU&x4=0/y57<y10/x6=0:E;
!!FU&x4=1/y57<y11/x6=0:E;
!!FU&x4=2/y57<y12/x6=0:E;
!!FU&x4=3/y57<y13/x6=0:E;
tweak temp spell
!!SSx2:C0/y10 C1/y11 C2/y12 C3/y13 E0/y20 E1/y21 E2/y22 E3/y23;
!!SSx2:Fy2 Oy3 Py4 Sy5 Wy6 Xy7 Ly8;
cast spell
!!BG:Q?y55;
!!BHy55:Cx2/x3/x4/x5;
!!HEy56&x6<>0:Iy57/1;
restore temp spell
!!SSx2:C0/y80 C1/y81 C2/y82 C3/y83 E0/y90 E1/y91 E2/y92 E3/y93;
!!SSx2:Fy72 Oy73 Py74 Sy75 Wy76 Xy77 Ly78;
Template for new spells, no dialog yet, first new spell
|
|
larvaexotech
Tavern Dweller
|
posted November 10, 2016 11:21 PM |
|
|
Hello.
I am developing "small plugin" for H3 community that would make developing scripts and mods easier.
Unfortunately I have a slight problem with ERA SDK. I've created a DLL library in FreePascal and I have managed to got all triggers and ERM called from script files correctly, but it looks like ERA SDK has some painful bugs. ERA allows to register a handler for standard ERM trigger:
PROCEDURE RegisterHandler (Handler: TEventHandler; EventName: PCHAR); STDCALL;
But SDK is broken in few parts, that is:
1. "OnCombatMouseClick" does not fire at all, I have managed to workaround it with "OnTrigger 30314" however.
2. Registering "OnSoundPlay" handler will make !!SN command to crash game. Its 100% reproductible - when I comment registering OnSoundPlay, !!SN plays sounds fine. If I uncomment it, !!SN immediately closes Heroes 3 window without an error message. PROBABLY it could be stack overflow error, because there is no exception, error message or whatever, H3 window just disappears so probably Windows is killing process after detecting stack-smashing.
While first one is worked-around, second one is quite holding me up because I cant have OnSoundPlay event
Does Bers look around this forum?
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted November 10, 2016 11:31 PM |
|
|
No, Bersy married and is gone. You should ask those kind of things in russian forums, where they know how to read WoG sources.
|
|
larvaexotech
Tavern Dweller
|
posted November 10, 2016 11:38 PM |
|
|
Clock goes forward way too fast
I'll try to handle it by myself, thank you.
|
|
igrik
Promising
Known Hero
|
posted November 11, 2016 11:04 AM |
|
|
larvaexotech said: 2. Registering "OnSoundPlay" ...
While first one is worked-around, second one is quite holding me up because I cant have OnSoundPlay event
Possible can help
|
|
igrik
Promising
Known Hero
|
posted November 11, 2016 11:47 AM |
|
|
majaczek said: excuse me, at what address is:
Quote:
Byte *PlaceNPC2(Byte *Bm,int Type, int Side,NPC *npc,_Hero_ *Hp,int *Placed)
from wog sources? why it seems different in code than in source?
I want to change war machine spawning, directly in the code...
!?BA52;
; Hierophant
!!UN:C7780650/1/144;
!!UN:C7780651/1/144;
!!UN:C7780652/1/106;
!!UN:C7780653/1/30; [quantity]
!!UN:C7780654/1/104;
!!UN:C7780655/4/155; [type monst]
!!UN:C7780555/4/155; [type monst]
; Ogre Leader
!!UN:C7780892/1/144;
!!UN:C7780893/1/144;
!!UN:C7780894/1/106;
!!UN:C7780895/1/30; [quantity]
!!UN:C7780896/1/104;
!!UN:C7780897/4/151; [type monst]
!!UN:C7780797/4/151; [type monst]
|
|
larvaexotech
Tavern Dweller
|
posted November 11, 2016 04:06 PM |
|
|
Hey, thank you!
Unfortunately this seems to be issue with other triggers as well. I've same problem when I register handler "OnBattleMouseHint" and then I all battle directly from ERM: !!HE-1:T$/$/$/$/$; - then it crash as well.
This is quite sad BUT it might be issue with my library.
I am creating a plugin for ERA that allows to create scripts for Heroes using TypeScript/JavaScript as an ERM replacement.
I've managed to setup basic work, that is ability to execute ERM in JavaScript script, trigger handling from JavaScript, ability to save/restore data between savegames, get V and Z variables, and then I have written a 7500 line of code SDK that translates ERM syntax into object oriented JavaScript API.
I am using Mozzila JS engine, and I had a problem because it didnt wanted to kick in on base game thread. I've successfuly managed to run script using second thread, so I decided to create a multi-thread version. DLL plugin just gives a control for javascript to execute a command, then switches to main thread and executes that command with erm, then it switches again into javascript thread and so on with a series of mutexes that put on hold either ERA and JS threads whichever is working at moment.
I've seen though that combat is not crashing when I specify callback for OnBattleMouseHint event not related to engine at all, just dummy callback, so I think I probably might have an error with my threading code So I will have to jump in and find a place. I have my bet now, here is the part of my JS engine object in era plugin in FreePascal:
http://pastebin.com/nZdSFqTj
As you can see, ERA is adding triggers to execute using AddEvent which will put ERA thread spinning before mutex until JavaScript does not issue next command. All JS endpoinds (for example .ERM() method) will just store a command for ERM to execute, release lock and wait until command is done, then reaquire lock and continue executing JS script. It actually works 100% reliable but I think problem is with line 85 as g_Engine global variable is not checked with mutex aquired so it is possible that two threads will access at the same time. This is my best bet so I will try to play around with this.
Here are some example scripts that ALREADY WORK with my plugin:
Script that changes battle music to special track for every town:
http://pastebin.com/UH9uZ8Nx
Script that enchances estates, giving more gold daily and random resources every start of week:
http://pastebin.com/swvZhxTG
Script that changes catapults similar with WOG E-War Machines script, making it able to throw fireballs at enemies:
http://pastebin.com/2Y7Ty9y9
Script that allows first aid tent to revive dead units, working with AI as well:
http://pastebin.com/B829Kkuw
|
|
larvaexotech
Tavern Dweller
|
posted November 11, 2016 06:50 PM |
|
|
Whatever, the root of problem was slightly different
It was because HE:T commmand blocks ERM execution until combat is done. Well it may seem obvious, but as I program in JS for several years, I expected that HE:T just passes through and result rest of code (ex. reward after combat) should be handled in BA1
Anyway the problem was that JS execution was blocked because ERM was blocked at HE:T command for the time of combat, but still ERA was sending events from battle while JS is still in "pending" state and that caused ERA to wait behind mutex forever, freezing game.
I've managed to make it with JS callback style: Battle.createCombat(hero,enemyMonster,enemyMonsterCount,position,postCombatCallback).
|
|
majaczek
Supreme Hero
Work at Magic Dimmension
|
posted November 11, 2016 09:07 PM |
|
|
igrik said:
majaczek said: excuse me, at what address is:
Quote:
Byte *PlaceNPC2(Byte *Bm,int Type, int Side,NPC *npc,_Hero_ *Hp,int *Placed)
from wog sources? why it seems different in code than in source?
I want to change war machine spawning, directly in the code...
!?BA52;
; Hierophant
!!UN:C7780650/1/144;
!!UN:C7780651/1/144;
!!UN:C7780652/1/106;
!!UN:C7780653/1/30; [quantity]
!!UN:C7780654/1/104;
!!UN:C7780655/4/155; [type monst]
!!UN:C7780555/4/155; [type monst]
; Ogre Leader
!!UN:C7780892/1/144;
!!UN:C7780893/1/144;
!!UN:C7780894/1/106;
!!UN:C7780895/1/30; [quantity]
!!UN:C7780896/1/104;
!!UN:C7780897/4/151; [type monst]
!!UN:C7780797/4/151; [type monst]
Well I wanted it to do with a plugin, and finally succeeded. Here is a plugin which touches the algorithm. it also do other things. I changed a few thingies regarding war machines.
|
|
|