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 > MapHaven Guild > Thread: Heroes 5 Map Editor Help and Tips...
Thread: Heroes 5 Map Editor Help and Tips... This thread is 43 pages long: 1 ... 10 11 12 13 14 ... 20 30 40 43 · «PREV / NEXT»
Warmonger
Warmonger


Promising
Legendary Hero
fallen artist
posted September 16, 2008 05:45 PM
Edited by Warmonger at 18:18, 16 Sep 2008.

Oh jeez... I'll have to put a lot of scarecrows on the map then.

As if they couldn't make all the objects removable by default?

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


Known Hero
Wyld Mapper
posted September 16, 2008 06:17 PM

Quote:
Oh jeez... I'll have to put a lot of scarecrows on the map then.

As if they couldn't make all the objects removable by deafult?


Indeed! This omission is just one of my many complaints.

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


Honorable
Undefeatable Hero
Elite Assassin
posted September 16, 2008 06:21 PM

Quote:
factor=(0.95 + 0.05 * GetDifficulty());
day = 1
print ("factor=",factor);

Result:
Quote:
factor=0.9999999403953552

When you work with rational numbers in computers, the addition loses "precision". It's complicated to know why, but you just have to know this
____________

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


Adventuring Hero
Lover of Ancient Philosophy
posted September 17, 2008 02:33 AM

Quote:
I haven't tried this myself, but suggest it anyway. In the editor, click on the town object and look over in the object properties window. One of the properties is spellIDs. By default, it contains a long list of potential spells. If you right click on the icon for one of them, you will get a pop up menu with Insert and Delete commands. If you click on the value for one of them, you will get a dropdown list of spell choices. Anyway, try changing the values of some of them to the spells you want the town to have. Then, delete the extra ones. Test it to see what happens.


Good suggestion... tried it but didn't work.  Curses!

Anything other thoughts on this one?  Did they change the map editor in the patch to get rid of the spell tab?  Why make the editor even more of a pain to use than it already is?  

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


Promising
Legendary Hero
fallen artist
posted September 17, 2008 07:14 AM

function guardquest (heroName)
  if IsObjectExists ("Guard") == false then
       GiveHeroSkill (heroName,SPELL_SKILL_DEFENCE3);
GiveHeroSkill (heroName,WIZARD_FEAT_SPOILS_OF_WAR);
   end;
end;


It does not work, not only returning usual error "nil value for false", but simply not teachning my hero any of those skills.

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


Known Hero
Wyld Mapper
posted September 17, 2008 12:43 PM
Edited by rdeford at 12:47, 17 Sep 2008.

Quote:
function guardquest (heroName)
  if IsObjectExists ("Guard") == false then
       GiveHeroSkill (heroName,SPELL_SKILL_DEFENCE3);
GiveHeroSkill (heroName,WIZARD_FEAT_SPOILS_OF_WAR);
   end;
end;


It does not work, not only returning usual error "nil value for false", but simply not teachning my hero any of those skills.



Haven't tested this answer, but I think the problem is your use of false in the equality test. Use nil instead and I think it will work.

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


Promising
Legendary Hero
fallen artist
posted September 17, 2008 12:55 PM

In fact similiar condition works well when I try to use another script removing the object, so that's not the main problem.

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


Known Hero
Wyld Mapper
posted September 17, 2008 01:12 PM

Quote:
In fact similiar condition works well when I try to use another script removing the object, so that's not the main problem.


I still think you ought to try using nil  because of the error message you are getting. I will create a test map and figure out how to get this code working. Give me a little time.
____________
-------------
Mage of Soquim

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


Known Hero
Wyld Mapper
posted September 17, 2008 02:19 PM
Edited by rdeford at 14:20, 17 Sep 2008.

@Warmonger--

The use of nil  got rid of the error.

The code below works in a test map. Beyond the equality test error, the reason why your code would not give the skill is because you cannot give a skill unless the hero has the proper prerequisites. In this case, I had to edit the hero to give
Expert Luck and Resourcefulness before the script would give the here the Spoils of War skill. If you check the skill wheel, or edit the hero's skills in the editor, you will see how the progression must work.


function guardquest (heroName)
   if IsObjectExists ("Guard") == nil then
       print("spoils = ", GiveHeroSkill (heroName, WIZARD_FEAT_SPOILS_OF_WAR));
   end;
end;
 Trigger(OBJECT_TOUCH_TRIGGER, "testObj", "guardquest");

____________
-------------
Mage of Soquim

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


Honorable
Undefeatable Hero
Elite Assassin
posted September 17, 2008 02:49 PM

Quote:
It does not work, not only returning usual error "nil value for false", but simply not teachning my hero any of those skills.
You got the "nil value for false" error because the game couldn't find a "false" variable for some reason
____________

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


Known Hero
Wyld Mapper
posted September 17, 2008 03:03 PM

Quote:
Quote:
It does not work, not only returning usual error "nil value for false", but simply not teachning my hero any of those skills.
You got the "nil value for false" error because the game couldn't find a "false" variable for some reason


The true and false constants are defined in advmap-startup.lua

However, even so, I frequently run into the same problem as Warmonger had. Consequently, I've begun to us not nil and nil instead. They are understood by Lua and do not need to be declared elsewhere.

____________
-------------
Mage of Soquim

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


Adventuring Hero
Lover of Ancient Philosophy
posted September 19, 2008 03:47 AM

I'm sorry to bring this up again gang, but can anyone give a suggestion about how to designate spells in the town properties if the spell tab is no longer there?

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


Promising
Legendary Hero
fallen artist
posted September 19, 2008 08:41 AM
Edited by Warmonger at 08:42, 19 Sep 2008.

Ok, during tetsing I found some problems I can;t overcome:

function blackiesquest (heroName)
if IsObjectExists ("Blackies") == nil
   and blackiesquestactive == not nil
   then
       QuestionBox (path.."CrystalDragons.txt",crystaldragonsoption (heroName),"normaloption");
ChangeHeroStat (heroName, STAT_EXPERIENCE, 25000);
ShowFlyingSign (path.."objectiveComplete.txt", "BlackiesHut",1,1);
blackiesquestactive = nil;
else
       if blackiesquestactive == not nil then
  ShowFlyingSign (path.."BlackiesQuest.txt","BlackiesHut",1,3);
  OverrideObjectTooltipNameAndDescription("BlackiesHut", path.."BlackiesName.txt", path.."BlackiesDesc.txt");
else
  OverrideObjectTooltipNameAndDescription("BlackiesHut", path.."BlackiesName.txt", path.."objectiveComplete.txt");
  ShowFlyingSign (path.."objectiveComplete.txt", "BlackiesHut",1,1);
end;
end;
end;
function crystaldragonsoption (heroName)
AddHeroCreatures (heroName, 291, 20);
end;
function normaloption ()
joiner (7,25,36,68,90);
ShowFlyingSign (path.."Sucker.txt", "BlackiesHut",1,1);
end;


This function uses questionbox so that player may choose waht reward he receives from the quest. The problem is, in case of clicking "cancel", he gets them BOTH.

Also, I have no idea how to level-up deployed invaders. Poor game mechanics allow to get a level only when player gets his turn, which does not always apply here. Moreover, I have to give them one by one or hero will receive n * 1000 exp as he started from 1st level.

I try to level-up heroes daily, but AI is not given a turn as has no heroes or towns, even though I did not use specific command.

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


Known Hero
Wyld Mapper
posted September 19, 2008 03:45 PM

@ Warmonger--  regarding QuestionBox, I haven't tested this, but you might try creating a global variable (for example named tempHeroName) and storing the value of heroName in it. Then, in the QuestionBox function call, use quotes around the function name and do not try to pass the heroName parameter. Example:

QuestionBox (path.."CrystalDragons.txt","crystaldragonsoption","normaloption");

Then down in the crystaldragonsoption() function, use the global variable instead of the passed parameter. Example:

 function crystaldragonsoption ()
AddHeroCreatures (tempHeroName, 291, 20);
end;

____________
-------------
Mage of Soquim

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


Honorable
Undefeatable Hero
Elite Assassin
posted September 19, 2008 03:59 PM
Edited by Asheera at 16:00, 19 Sep 2008.

Warmonger, the functions that have as parameters other functions require a function name in QUOTES. The same as what I said in the Trigger function

WRONG
QuestionBox (path.."CrystalDragons.txt",crystaldragonsoption(heroName),"normaloption");
QuestionBox (path.."CrystalDragons.txt",crystaldragonsoption(),"normaloption");
QuestionBox (path.."CrystalDragons.txt",crystaldragonsoption,"normaloption");

CORRECT
QuestionBox (path.."CrystalDragons.txt","crystaldragonsoption","normaloption");
____________

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


Promising
Legendary Hero
fallen artist
posted October 04, 2008 09:13 AM

A little tutorial on how to set journal objectives, please?

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


Adventuring Hero
posted October 21, 2008 08:26 PM
Edited by Dagon at 20:28, 21 Oct 2008.

I'm working on map. It is my first and I have problem.

Main objective is that hero must get to his own Town. And my question is:
How can I put a Random Hero in different place than his Random Town? This is the problem which i can't reslove. Hero always starts next to town. He should start from right, upper corner and get to the second end of the map where is his town.

Please help


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


Famous Hero
Galiv :D
posted November 13, 2008 08:08 PM

2 questions

Why isn't this thread stickied?

Why does the editor "check map" keep telling that "several heroes have no names, location 25:29"; when that hero does have a name. It is Makarl and I gave it a custom name. Placed him from the tools panel, objects->heroes->necromancer.

Thanks.

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


Honorable
Undefeatable Hero
Elite Assassin
posted November 13, 2008 08:12 PM

Sometimes those 'checks' don't work how they should. For example, the 'check script' one is crap, it doesn't display correct errors at all.
____________

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


Known Hero
Wyld Mapper
posted November 13, 2008 08:39 PM
Edited by rdeford at 20:40, 13 Nov 2008.

Quote:
Sometimes those 'checks' don't work how they should. For example, the 'check script' one is crap, it doesn't display correct errors at all.


This quote is exactly correct. You may ignore all errors reported by the H5 editor. The only errors that you must pay attention to (and correct) are the errors reported by the game's script compilation process on the developer console. If you you have not enabled the game's developer console, do so before you try to write any scripts.
____________
-------------
Mage of Soquim

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread » This thread is 43 pages long: 1 ... 10 11 12 13 14 ... 20 30 40 43 · «PREV / NEXT»
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.1105 seconds