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: Heroes 5 Modding: Map Scripting
Thread: Heroes 5 Modding: Map Scripting This thread is 4 pages long: 1 2 3 4 · «PREV
TheOne
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?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
markkur
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.

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


Honorable
Supreme Hero
disrupting the moding industry
posted May 10, 2015 05:09 PM
Edited by dredknight at 17:55, 10 May 2015.

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?

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


Admirable
Legendary Hero
modding wizard
posted May 11, 2015 10:56 AM

afaik there are only those getsavedcombat functions, but I never experimented with them.
____________
MMH5.5 Downloads | MMH5.5 Translations | MMH5.5 FAQ

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
dredknight
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?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
lotihoti
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.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
dredknight
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.


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


Famous Hero
posted May 20, 2015 08:41 AM

Hard coded - only changeable with hex editing

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Emil6011
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

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Gidoza
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

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jagulars
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.
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
mctronic
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.

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


Admirable
Legendary Hero
modding wizard
posted April 07, 2017 10:54 PM

@Jagulars:

MyArray = {10,20,30,40}
MyVariable = MyArray[4]

means

MyVariable = 40
____________
MMH5.5 Downloads | MMH5.5 Translations | MMH5.5 FAQ

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
mctronic
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.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
mctronic
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.

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


Admirable
Legendary Hero
modding wizard
posted April 08, 2017 04:41 PM

@mctronic: those questions were asked a year ago.
____________
MMH5.5 Downloads | MMH5.5 Translations | MMH5.5 FAQ

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
mctronic
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.


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

Tavern Dweller
posted August 06, 2020 08:54 PM

Hello does anyone have red haven units script for HoF?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
frostymuaddib
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

 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
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0423 seconds