~ Forums of Enroth ~

An Enroth diehard fan community
 
HomeHome  ChatChat  FAQFAQ  SearchSearch  RegisterRegister  Log inLog in  
Latest topics
» H3SW: General Graphics discussion
by Sir Albe Today at 19:42

» Need help, new to homm2
by Orzie 2017-07-19, 05:07

» [Ironfist ver 1.3.0] Weight of save files and loading/saving time
by Unknown_Hero 2017-07-17, 22:59

» [Ironfist ver 1.3.0] Wrong positions of spells in Mage Guild
by Unknown_Hero 2017-07-17, 21:38

» [Ironfist ver 1.3.0] Bugs with info of spells
by Unknown_Hero 2017-07-17, 03:39

» [Ironfist ver 1.3.0] Game "freezes" and long waiting times during AI turns
by Unknown_Hero 2017-07-15, 23:41

» [Ironfist ver 1.3.0] Sorrow's End map - Sprites of creatures missing on the adventure map
by Unknown_Hero 2017-07-15, 23:39

Poll
"Wait" in HoMM2?
Yes
80%
 80% [ 44 ]
No
20%
 20% [ 11 ]
Total Votes : 55
Most Viewed Topics
H3SW: General Graphics discussion
Ragoon's Graphics For HoMM3SW
H3SW General Discussion
H3SW: Dwelling Development
H3SW Map List: Work in progress
Dervish Faction General Concept
Enrothian Fan Art
H3SW Recruitment Point - Enroth Needs You!
Серия книг "Земли Меча и Магии"
Heroes of Might and Magic 3: The Succession Wars - General info

Share | 
 

 [Ironfist ver 1.2.1] Sorrow's End script

View previous topic View next topic Go down 
AuthorMessage
Unknown_Hero
Minotaur
Minotaur
avatar

Messages : 323
Quality Points : 37
Registration Date : 2015-09-06

PostSubject: [Ironfist ver 1.2.1] Sorrow's End script   2017-02-15, 13:46

You have changed the position of the BuildInCurrentTown(BUILDING_MAGE_GUILD) scripting calls in the Sorrow's End script and we are back to the bug described in this thread: Sorrow's End script in the eighth post.

Which causes the hero to learn "free" spells that are no longer in the Mage Guild.

The Scripting Documentation page has even been modified to explain this:

SetGuildSpell(town, level, column, spell)
town: The town to modify. (See GetCurrentTown.)
level: The level of mage guild to modify.
column: A number 0-4 representing which spell in that level to change.
spell: The spell to assign to that level and column of the mage guild

Sets which spell is available in the mage guild at the given level and column. Which spells will be available in the mage guild is predetermined, meaning this can be used whether or not the mage guild has been built to that level. It is recommended that you call this before building a mage guild, as heroes will immediately learn whatever is in the mage guild immediately when the mage guild is built.
Back to top Go down
Darmani
Master Modder
Master Modder
avatar

Messages : 166
Quality Points : 30
Registration Date : 2014-12-27

PostSubject: Re: [Ironfist ver 1.2.1] Sorrow's End script   2017-02-17, 02:46

Ummmm.....this sounds like not a bug. Yes, if you build a mage guild, the hero will learn whatever spells are in the guild.
Back to top Go down
Unknown_Hero
Minotaur
Minotaur
avatar

Messages : 323
Quality Points : 37
Registration Date : 2015-09-06

PostSubject: Re: [Ironfist ver 1.2.1] Sorrow's End script   2017-02-17, 05:47

May be that this sounds like not a bug, but it's certainly an "incoherence". Smile

It means the hero learns the original spells from the Mage Guild (generated at start of the game) as soon as the Mage Guild is built (so, this is not a bug). And then he learns the spells generated by the script (the original spells are removed and remplaced by the spells generated by the script).
In fact, the hero should not learn the original spells that are removed from the Mage Guild by the script afterwards.

With the way it's currently done, the hero can learn up to 6 level 5 spells (2 original spells and 4 scripted spells). It' more than half the number of level 5 spells present in the game. And this only for 1 Mage Guild. Ouch...
And this will be the case for all scripts that use these scripting calls.

Is this supposed to work this way by design?

And if the position of the scriting calls is changed again in the script, the additional spell sprites will not be displayed in the Mage Guild as explained in this thread : Additional spell sprites are not displayed in the Mage Guild in the third post.
Back to top Go down
Darmani
Master Modder
Master Modder
avatar

Messages : 166
Quality Points : 30
Registration Date : 2014-12-27

PostSubject: Re: [Ironfist ver 1.2.1] Sorrow's End script   2017-02-17, 07:30

The bug in the post you linked to was fixed, was it not?

The behavior you're describing in this post makes perfect sense. If you read all the books in the library, and then the library swaps out their supply of books, and you read all the books in the library again, then you'll have read a lot of books.
Back to top Go down
Unknown_Hero
Minotaur
Minotaur
avatar

Messages : 323
Quality Points : 37
Registration Date : 2015-09-06

PostSubject: Re: [Ironfist ver 1.2.1] Sorrow's End script   2017-02-17, 18:02

I have found the way to make the hero do not learn free spells and all sprite spells are displayed correctly in the Mage Guild. Smile

You must first set the Mage Guild spells with SetGuildSpell before building the Mage Guild with BuildInCurrentTown, and only then set the number of spells in the Mage Guild with SetNumGuildSpells.

Code:
Trigger(MAP_START, "", "give_spells");
Trigger(TOWN_LOADED, "Sorrow's End", "check_library");

startMap = 0;

mapVariables = {"startMap"};

function give_spells()
 if startMap == 0 then
 startMap = 1;
 p = GetPlayer(0);
 h = GetHero(p, 0);
 GrantSpell(h, SPELL_METEOR_SHOWER);
 SetPrimarySkill(h, PRIMARY_SKILL_KNOWLEDGE, 10);
 SetSpellpoints(h, 100);
 SetSecondarySkill(h, SECONDARY_SKILL_LEADERSHIP, 1);
 SetSecondarySkill(h, SECONDARY_SKILL_WISDOM, 3);

 p2 = GetPlayer(1);
 h2 = GetHero(p2, 0);
 GrantArmy(h2, CREATURE_BONE_DRAGON, 10);
 end
end;

function check_library()
 t = GetCurrentTown();
 if HasVisitingHero(t) then
 h = GetVisitingHero(t);
 if HasArtifact(h, ARTIFACT_MAGES_RING_OF_POWER) then
 TakeArtifact(h, ARTIFACT_MAGES_RING_OF_POWER);
 MessageBox("The Mage's Ring fits easily in the keyhole of the sealed library door. Inside lie shelves packed with tomes.");
 SetGuildSpell(t, 4, 0, SPELL_DIMENSION_DOOR);
 SetGuildSpell(t, 4, 1, SPELL_SUMMON_WATER_ELEMENTAL);
 SetGuildSpell(t, 4, 2, SPELL_SUMMON_EARTH_ELEMENTAL);
 SetGuildSpell(t, 4, 3, SPELL_RESURRECT_TRUE);
 BuildInCurrentTown(BUILDING_MAGE_GUILD);
 BuildInCurrentTown(BUILDING_MAGE_GUILD);
 BuildInCurrentTown(BUILDING_MAGE_GUILD);
 BuildInCurrentTown(BUILDING_MAGE_GUILD);
 BuildInCurrentTown(BUILDING_MAGE_GUILD);
 SetNumGuildSpells(t, 0, 4);
 SetNumGuildSpells(t, 1, 4);
 SetNumGuildSpells(t, 2, 4);
 SetNumGuildSpells(t, 3, 4);
 SetNumGuildSpells(t, 4, 4);
 end;
 end;
end;

Gist.github.com link: SorrowEn.MX2.lua
Back to top Go down
 
[Ironfist ver 1.2.1] Sorrow's End script
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» ironfist - problème avec Avast DRep
» [Ironfist ver 1.2] scrXXXX.tmp files
» Some Ironfist changes I am working on
» [Ironfist ver 1.2] Crash with AUTOSAVE
» Virus detected into Ironfist..??

Permissions in this forum:You cannot reply to topics in this forum
~ Forums of Enroth ~ :: Modding Guild :: Heroes of Might and Magic II: Project Ironfist :: Bug Reports-
Jump to: