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
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


Responsible
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


Supreme Hero
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


Promising
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


Supreme Hero
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


Supreme Hero
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


Known 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

Tavern Dweller
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 here or my map The Initiation here

If you have anymore questions, don't hesitate to ask.

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


Promising
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

Tavern Dweller
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

Tavern Dweller
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 here

I'm using several arrays for various reasons.

Hope this helps.

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


Promising
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
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.0903 seconds