|
Thread: Some small plugins | This thread is pages long: 1 2 · NEXT» |
|
OxFEA
Promising
Famous Hero
feanor on DF2.ru
|
posted July 20, 2012 10:44 PM |
|
Edited by Corribus at 20:08, 18 Sep 2012.
|
Some small plugins
0. ERA plugin for adding some commands to the chat.
https://dl.dropbox.com/u/61759222/HoMM/chalk.rar - code+plugin
http://forum.df2.ru/index.php?showtopic=27732 (DF2 thread)
Commands:
- /showfps. Enable/disable showing FPS instead of chat string.
- /leveldebugger. Enable/disable internal "level debugger". Only feature that I noticed - showing coordinates on right-click on map.
- /heroid. Show current hero id, name and address in memory.
- /execerm <command>. Execute ERM command. Command must be written without starting "!!" but with ending ";" (e.g. /execerm IF:L^Hi!^; )
Aliases like HE-1, v998, v999, v1000 are supported with limitations; other aliases (CA-1; HE-10 etc) doesn't supported at all.
- !!<command>. Like previous command, but with better syntaxis: you can write !!IF:L^Hi!^; instead of /execerm IF:L^Hi!^;
Tested on ERA 2.3
I forget in which verison OnChat event had been implemented so I can't say anything about older ERA versions.
|
|
Bersy
Honorable
Supreme Hero
|
posted July 21, 2012 12:57 AM |
|
|
I remember simple ERM equivalent:
ZVSE
!?FU77003;
!!SN:W^InChat^/?y1;
!!SN&y1=1:Q;
!?FU77014;
!!SN:X?y1;
!!if&y1=0:;
!!SN:W^InChat^/1;
!!en:;
!!if&y1=1:;
!!SN:X?y1/?z1/0;
!!SN:L^Era.dll^/?y10 Ay10/^ExecErmCmd^/?y11 Ey11/0/z1;
!!en:;
!!if&y1=2:;
!!SN:W^InChat^/0;
!!en:;
|
|
kegolo
Promising
Famous Hero
of infamy
|
posted July 22, 2012 07:30 AM |
|
|
This is great! So useful for debugging actually. Or at least I think so. I think this is best when the game crashes and you can't get around it, used to mean had to stop your game. Now you can just find the problem hero or monster, and delete it from the game.
|
|
OxFEA
Promising
Famous Hero
feanor on DF2.ru
|
posted July 26, 2012 05:42 PM |
|
Edited by OxFEA at 17:43, 26 Jul 2012.
|
Version from 26 Jul 2012, 18:03:18
[*] Cheatcodes work now
[+] Added commands /chalk (prints list of commands and date/time of plugin compilation), /console on|off (enabling/disabling of windows console)
[+] Chat output now works without ERM, so commands like "/exec IF:L^Test^;" works correctly.
[+] ERM-commands now can be written without ";"
http://zalil.ru/33613281 - plugin
https://dl.dropbox.com/u/61759222/HoMM/chalk.rar - code+plugin
|
|
OxFEA
Promising
Famous Hero
feanor on DF2.ru
|
posted August 23, 2012 08:53 PM |
|
|
1. Additional timer receiver
https://dl.dropbox.com/u/61759222/HoMM/timerevent.era
(needs patcher_x86.dll)
Plugin run function !?FU4074700 (and fire "OnGlobalTimer" event) for any player at start of any day.
Parameters (ERM): x1 - player number (0..7), x2 - day (1,2,3,4,5,6,7,8..)
Source: https://dl.dropbox.com/u/61759222/HoMM/eratimer_code.rar
C/C++ example:
Quote: void __stdcall TimerTest (PEvent e)
{
char buf[128];
int i = *(int*)(e->Data);
sprintf(buf,"IF:L^%i %i^;",*(int*)(e->Data), *(1+(int*)(e->Data)));
ExecErmCmd(buf);
}
..
RegisterHandler(TimerTest,"OnGlobalTimer");
|
|
Warmonger
Promising
Legendary Hero
fallen artist
|
posted August 23, 2012 09:14 PM |
|
|
|
OxFEA
Promising
Famous Hero
feanor on DF2.ru
|
posted August 23, 2012 09:37 PM |
|
Edited by OxFEA at 21:15, 18 Sep 2012.
|
I can't recognize humor or sarcasm when it was written on little-known language. Was it a some sort of?
2. In-game time managing (malachite.era)
https://dl.dropbox.com/u/61759222/malachite.era
(needs patcher_x86.dll)
Features:
- setting in-game date with exported void SetDate(short day, short week, short month) function
- changing new day/week animation with new !?FU4074218 event
Example (ERM):
Quote: !?FU4074218; //x1 - day, x2 - week, x3 - month, z1 - defname
!!VRz1&x2=4/x3=6:S^midsumm.def^;
Example (C):
Quote: void __stdcall Testt (PEvent e)
{
if (EventParams[1]==4 && EventParams[2]==6)
strcpy((char*)(e->Data),"midsumm.def");
}
RegisterHandler(Testt,"OnNewDayAnimation");
|
|
OxFEA
Promising
Famous Hero
feanor on DF2.ru
|
posted September 18, 2012 09:13 PM |
|
Edited by OxFEA at 21:15, 18 Sep 2012.
|
3. Digging management (granite.era)
https://dl.dropbox.com/u/61759222/granite.era
(needs patcher_x86.dll)
ERM events:
!?FU4074001 - before digging
x1 - hero id
x2 - pointer to boolean flag that controls standart digging action.
Use command !!UN:Cx2/4/0; for disable standart digging.
!!UN:Cx2/4/1; reenables default action, but I can't imagine where it may be necessary.
!?FU4074003 - acts when any digging message was showing
x1 - hero id
x2 - pointer to boolean flag that controls showing message (doesn't control any other actions like consuming MP!). As previous, use command !!UN:Cx2/4/0; for disable message.
x3 - type of message:
0 - "Try tomorrow" (when some MP are consumed)
1 - "Inventory is full" (so, when inventory is full)
2 - "Try searching on land" (digging in sea)
3 - "Try searching on clear ground" (digging in incorrect place)
4 - "Congratulations!.." (first message when grail found)
5 - "ïðèíåñèòå Ãðààëü â ãîðîä.." (second message when grail found)
6 - "Where could it be?" (nothing found)
!?FU4074002 - after digging
x1 - hero id
x2 - result of digging. Like x3 in FU4074003, but without type 4 and with type -1 - "standart digging cancelled in !?FU4074001"
Example:
Quote: !?FU4074003;
!!if&x3=6:; //when nothing was found
!!UN:Cx2/4/0; //disable standart message
!!IF:M^As you value your life or your reason keep away from the moor.^; //show ours one
!!HE-1:Tv998/v999/v1000/47/1; //run encounter
!!el:;
!!en:;
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted September 18, 2012 09:45 PM |
|
|
|
OxFEA
Promising
Famous Hero
feanor on DF2.ru
|
posted October 19, 2012 08:00 PM |
|
Edited by OxFEA at 20:02, 19 Oct 2012.
|
4. 8th slot management (obsidian.era)
https://dl.dropbox.com/u/61759222/HoMM/obsidian.era
(needs patcher_x86.dll)
Events:
!?FU4074810 (OnAdditionalMonsterAvailable) - runs on every checking of 8th slot availability
x1 - castle id
x2 - address of castle structure
x3 - pointer to boolean flag that controls 8th slot.
!?FU4074811 (OnAdditionalMonsterSetting) - runs after setting creatures in portal
x1 - castle id
x2 - address of castle structure
x3 - pointer to int32 that contains type of creatures
x4 - pointer to int16 that contains amount of creatures (see example below)
Exported functions:
extern "C" __declspec(dllexport) void SetAdditionalMonster(int castle_id, int type, int amount)
extern "C" __declspec(dllexport) int GetAdditionalMonsterType(int castle_id)
extern "C" __declspec(dllexport) int GetAdditionalMonsterAmount(int castle_id)
Example (ERM):
All Infernos allow hiring of 5 Baa clerics each week.
Quote: ZVSE
!?FU4074811;
!!CA0/x1:T?y10;
!!SN&y10=3:L^obsidian.era^/?y10 Ay10/^SetAdditionalMonster^/?y20 Ey20/1/x1/169/5;
!?FU4074810;
!!CA0/x1:T?y10;
!!UN&y10=3:Cx3/4/1;
!?PI;
!!MA:O169/3;
!!VRz47:S^Cleric of Baa^;
!!VRz48:S^Clerics of Baa^;
!!UN:G1/169/0/47 G1/169/1/48;
Another variant of first trigger:
Quote: !?FU4074811;
!!CA0/x1:T?y10;
!!UN&y10=3:Cx3/4/169;
!!UN&y10=3:Cx4/2/5;
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted October 19, 2012 09:55 PM |
|
|
Thank you for your work. Combined with MoP battery we can have now a bunch of new creatures/town, looks like.
____________
Era II mods and utilities
|
|
majaczek
Supreme Hero
Work at Magic Dimmension
|
posted October 22, 2012 11:29 AM |
|
|
OxFEA maybe a ghost/vampire plugin?
I've once seen in WoG source that applying Ghost's Soulsuck or Blood Dragon's Vampirism was an simple application, However I've not yet tried to cook some plugin for do the same. Could you perhaps add here a plugin for enabling the abilities to any desired monster? One which would be compatible with Amethyst? Gently please.
|
|
OxFEA
Promising
Famous Hero
feanor on DF2.ru
|
posted October 22, 2012 09:01 PM |
|
|
Quote: Could you perhaps add here a plugin for enabling the abilities to any desired monster? One which would be compatible with Amethyst? Gently please.
I don't want to do it now. It is a huge and mostly useless work.
|
|
Felipe
Known Hero
Editing Heroes Without Limits
|
posted November 01, 2012 03:54 AM |
|
|
Quote: 4. 8th slot management (obsidian.era)
https://dl.dropbox.com/u/61759222/HoMM/obsidian.era
(needs patcher_x86.dll)
Events:
!?FU4074810 (OnAdditionalMonsterAvailable) - runs on every checking of 8th slot availability
x1 - castle id
x2 - address of castle structure
x3 - pointer to boolean flag that controls 8th slot.
!?FU4074811 (OnAdditionalMonsterSetting) - runs after setting creatures in portal
x1 - castle id
x2 - address of castle structure
x3 - pointer to int32 that contains type of creatures
x4 - pointer to int16 that contains amount of creatures (see example below)
Exported functions:
extern "C" __declspec(dllexport) void SetAdditionalMonster(int castle_id, int type, int amount)
extern "C" __declspec(dllexport) int GetAdditionalMonsterType(int castle_id)
extern "C" __declspec(dllexport) int GetAdditionalMonsterAmount(int castle_id)
Example (ERM):
All Infernos allow hiring of 5 Baa clerics each week.
Quote: ZVSE
!?FU4074811;
!!CA0/x1:T?y10;
!!SN&y10=3:L^obsidian.era^/?y10 Ay10/^SetAdditionalMonster^/?y20 Ey20/1/x1/169/5;
!?FU4074810;
!!CA0/x1:T?y10;
!!UN&y10=3:Cx3/4/1;
!?PI;
!!MA:O169/3;
!!VRz47:S^Cleric of Baa^;
!!VRz48:S^Clerics of Baa^;
!!UN:G1/169/0/47 G1/169/1/48;
Another variant of first trigger:
Quote: !?FU4074811;
!!CA0/x1:T?y10;
!!UN&y10=3:Cx3/4/169;
!!UN&y10=3:Cx4/2/5;
I copy your example to the sagamosa erm file. I downloaded granite.era put it inside Erapluggins and activated it. But there was no 8th slot in the game. You said we need patcher_x86.dll I don't have it. Is that the problem? What do I do?
____________
|
|
Felipe
Known Hero
Editing Heroes Without Limits
|
posted November 01, 2012 04:04 AM |
|
|
I have patcher_x86.dll now I see it in my heroes iii folder... Why is this 8th creature not working?
____________
|
|
OxFEA
Promising
Famous Hero
feanor on DF2.ru
|
posted November 01, 2012 05:58 PM |
|
Edited by OxFEA at 17:58, 01 Nov 2012.
|
Quote:
Quote:
https://dl.dropbox.com/u/61759222/HoMM/obsidian.era
Quote: I downloaded granite.era put it inside Erapluggins and activated it. But there was no 8th slot in the game. You said we need patcher_x86.dll I don't have it. Is that the problem? What do I do?
|
|
Felipe
Known Hero
Editing Heroes Without Limits
|
posted November 01, 2012 11:28 PM |
|
|
____________
|
|
Felipe
Known Hero
Editing Heroes Without Limits
|
posted November 02, 2012 12:04 AM |
|
|
Still didn't work.
I tried also to disable all the other mods. Don't understand.
____________
|
|
OxFEA
Promising
Famous Hero
feanor on DF2.ru
|
posted January 02, 2013 10:06 PM |
|
|
5. Bad luck implementation. (c) Sav, feanor
https://dl.dropbox.com/u/61759222/HoMM/badluck.era
|
|
artu
Promising
Undefeatable Hero
My BS sensor is tingling again
|
posted January 02, 2013 10:48 PM |
|
|
|
|