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 ]
New Server | HOMM1: info forum | HOMM2: info forum | HOMM3: info forum | HOMM4: info forum | HOMM5: info forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 5 - Modders Workshop > Thread: Heroes 5 Modding: Map Scripting
Thread: Heroes 5 Modding: Map Scripting This thread is 4 pages long: 1 2 3 4 · «PREV / NEXT»
Seiat
Seiat


Hired Hero
posted July 15, 2009 05:56 PM
Edited by Seiat at 18:25, 15 Jul 2009.

Well, I've come to the conclusion that if a map is a single player to begin with, it's staying a single player map. I do have some questions though... The first regards whether or not creatures can have effects placed on them at the start of the battle...

and the second regards summoned creatures. I'm trying to have the battle start out so that there are 4 stacks of creatures summoned in the middle of a battlefield... This i what I have

function Start()
SummonCreature(DEFENDER, 37, 90, 9, 3);
sleep(1);
SummonCreature(DEFENDER, 37, 90, 9, 12);
sleep(1);
SummonCreature(DEFENDER, 37, 65, 9, 9);
sleep(1);
SummonCreature(DEFENDER, 37, 65, 9, 6);
sleep(1);
end

The first creature summons... but the other 3 don't?? did I make an error with the sleep function? or is it possible that objects in the middle of the battle screen keep other creatures from being summoned?

EDIT: Nevermind, I figured it out.

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


Supreme Hero
Manchild
posted July 15, 2009 06:14 PM

guys i am creating a new map and i have no idea about scripts. who will help me?
____________
Heroes VI is here and Necropolis is serious trouble!

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


Hired Hero
posted July 15, 2009 06:28 PM

I'll try to help you and maybe in return you could help me a bit, cuz i'm half noob at this too

For starters look at the script functions/ID's in the start menu.. if you know anything about lua then you should be able to piece some of it together... but i'll try to help if you tell me what ur trying to do


err... you have lotsa stars... You weren't mocking me I hope!?

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


Supreme Hero
Manchild
posted July 15, 2009 07:00 PM

1. i am not mocking!
2. i have no idea what lua is, or n general about scripts
3. i need someone to either teach me step by step or do it for me. if you know about scripts in maps give me your msn or skype to talk easier
____________
Heroes VI is here and Necropolis is serious trouble!

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


Hired Hero
posted July 16, 2009 09:17 PM

k ur fully added... while I'm here, does anyone know the script function name for casting a spell?

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

Tavern Dweller
posted July 17, 2009 07:39 AM
Edited by Mirthless at 08:10, 17 Jul 2009.

Quote:
k ur fully added... while I'm here, does anyone know the script function name for casting a spell?


UnitCastAimedSpell(unitName, spell, targetUnit)
UnitCastAreaSpell(unitName,spell,x,y)
UnitCastGlobalSpell(unitName,spell)

You should be carefull with these, because if unit (hero can also be a unit, as i recall) doesn't have enought mana script would die in pain.

So there are some functions that would help you prevent this:

GetUnitManaPoints( unitName )
GetUnitMaxManaPoints(unitName)
SetUnitManaPoints(unitName, manaPoints) (think this one can make mana points exceed it's maximum value)

Technically you can also start this spell cast in it's own thread and make an
errorHook( fCallback )
to correct any problems, but think this is not necessary.

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


Hired Hero
posted July 22, 2009 02:51 AM
Edited by Seiat at 06:34, 22 Jul 2009.

Awesome, thanks for sharing that.
Edit: Is the unit name the script name or the ID? Neither seems to work for me

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

Tavern Dweller
posted July 22, 2009 02:25 PM
Edited by Mirthless at 14:30, 22 Jul 2009.

Quote:
Awesome, thanks for sharing that.
Edit: Is the unit name the script name or the ID? Neither seems to work for me


As far as i remember in battle each unit stack has it's unique name (remember, one can have two different stacks with same unit type)
I dont remember exact name format, but you can see your creatures names using functions:

GetAttackerCreatures()
GetAttackerHero()
GetAttackerWarMachines()

GetDefenderBuildings()
GetDefenderCreatures()
GetDefenderHero()
GetDefenderWarMachines()

unitNames()

They return array of names.

Names you provide to cast spell function should have exactly the same format.

And one more thing, you have to make sure that the battle has started (preparation phase has finished) before you call cast spell function (or any other function that interacts with objects on battlefield, i think).
To do so you may call function:
combatStarted(), it would return  not nil if battle started and nil if not.
The other way is to overload function Start or doStart, but i'm not sure if it works in ToE 3.1. You have to check this out.

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


Hired Hero
posted July 23, 2009 07:12 AM

I don't suppose their might be an extended script functions guide? There seems to be an awful lot that were 'left out' in the manual.

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


Honorable
Legendary Hero
Far-flung Keeper
posted July 23, 2009 09:33 AM

Here is one, but I'm not sure if everything's there.
____________
"Those who forget their history are inevitably doomed to repeat it." —Proverb, Might and Magic VIII

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


Supreme Hero
Manchild
posted July 23, 2009 03:47 PM

hello again, i am in need again of someone that knows about scripting. who can help me?
____________
Heroes VI is here and Necropolis is serious trouble!

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


Honorable
Legendary Hero
Far-flung Keeper
posted July 23, 2009 04:36 PM

Depends on the question, doesn't it...
____________
"Those who forget their history are inevitably doomed to repeat it." —Proverb, Might and Magic VIII

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


Supreme Hero
Manchild
posted July 23, 2009 04:39 PM

general help about scripting. i want someone who is good at it and can teach me a couple of things
____________
Heroes VI is here and Necropolis is serious trouble!

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

Tavern Dweller
posted July 23, 2009 04:50 PM
Edited by Mirthless at 16:54, 23 Jul 2009.

Quote:
I don't suppose their might be an extended script functions guide? There seems to be an awful lot that were 'left out' in the manual.


Well there is a function list with their arguments and return values that contains all script functions known to date (some "secret" (or probably just missed in documentation) function signatures were torn from exe file), but i have it only with descriptions in Russian. (ussually you can say what function does just by it's name and names of arguments) I can provide it as is if you want.

Don't know if it's been translated English.
If it wasn't maybe i will translate it one day.

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

Tavern Dweller
posted July 23, 2009 04:59 PM
Edited by Mirthless at 17:00, 23 Jul 2009.

Quote:
general help about scripting. i want someone who is good at it and can teach me a couple of things


Documentation provided with the game and some googled lua guide would give you general picture.

If you have more specific problem it would be better to ask less general question.

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


Supreme Hero
Manchild
posted July 23, 2009 05:01 PM

i dont need to know to become a scripter or programmer! i need to learn some specific thing to "play" with mapmaking. check your HC messages.
____________
Heroes VI is here and Necropolis is serious trouble!

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


Hired Hero
posted September 12, 2009 07:41 AM

Quote:
This thread is for discussing the Map Scripting in Heroes 5.

What belong to this threads: Small guides and examples, not long enough for separate thread; Theoretical possibilities in H5 Modding; Work in progress; Generally discussion about the Map Scripting;

Modding Thread Group:
3D Attempts and Theories|Sounds and Music|Map Scripting|Texture Editing|Texts and Interface|XDB Modding


I am creating a map with a Academy hero as the boss at last.

Because the player can cast a lot of Dark Magic like Frenzy or Puppet Master , and the AI hero always attacks directly only but never casts Magic Immunity or Cleansing , makes the map too easy to pass . Also the Destructive Magic is too powerful for the combat ( the number of army is not huge)¡ª¡ª the mini-artifact that boost Magic Protection , Initiative and Speed can decrease the power of Destructive Magic.

Is there any script function to set the mini-artifact of creatures or to get what Buff(like Frenzy) the creature is sufferd from in the combat ?

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

Tavern Dweller
posted September 13, 2009 08:19 PM
Edited by PvP at 20:19, 13 Sep 2009.

Quote:
Quote:
This thread is for discussing the Map Scripting in Heroes 5.

What belong to this threads: Small guides and examples, not long enough for separate thread; Theoretical possibilities in H5 Modding; Work in progress; Generally discussion about the Map Scripting;

Modding Thread Group:
3D Attempts and Theories|Sounds and Music|Map Scripting|Texture Editing|Texts and Interface|XDB Modding


I am creating a map with a Academy hero as the boss at last.

Because the player can cast a lot of Dark Magic like Frenzy or Puppet Master , and the AI hero always attacks directly only but never casts Magic Immunity or Cleansing , makes the map too easy to pass . Also the Destructive Magic is too powerful for the combat ( the number of army is not huge)¡ª¡ª the mini-artifact that boost Magic Protection , Initiative and Speed can decrease the power of Destructive Magic.

Is there any script function to set the mini-artifact of creatures or to get what Buff(like Frenzy) the creature is sufferd from in the combat ?


1. No it's impossible to set miniartifacts on creatures using scripts.
2. Didn't understand the second part of the question. If you want to know what active spells are on create than i'm affraid it's impossible too.

PS: probably you already figured it out, but you can make this fight harder by overloading function DefenderHeroMove(sUnitName). This function would be automatically called when defending hero starts his move. Using this function you can make him cast something or summon creatures or whatever. At the end of this function if you return nil hero would continue his turn, if you return true (or not nil, not sure which one would work) hero would finish his turn.
____________

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


Hired Hero
posted September 14, 2009 08:57 AM

Quote:
Quote:
Quote:
This thread is for discussing the Map Scripting in Heroes 5.

What belong to this threads: Small guides and examples, not long enough for separate thread; Theoretical possibilities in H5 Modding; Work in progress; Generally discussion about the Map Scripting;

Modding Thread Group:
3D Attempts and Theories|Sounds and Music|Map Scripting|Texture Editing|Texts and Interface|XDB Modding


I am creating a map with a Academy hero as the boss at last.

Because the player can cast a lot of Dark Magic like Frenzy or Puppet Master , and the AI hero always attacks directly only but never casts Magic Immunity or Cleansing , makes the map too easy to pass . Also the Destructive Magic is too powerful for the combat ( the number of army is not huge)¡ª¡ª the mini-artifact that boost Magic Protection , Initiative and Speed can decrease the power of Destructive Magic.

Is there any script function to set the mini-artifact of creatures or to get what Buff(like Frenzy) the creature is sufferd from in the combat ?


1. No it's impossible to set miniartifacts on creatures using scripts.
2. Didn't understand the second part of the question. If you want to know what active spells are on create than i'm affraid it's impossible too.

PS: probably you already figured it out, but you can make this fight harder by overloading function DefenderHeroMove(sUnitName). This function would be automatically called when defending hero starts his move. Using this function you can make him cast something or summon creatures or whatever. At the end of this function if you return nil hero would continue his turn, if you return true (or not nil, not sure which one would work) hero would finish his turn.


Thanks for you reply.

As scripts cannot set miniartifact, is there anyway to set it when creating the map ?

I have tried DefenderHeroMove(sUnitName),but find that it acts oddly.If I return nil , AI take the control and do something as usual. But if I return not nil, AI hero always perfoms a "Defend" action which makes the ATB to 0 which nearly half the number of actions of the AI hero significantly for a Mass Haste takes only 0.5 ATB . Is it a bug or did I do something wrong?

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

Tavern Dweller
posted September 14, 2009 09:42 AM
Edited by PvP at 09:43, 14 Sep 2009.

Quote:

I have tried DefenderHeroMove(sUnitName),but find that it acts oddly.If I return nil , AI take the control and do something as usual. But if I return not nil, AI hero always perfoms a "Defend" action which makes the ATB to 0 which nearly half the number of actions of the AI hero significantly for a Mass Haste takes only 0.5 ATB . Is it a bug or did I do something wrong?


Well it works as it should, but the functions you placed inside this function before return should also be called. Does script ignores them? What functions did you put there?

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

Page compiled in 0.1718 seconds