|
Thread: Heroes 5 Modding: Map Scripting | This thread is pages long: 1 2 3 4 · «PREV |
|
TheOne
Tavern Dweller
|
posted April 04, 2011 12:53 AM |
|
|
How do I make it so that when I get to a certain point a message appears?
|
|
markkur
Honorable
Legendary Hero
Once upon a time
|
posted April 08, 2011 03:40 PM |
|
|
I'm no scripter atm but look for "Krono's guide to scripting" in the Modding Wiki, it starts with "message boxes" I believe. Also, Rdeford has a later-made scripting guide for download at Celestial Havens.
|
|
dredknight
Honorable
Supreme Hero
disrupting the moding industry
|
posted May 10, 2015 05:09 PM |
|
|
Hello everyone!
Does anyone know how to Trigger a function when a hero of the current player starts a fight or when he wins/lose a fight ?
If yes, can you get the parameters for experience points earned in that battle?
Also is it possible to get Spell power of mage creature?
|
|
magnomagus
Admirable
Legendary Hero
modding wizard
|
posted May 11, 2015 10:56 AM |
|
|
|
dredknight
Honorable
Supreme Hero
disrupting the moding industry
|
posted May 12, 2015 11:14 AM |
|
|
thanks!
One more also.
How do you do debugging. are there any logs where you can see variable changes etc.. or just launch the game and test?
|
|
lotihoti
Famous Hero
|
posted May 12, 2015 12:46 PM |
|
|
I at least Launch the game and use the print function.
It allows you to check variables and other things.
|
|
dredknight
Honorable
Supreme Hero
disrupting the moding industry
|
posted May 19, 2015 09:24 PM |
|
|
Thanks!
Another one that I trouble the last few days. Does anyone knows where is the formula that defines creature spell power points?
I have seen the manual and know how it stacks but I couldnt find where it is defined.
|
|
lotihoti
Famous Hero
|
posted May 20, 2015 08:41 AM |
|
|
Hard coded - only changeable with hex editing
|
|
Emil6011
Tavern Dweller
|
posted April 07, 2016 10:38 PM |
|
Edited by Emil6011 at 22:39, 07 Apr 2016.
|
Hi guys could someone give me example script? how can i make ai hero unable to move? i want him to stay all the time in one place Also im new to this forum.Forum looks strange idk how to create new thread. There is no option create new thread
|
|
Gidoza
Famous Hero
|
posted April 20, 2016 05:48 PM |
|
|
Keeping It At A Minimum
I could use a little help with scripts, too. I'm trying to keep it as basic as possible.
Here's the necessary things I'm looking to do.
1. WIN CONDITION: Kill specific monster on the map (everyone else loses when someone defeats this monster).
2. DISABLE WIN CONDITION: Killing all opponents is not sufficient for victory - only #1 counts.
3. LOSE CONDITION: If 141 days pass, the game ends in a loss.
4. Seer's Hut Stuff: I can make Seer's Huts work, but not quite as I want. I have Seer's Huts, for example, that have been assigned to give a reward for bringing resources, but I can only get one resource to show up (example: 50 Wood). I want the demand to be 50 Wood, 50 Ore, 20 Sulfur, 20 Mercury, 20 Gems, 25 Crystal, and 5000 Gold. How do I fit all the requirements into the Seer's Hut?
Similarly, other Seer's Huts demand creatures or a specific set of primary skills, but that's it.
5. How do I set a script whereby all players (or just human players and not AI) begin the game with 5000 gold, and specific other resources?
Anyways - this is IT. That's all I want to do! Nothing more than this! Thank you for any help you can give!
Cheers!
-Gidoza
|
|
Jagulars
Tavern Dweller
|
posted April 06, 2017 02:04 PM |
|
|
Getting specific item within an array
How can I get specific item within a array?
GetGameVar function only has the parameter for the variable name but I don't want the whole array.
____________
|
|
mctronic
Hired Hero
|
posted April 07, 2017 10:12 PM |
|
Edited by mctronic at 01:27, 08 Apr 2017.
|
Emil6011 said: Hi guys could someone give me example script? how can i make ai hero unable to move? i want him to stay all the time in one place Also im new to this forum.Forum looks strange idk how to create new thread. There is no option create new thread
Hello Emil6011,
The function you are looking for is EnableHeroAI.
All you have to do is to add the following lines in your script:
EnableHeroAI("Mardigo", nil); -- Disables the hero Laszlo
EnableHeroAI("Mardigo", true); -- Enables the hero Laszlo
Make sure you use the script name of your hero for this function to work has illustrated above.
I suggest that you look at campaign maps [url=http://www.heroesofmightandmagic.com/heroes5/original_maps.shtml]here[/url] or my map The Initiation [url=http://heroescommunity.com/viewthread.php3?TID=42866]here[/url]
If you have anymore questions, don't hesitate to ask.
|
|
magnomagus
Admirable
Legendary Hero
modding wizard
|
posted April 07, 2017 10:54 PM |
|
|
|
mctronic
Hired Hero
|
posted April 08, 2017 12:20 AM |
|
Edited by mctronic at 01:28, 08 Apr 2017.
|
Hello Gidoza
Victory Condition
1. You'll need to use your map editor and go to the map tree of your map.
1.1 Add a creature to your map (i.e.: peasant) and insert a script name in the creature properties tree under the field Name (i.e.: peasant1).
1.2 Under "Objective" (either Common or Player Specific) in the map tree of your map select OBJECTIVE_KIND_DEFEAT_NEUTRALS.
1.3 Add a parameter by right-clicking Add under "Parameters". Insert the script name of the creature you want to kill (i.e.: peasant1).
1.4 Still in the "Objective" portion, insert the number 141 under the field Timeout.
Adding resources
The function you are looking is SetPlayerResource
SetPlayerResource(PLAYER_1,WOOD,10);
Not aware you can send resources to all players with 1 command. You may need to make a function such as this one
function SetPlayerResources(PlayerID, ResourceWood, ResourceOre, ResourceMercury, ResourceSulfur, ResourceCrystal, ResourceGem, ResourceGold)
SetPlayerResource(PlayerID,WOOD,ResourceWood);
SetPlayerResource(PlayerID,ORE,ResourceOre);
SetPlayerResource(PlayerID,MERCURY,ResourceMercury);
SetPlayerResource(PlayerID,SULFUR,ResourceSulfur);
SetPlayerResource(PlayerID,CRYSTAL,ResourceCrystal);
SetPlayerResource(PlayerID,GEM,ResourceGem);
SetPlayerResource(PlayerID,GOLD,ResourceGold);
end;
SetPlayerResources(PLAYER_1, 15, 15, 8, 8, 8, 8, 15000);
SetPlayerResources(PLAYER_2, 15, 15, 8, 8, 8, 8, 15000);
or use SetPlayerStartResources SetPlayerStartResources(player, wood, ore, mercury, crystal, sulfur, gem, gold);
Never used the function but it should look like this:
SetPlayerStartResources(PLAYER_1, 99, 99, 30, 30, 30, 30, 10000);
Seer hut
Not aware you can specify multiple resources for seer huts. You may have to do this manually.
Hope this helps.
|
|
mctronic
Hired Hero
|
posted April 08, 2017 01:22 AM |
|
Edited by mctronic at 01:23, 08 Apr 2017.
|
Hello Jagulars,
For help, I suggest you take a look at the script of my map [url=https://www.celestialheavens.com/forum/8/16491#p367429]here[/url]
I'm using several arrays for various reasons.
Hope this helps.
|
|
magnomagus
Admirable
Legendary Hero
modding wizard
|
posted April 08, 2017 04:41 PM |
|
|
|
mctronic
Hired Hero
|
posted May 10, 2017 01:54 AM |
|
Edited by mctronic at 02:39, 10 May 2017.
|
Hello all,
I have a question.
Where are stored the global variable (by function SetGameVar) created during the game ?
I have look into the file user_a2 but I did not find it.
If someone knows, please let me know.
|
|
arachan123
Tavern Dweller
|
posted August 06, 2020 08:54 PM |
|
|
Hello does anyone have red haven units script for HoF?
|
|
frostymuaddib
Promising
Supreme Hero
育碧是白痴
|
posted August 07, 2020 10:37 AM |
|
|
arachan123 said: Hello does anyone have red haven units script for HoF?
I'm not sure what script are you referring to, but you can always check original HoF maps for their scripts. Go to dataa1 folder and open a1-data.pak file with 7zip or winrar. Then go to Maps/Scenario. You can find all campaign maps there. Each of the map folder contains a lua file that contains the script. Check them for the stuff you need. You can find some scripts in the file a1p1-data.pak in the same place. This is the pak file of the HoF patch, and may contain some fixed scripts.
____________
"Occam's shuriken: when the answer is elusive, never rule out ninjas." -- Dr. Gordon Freeman (Freeman's Mind)
"lol" -- VERRIKER VON ERWINSSEN
|
|
|
|