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 5 - Modders Workshop > Thread: The Modding Wiki
Thread: The Modding Wiki This thread is 8 pages long: 1 2 3 4 5 6 7 8 · «PREV / NEXT»
bknight2602
bknight2602


Hired Hero
posted October 17, 2013 04:54 AM

Thanks for refreshing the memory.
Another question arose tonight.  I have been using a towntransform function part of which is below.  The function transformed a town to a specific type, but I wanted to make it generic to the town type of the capturing hero.

function transform(townname, heroname)
if HasHeroSkill(heroname, 13) then
towntype = 0;
elseif HasHeroSkill(heroname, 14) then
towntype = 5;
elseif HasHeroSkill(heroname, 15) then
towntype = 4;
elseif HasHeroSkill(heroname, 16) then
towntype = 1;
elseif HasHeroSkill(heroname, 17) then
towntype = 2;
elseif HasHeroSkill(heroname, 18) then
towntype = 3;
end;

TransformTown(townname, towntype);
end;

function town1capture(heroname)
print("The capturing hero is", heroname);
transform("town1", heroname);
end;

Trigger(OBJECT_CAPTURE_TRIGGER, "town1", "town1capture");

The error I'm getting is the heroname is nill and I'm stumped as to how to pass it from the trigger to the transform.

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


Promising
Supreme Hero
育碧是白痴
posted October 17, 2013 12:49 PM
Edited by frostymuaddib at 12:50, 17 Oct 2013.

According to the documentation for for Trigger function it says that parameters passed to your function in case of OBJECT_CAPTURE_TRIGGER, are:
Quote:
the old owner of the object, the new owner of the object, the name of the hero who captured it (if any), and the name of the object itself


So I guess your function town1capture(heroname), should instead look like town1capture(oldOwner, newOwner, heroname, object).

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


Hired Hero
posted October 17, 2013 05:51 PM

frostymuaddib said:
According to the documentation for for Trigger function it says that parameters passed to your function in case of OBJECT_CAPTURE_TRIGGER, are:
Quote:
the old owner of the object, the new owner of the object, the name of the hero who captured it (if any), and the name of the object itself


So I guess your function town1capture(heroname), should instead look like town1capture(oldOwner, newOwner, heroname, object).


You are correct with the read of the documentation, however this has worked for me:

function transform(townname)
TransformTown(townname, 1);
end;

function town1capture()
transform("town1");
end;

Trigger(OBJECT_CAPTURE_TRIGGER, "town1", "town1capture");
It appears that oldOwner, newOwner, heroname are not required but passed along.  I will re-write and see if it works, although the oldOwner is a bit of a question.  Before battle I dn't know which player owns an object  In the specific case, I do but I want a generic player.

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


Promising
Supreme Hero
育碧是白痴
posted October 17, 2013 06:26 PM

I'm not sure I nderstood well what is your goal, but if you wanted to change town according to hero's alignment, your code in previous post  should do that if you modify your function town1capture like this:

function town1capture(oldOwner, newOwner, heroname, object)
print("The capturing hero is", heroname);
transform("town1", heroname);
end;

Everything else should remain the same. You don't need to know oldOwner and newOwner. Trigger method will pass those values as arguments when it calls twn1capture (when specified town is captured).

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


Hired Hero
posted October 17, 2013 08:58 PM

That was simpler than I was trying to make it, thanks.  This works great.

function transform(townname, heroname)
print(heroname," captured the town");
if HasHeroSkill(heroname, 13) then
towntype = 0;
elseif HasHeroSkill(heroname, 14) then
towntype = 5;
elseif HasHeroSkill(heroname, 15) then
towntype = 4;
elseif HasHeroSkill(heroname, 16) then
towntype = 1;
elseif HasHeroSkill(heroname, 17) then
towntype = 2;
elseif HasHeroSkill(heroname, 18) then
towntype = 3;
end;

TransformTown(townname, towntype);
end;

function town1capture(oldOwner, newOwner, heroname, townname)
print("The capturing hero is ", heroname);
transform(townname, heroname);
end;

function enemyattack()
pos = "town1";
x, y, z = GetObjectPosition(pos);
OpenCircleFog(x, y, z, 100 , PLAYER_1);
OpenCircleFog(x, y, z, 100 , PLAYER_2);
MoveHero("Calid", GetObjectPosition(pos));
end;

function playerwin()
while 1 do
sleep(1);
if IsHeroAlive("Calid") == nil then
LevelUpHero("Heam");
LevelUpHero("Dalom");
LevelUpHero("Kelodin");
sleep(20);
Win();
end;
end;
end;

Trigger(OBJECT_CAPTURE_TRIGGER, "town1", "town1capture");
startThread(enemyattack);
startThread(playerwin);

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

Tavern Dweller
posted December 09, 2013 02:37 PM

I don't know if I am on the right topic, but here is my question:

How do I change hero's icon? I would like to change Shadya to my own character and I would like to have my own picture... Any help?
...

Pwease?

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


Hired Hero
posted July 07, 2014 10:21 AM

Effects

hi guys im new at modding so i hope you can answer to my questions

I've found a destination that i cannot find
pls explain me how can i reach it,because it has benn written in the xdb file: /Effects/Textures/FireSequence/BlueFireSic3.tga
but i didnt see any Texture folder inside Effects folder,so i hope you can help me.

  Thanks alot!
____________

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


Famous Hero
posted July 07, 2014 10:57 AM

Which .xdb file was that?

I think you read something wrongly or so because I've checked Archangel effects and there was no such directory

____________

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


Hired Hero
posted July 08, 2014 04:12 PM

Hayven said:
Which .xdb file was that?

I think you read something wrongly or so because I've checked Archangel effects and there was no such directory



  It's Thane's fire effect, so i don't know how to find that because i've been modded his fire hand to burn in yellow(made a yellow folder in data.pak and put the yellow fire's there,but i couldn't mod the xdb files because those files shown it: src name = Effects/Textures/...
                                 im sure at this but i dont know
                            currently how to change or find this tga                      
                                                 file.

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


Known Hero
Can I link to my own avatar?
posted July 08, 2014 05:59 PM
Edited by fulano at 18:03, 08 Jul 2014.

I've found that there are tons of obsolete and redundant entries in this game's XML files. They just left old data when they decided to change and update things. Or they got a half dozen copies of textures so you don't know which one they actually use.

So, to the point, I don't see this file in the data archive, so I suspect it's not there, but there are several blue fire tga files in the "data\Textures\effects" folder. So I'd guess one of those is the file you are looking for. I just used trial and error, opening up the files and changing them to see which one did what I wanted to do.

When editing textures I found it easiest to just make a replacement for the original TGA file rather than trying to mod the XML to point to a new file.

When Heroes loads it scans the data folder and takes the latest version of every file in there. So if you make a new fire textures but use the old name then the game will use those textures instead of the old ones.

EDIT:
I was wrong already, the four "bluefire" files I found don't seem to have anything in them, at least when I open them with Paint.NET they seemed blank.

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

Tavern Dweller
Question Asker
posted September 05, 2014 03:46 PM

Why does everyone talk about .xdb files? All I find on my PC (Windows 8) are files with literally no extension and when I try to open them with notepad, that's just some weird symbols... Anyone help?

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


Honorable
Legendary Hero
Once upon a time
posted September 05, 2014 04:03 PM
Edited by markkur at 16:04, 05 Sep 2014.

DrZomboss said:
Why does everyone talk about .xdb files? All I find on my PC (Windows 8) are files with literally no extension and when I try to open them with notepad, that's just some weird symbols... Anyone help?


Because they're needed.

Don't know Win8 but can you change to a more detailed view?

@Fulano

Quote:
EDIT:
I was wrong already, the four "bluefire" files I found don't seem to have anything in them, at least when I open them with Paint.NET they seemed blank.


I know this is old but fyi, it's easier and much faster to use the Editor because it will show you the inside files at a glance and if there are no entrees in fields like LOD, then the file is empty. You can go right down the list and see all empty object files in one sitting. JIC you're still at it. Cheers
____________
"Do your own research"

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


Known Hero
Can I link to my own avatar?
posted September 05, 2014 04:09 PM

DrZomboss said:
Why does everyone talk about .xdb files? All I find on my PC (Windows 8) are files with literally no extension and when I try to open them with notepad, that's just some weird symbols... Anyone help?


All windows files have an extension, but Microsoft has hidden the extensions by default so people don't mess it up. They've done that since Windows 95.

To mod Heroes you have to show extensions first, then you have to extract the files in the Data folder. All of the data files are just zip files with the extension changed from .zip to .pak

xdb files is just a data format that holds XML text. Most of the game's data is recorded in these xdb files, so if you want to edit things like stats you just need to change the xdb files.


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


Famous Hero
posted September 05, 2014 07:29 PM

Quote:
   I was wrong already, the four "bluefire" files I found don't seem to have anything in them, at least when I open them with Paint.NET they seemed blank.




Yeah, I have the same feeling. The textures SEEM to be empty, however, they are not as empty as one can think. In fact, they contain 'hidden' data so even if you draw something there, remove it and export the texture, it will be changed. Actually I don't know how to get the 'hidden' textures so I'll be glad to hear that.

Have you checked any textures of creatures with AM_OPAQUE alpha mode? It is the only one that doesn't 'see' alpha channel, instead it 'sees' all 'hidden' data for unknown reasons.
____________

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


Legendary Hero
posted September 13, 2015 04:48 AM
Edited by bloodsucker at 04:54, 13 Sep 2015.

Hi, I never tried scripting for Heroes V and I'm not even quite familiar with the game but I would like to ask if any of you know a way to change the heroes specialties. If I want to give Zoltan Battle-Hardened (Vinrael's specialty) what should I do?

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


Known Hero
Can I link to my own avatar?
posted September 14, 2015 08:42 PM

I thought that was doable in the map editor, by just editing the hero's properties?

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


Admirable
Legendary Hero
modding wizard
posted September 14, 2015 09:14 PM
Edited by magnomagus at 21:18, 14 Sep 2015.

That is not done by scripting but by modifying the .xdb file from this hero in the mapobjects / heroes folder.
____________
MMH5.5 Downloads | MMH5.5 Translations | MMH5.5 FAQ

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


Legendary Hero
posted September 16, 2015 01:27 AM

magnomagus said:
That is not done by scripting but by modifying the .xdb file from this hero in the mapobjects / heroes folder.

Thx

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


Promising
Adventuring Hero
posted December 22, 2015 04:04 PM

Hello I have some question about heroes5 modding and I will be really glad if someone help me to find answers

Is it possible to create a hero with particular specialization to give specific creature bonuses (increased health, damage, etc.) for every hero level?
Plus, is it possible to give a hero additional skills to his skilltree, which could give this specific creature different abilities in battle, if hero chose this skill while leveling?
Is it possible to attach this creature the hero, so it would be impossible to transfer or dismiss this creature from hero army, and that each time a hero where he was hired with this creature?
and also is it possible to write a script that this creature would be impossible to hire more than one, and is it possible to write a script to resurect this creature if it was killed in the battle, right after the battle ends (or better in a few days)?
And finally can we safely for creatures to "kill" the initiative of the hero, so the hero would constantly miss his turns on the battlefield, but the creatures in his army would not?

If all these things are possible to implement, then it is possible to create a hero which fully participates in the battle as creature, although, it would be necessary to sacrifice one cell in the hero's army for this purpose
I would really like to create such mod, and trying to figure out how to do it, and whether it is possible to do it, if anyone has useful information or answers to questions written above, I will be very appreciated for help

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


Famous Hero
posted January 01, 2016 12:58 PM

I guess you're thinking of an RPG-styled mapmod? I've wanted to create such for a long time, so I already have some ideas I might share with you as I don't know if I'm into modding anymore:

1. Is it possible to create a hero with particular specialization to give specific creature bonuses (increased health, damage, etc.) for every hero level?

I guess not BUT you can choose a certain spec that would allow you to do so and replace a certain creature with what you want (e.g. Shak'Karukat's one for health and attack/defence).
But, as I guess you'd need large amounts of health and damage, I'd advice you creating 40 versions of a creature, basing on NCF, and make a script (the following is not a real one, it just shows the idea):

function LevelUp()
     level = GetHeroLevel(Hero);
     remove the Hero 1 creature with number a+level-1;
     add the Hero 1 creature with number a+level;
end;
Trigger(HERO_LEVEL_UP_TRIGGER, 'Hero', LevelUp);

This way lets you also make the creature look stronger with each level. But will work only if you want to have only one creature of the kind, because if you want to hire it somewhere at a dwelling, it gonna get more complicated.

Note that the script above might not work due to the language missing some functions. Then you'd have to think - e.g. instead of "Trigger" you can make a constant loop which checks if the Hero's level is still the same and triggers the function LevelUp(level) when it's higher than it's stored in the memory -- you have to modify the function in order to give the 'level' parameter now instead of getting it from hero as during one loop the hero might have two or more level-ups. You don't know.

2. Plus, is it possible to give a hero additional skills to his skilltree, which could give this specific creature different abilities in battle, if hero chose this skill while leveling?

More variations of the creature? Better not. BUT:
1) There are some skills which give creatures special abilities by themselves: Fiery Wrath, Cold Steel, Chilling Bones, Evasion, Immunity to Magic...
2) Combat scripts. Instead of regular battles, whenever you are about to start a combat, a script is triggered. Then, you can, basing on global variables which would be dependant on your skills and perks, modify some creature's attributes. I don't know if you can quite much, but still. For example you can make some sort of "cloning" ability so that at the beggining you get second creature that is similar to the first but is the version of one third/half/the same level (rounded down), depending on the mastery. Then, if you win the combat, the script destroys your enemy on the adventure map.

3. Is it possible to attach this creature the hero, so it would be impossible to transfer or dismiss this creature from hero army, and that each time a hero where he was hired with this creature?

I bet Magno knows.
About transfer/dismiss - remember Ylaya's third mission (A1C3M3)? Just make it an objective to have a certain creature (but there will also have to be a variable, changing with each level-up). What about another idea: each time the creature is dismissed, a loop in script checks it and restores it. If it's lost in a battle, a variable is changed so that loop doesn't change if the creature is in the army.
Ofc. it can also change in the armies of the other heroes (I think it's possible) and remove it from them.
If it's exchanged - sorry Winnetou, but you're not witty enough - you gonna have to dismiss the exchanged stack to be able to get your creature back as the loop won't leave you in peace

4. and also is it possible to write a script that this creature would be impossible to hire more than one, and is it possible to write a script to resurect this creature if it was killed in the battle, right after the battle ends (or better in a few days)?

function Dwelling()
     week = 1;
     if( GetDate(1, week, week/4)
           if( Hero has his creature )
                 Set creatures of this kind in dwelling to 0;
           end;
           week = week + 1;
     end;
end;

Trigger(NEW_DAY_TRIGGER, Dwelling);

Or destroy the dwelling after the creature is hired.

To resurrect? You can change the loop mentioned above to not check any variables and just bring the hero's creature back to life whatever happens. Or check RIGHT AFTER BATTLE if the creature is alive and if not, set a variable, e.g. DAYS = 3. Each day the variable will be decreased by 1 and after reaching 0 the creature is resurrected.

5. And finally can we safely for creatures to "kill" the initiative of the hero, so the hero would constantly miss his turns on the battlefield, but the creatures in his army would not?

Remember the first battle in C1M1? Isabel loses her turn and it's said she defends. You could try doing the same in your CombatScript (I mean, each time the hero's turn comes, he defends). Either, you can change all creatures' initiative to huge numbers but then spells will last longer. So you could fix spells as well. And then it might work. Otherwise, in Default Stats change "HeroInitiative" constant to 1. Or anyway it's called but it's somewhere in the beginning. But you will still have to change the spells' duration. And probably creatures' initiative as well as the battles may last long.

The first solution is the best IMO but there will be heroes' icons on the initiative bar.

BUT you can combine them all so that the hero's turn will be delayed as much as possible so if it finally comes, it will be skipped thanks to the script.

6. If all these things are possible to implement, then it is possible to create a hero which fully participates in the battle as creature, although, it would be necessary to sacrifice one cell in the hero's army for this purpose

Yeeeees, just create a second creature in 40 or more versions and implement a script similar to this mentioned before. Note that you don't really have to sacrifice a cell as you can summon him or her with the CombatScript. You won't be able to make his abilities resemble the real skills & perks, but you can try doing some witty scripts, though.

Hope this was helpful

Happy New Year to everybody!

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This thread is 8 pages long: 1 2 3 4 5 6 7 8 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0658 seconds