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

The Enroth diehard fan community
 
HomeHome  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  
Latest topics
» Songs of Conquest
[Ironfist ver 1.2.1] Sorrow's End script Icon_minitimeby Blake01 2024-04-07, 15:14

» ...to XP run...
[Ironfist ver 1.2.1] Sorrow's End script Icon_minitimeby CATMAN 2024-03-30, 03:16

» WARNING - The dreaded moment is here: Heroes 6 servers shutting down
[Ironfist ver 1.2.1] Sorrow's End script Icon_minitimeby Blake01 2024-03-29, 23:04

» Songs of Silence (HoMM like game)
[Ironfist ver 1.2.1] Sorrow's End script Icon_minitimeby Blake01 2024-03-27, 16:52

» Heroes Orchestra's 5th Birthday concerts with Paul Romero
[Ironfist ver 1.2.1] Sorrow's End script Icon_minitimeby rrravyn 2024-03-23, 22:45

» fheroes2 General Announcements
[Ironfist ver 1.2.1] Sorrow's End script Icon_minitimeby sirDranik 2024-03-17, 23:35

» Photo Gallery
[Ironfist ver 1.2.1] Sorrow's End script Icon_minitimeby Sir Albe 2024-03-07, 06:57

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
Introduce yourself
H3SW General Discussion
H3SW Map List: Work in progress
H3SW: Dwelling Development
Forum Admins Feed
The Floody Land
Enrothian Fan Art
Heroes III: The Succession Wars v0.8.1 Beta

 

 [Ironfist ver 1.2.1] Sorrow's End script

Go down 
2 posters
AuthorMessage
Unknown_Hero
Mage
Mage
Unknown_Hero


Messages : 778
Quality Points : 78
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 : 288
Quality Points : 47
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 : 778
Quality Points : 78
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 : 288
Quality Points : 47
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 : 778
Quality Points : 78
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
 Similar topics
-
» [Ironfist ver 1.3.0] Bug with Teleport in lua script
» [Ironfist ver 1.2] Last Stand lua script
» [Ironfist ver 1.2.1+][Script System] OnUnitRecruit(creatureid)
» [Ironfist ver 1.2.1+][Script System] OnLocationVisit(type, x, y)
» [Ironfist ver 1.3.0] Lua script, instructions validation problem

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: