~ Forums of Enroth ~
Would you like to react to this message? Create an account in a few clicks or log in to continue.

~ Forums of Enroth ~

An Enroth diehard fan community
 
HomeHome  SearchSearch  RegisterRegister  Log inLog in  
Latest topics
» Immortal Realms: Vampire Wars (HoMM like game)
[Ironfist ver 1.2.1] Sorrow's End script Icon_minitimeby Unknown_Hero 2020-09-18, 23:10

» They talked about fheroes2!
[Ironfist ver 1.2.1] Sorrow's End script Icon_minitimeby sirDranik 2020-09-13, 02:51

» GoG Homm2 vs fheroes2 comparison review
[Ironfist ver 1.2.1] Sorrow's End script Icon_minitimeby sirDranik 2020-09-11, 01:19

» Resurrection of fheroes2 with 0.8 version
[Ironfist ver 1.2.1] Sorrow's End script Icon_minitimeby Tibor0803 2020-09-08, 06:32

» [Enhancement] Enhancement for the information displayed when the player right clicks on an object
[Ironfist ver 1.2.1] Sorrow's End script Icon_minitimeby sirDranik 2020-09-07, 20:45

» Free Heroes of Might and Magic II (fheroes2) General Announcements
[Ironfist ver 1.2.1] Sorrow's End script Icon_minitimeby ihhub 2020-09-05, 02:34

» [Enhancement] Enhancement for Scouting secondary skill
[Ironfist ver 1.2.1] Sorrow's End script Icon_minitimeby Unknown_Hero 2020-09-03, 21:26

Poll
Global announcements should be:
Everlasting, 1 for each project.
[Ironfist ver 1.2.1] Sorrow's End script Redbar110%[Ironfist ver 1.2.1] Sorrow's End script Redbar12
 0% [ 0 ]
Temporary, when there is something new to announce.
[Ironfist ver 1.2.1] Sorrow's End script Redbar11100%[Ironfist ver 1.2.1] Sorrow's End script Redbar12
 100% [ 6 ]
Holalala... No idea where the Ultimate artifact is.
[Ironfist ver 1.2.1] Sorrow's End script Redbar110%[Ironfist ver 1.2.1] Sorrow's End script Redbar12
 0% [ 0 ]
Total Votes : 6
Most Viewed Topics
H3SW: General Graphics discussion
Ragoon's Graphics For HoMM3SW
H3SW General Discussion
H3SW Map List: Work in progress
H3SW: Dwelling Development
Heroes III: The Succession Wars v0.8.1 Beta
Heroes of Might and Magic 3: The Succession Wars - General info & Announcements
Project Ironfist announcements
Introduce yourself
Welcome fellow Enrothians!

 

 [Ironfist ver 1.2.1] Sorrow's End script

Go down 
AuthorMessage
Unknown_Hero
Mage
Mage
Unknown_Hero

Messages : 724
Quality Points : 74
Registration Date : 2015-09-06

[Ironfist ver 1.2.1] Sorrow's End script Empty
PostSubject: [Ironfist ver 1.2.1] Sorrow's End script   [Ironfist ver 1.2.1] Sorrow's End script Icon_minitime2017-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
Darmani

Messages : 280
Quality Points : 45
Registration Date : 2014-12-27

[Ironfist ver 1.2.1] Sorrow's End script Empty
PostSubject: Re: [Ironfist ver 1.2.1] Sorrow's End script   [Ironfist ver 1.2.1] Sorrow's End script Icon_minitime2017-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
Mage
Mage
Unknown_Hero

Messages : 724
Quality Points : 74
Registration Date : 2015-09-06

[Ironfist ver 1.2.1] Sorrow's End script Empty
PostSubject: Re: [Ironfist ver 1.2.1] Sorrow's End script   [Ironfist ver 1.2.1] Sorrow's End script Icon_minitime2017-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, [Ironfist ver 1.2.1] Sorrow's End script CQIKp2K 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
Darmani

Messages : 280
Quality Points : 45
Registration Date : 2014-12-27

[Ironfist ver 1.2.1] Sorrow's End script Empty
PostSubject: Re: [Ironfist ver 1.2.1] Sorrow's End script   [Ironfist ver 1.2.1] Sorrow's End script Icon_minitime2017-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
Mage
Mage
Unknown_Hero

Messages : 724
Quality Points : 74
Registration Date : 2015-09-06

[Ironfist ver 1.2.1] Sorrow's End script Empty
PostSubject: Re: [Ironfist ver 1.2.1] Sorrow's End script   [Ironfist ver 1.2.1] Sorrow's End script Icon_minitime2017-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
Sponsored content




[Ironfist ver 1.2.1] Sorrow's End script Empty
PostSubject: Re: [Ironfist ver 1.2.1] Sorrow's End script   [Ironfist ver 1.2.1] Sorrow's End script Icon_minitime

Back to top Go down
 
[Ironfist ver 1.2.1] Sorrow's End script
Back to top 
Page 1 of 1

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: