|
Thread: Heroes 5 Modding: Map Scripting | This thread is pages long: 1 2 3 4 · «PREV / NEXT» |
|
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.
|
|
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!
|
|
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!?
|
|
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!
|
|
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?
|
|
Mirthless
Tavern Dweller
|
posted July 17, 2009 07:39 AM |
|
|
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.
|
|
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
|
|
Mirthless
Tavern Dweller
|
posted July 22, 2009 02:25 PM |
|
|
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.
|
|
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.
|
|
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
|
|
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!
|
|
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
|
|
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!
|
|
Mirthless
Tavern Dweller
|
posted July 23, 2009 04:50 PM |
|
|
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.
|
|
Mirthless
Tavern Dweller
|
posted July 23, 2009 04:59 PM |
|
|
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.
|
|
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!
|
|
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:
[url=http://heroescommunity.com/viewthread.php3?TID=25237]3D Attempts and Theories[/url]|[url=http://heroescommunity.com/viewthread.php3?TID=25238]Sounds and Music[/url]|Map Scripting|[url=http://heroescommunity.com/viewthread.php3?TID=25240]Texture Editing[/url]|[url=http://heroescommunity.com/viewthread.php3?TID=25241]Texts and Interface[/url]|[url=http://heroescommunity.com/viewthread.php3?TID=25242&pagenumber=1]XDB Modding[/url]
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 ?
|
|
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:
[url=http://heroescommunity.com/viewthread.php3?TID=25237]3D Attempts and Theories[/url]|[url=http://heroescommunity.com/viewthread.php3?TID=25238]Sounds and Music[/url]|Map Scripting|[url=http://heroescommunity.com/viewthread.php3?TID=25240]Texture Editing[/url]|[url=http://heroescommunity.com/viewthread.php3?TID=25241]Texts and Interface[/url]|[url=http://heroescommunity.com/viewthread.php3?TID=25242&pagenumber=1]XDB Modding[/url]
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.
____________
|
|
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:
[url=http://heroescommunity.com/viewthread.php3?TID=25237]3D Attempts and Theories[/url]|[url=http://heroescommunity.com/viewthread.php3?TID=25238]Sounds and Music[/url]|Map Scripting|[url=http://heroescommunity.com/viewthread.php3?TID=25240]Texture Editing[/url]|[url=http://heroescommunity.com/viewthread.php3?TID=25241]Texts and Interface[/url]|[url=http://heroescommunity.com/viewthread.php3?TID=25242&pagenumber=1]XDB Modding[/url]
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?
|
|
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?
|
|
|