Unknown_Hero Mage
Messages : 780 Quality Points : 78 Registration Date : 2015-09-06
| Subject: [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. | |
|
Darmani Master Modder
Messages : 289 Quality Points : 47 Registration Date : 2014-12-27
| Subject: 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. | |
|
Unknown_Hero Mage
Messages : 780 Quality Points : 78 Registration Date : 2015-09-06
| Subject: 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". 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. | |
|
Darmani Master Modder
Messages : 289 Quality Points : 47 Registration Date : 2014-12-27
| Subject: 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. | |
|
Unknown_Hero Mage
Messages : 780 Quality Points : 78 Registration Date : 2015-09-06
| Subject: 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. 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 | |
|
Sponsored content
| Subject: Re: [Ironfist ver 1.2.1] Sorrow's End script | |
| |
|