~ 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
» [H3SW v0.8.2] Witch Hunt
[Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() Icon_minitimeby GodRage 2024-11-18, 22:56

» 5Kings1Ring
[Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() Icon_minitimeby GodRage 2024-11-18, 22:54

» Polskie powitanie
[Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() Icon_minitimeby rrravyn 2024-11-15, 09:53

» loading simplification
[Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() Icon_minitimeby badtoper 2024-11-15, 04:37

» Easier Troop Management Between Garrison and Hero in Town
[Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() Icon_minitimeby badtoper 2024-11-15, 04:05

» Improvements for Hero Management and Turn Confirmation
[Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() Icon_minitimeby badtoper 2024-11-15, 01:57

» [H3SW v0.8.2] Desert Isle
[Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() Icon_minitimeby Sir Albe 2024-10-31, 07:56

Poll
Global announcements should be:
Everlasting, 1 for each project.
[Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() Redbar110%[Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() Redbar12
 0% [ 0 ]
Temporary, when there is something new to announce.
[Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() Redbar11100%[Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() Redbar12
 100% [ 6 ]
Holalala... No idea where the Ultimate artifact is.
[Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() Redbar110%[Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() 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
The Floody Land
Forum Admins Feed
Enrothian Fan Art
Heroes III: The Succession Wars v0.8.2 Beta

 

 [Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart()

Go down 
3 posters
AuthorMessage
Unknown_Hero
Mage
Mage
Unknown_Hero


Messages : 780
Quality Points : 78
Registration Date : 2015-09-06

[Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() Empty
PostSubject: [Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart()   [Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() Icon_minitime2018-12-22, 05:13

Try this code:

Code:
function OnBattleStart()
  hero = BattleGetHero(0);
  quantity = 10;
  SetPrimarySkill(hero, PRIMARY_SKILL_ATTACK, quantity);
  SetPrimarySkill(hero, PRIMARY_SKILL_DEFENSE, quantity);
end

The hero's attack and defense skills are properly updated, but creatures do not fully benefit from the hero's attack and defense bonuses.

[Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() NDl1KzA

[Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() ER7K9IA
Back to top Go down
DarkAtom
Pikeman
Pikeman
DarkAtom


Messages : 47
Quality Points : 6
Registration Date : 2018-02-27

[Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() Empty
PostSubject: Re: [Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart()   [Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() Icon_minitime2018-12-27, 04:45

I don't think that is a bug from Ironfist, the game is just not supposed to modify creature stats in battle. In the Heroes III WOG scripting documentation, it is stated that changing the hero's stats in a battle makes no sense, as no creature/spell will benefit from it. I guess Heroes II works the same way.
Back to top Go down
Unknown_Hero
Mage
Mage
Unknown_Hero


Messages : 780
Quality Points : 78
Registration Date : 2015-09-06

[Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() Empty
PostSubject: Re: [Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart()   [Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() Icon_minitime2018-12-27, 05:27

Yes, it's not a bug, but as I said it's more of a problem. I think having the ability to update different creature-related values directly during combat would really be a plus. For example with "UpdateAllCreaturesAttack", "UpdateAllCreaturesDefense", "UpdateAllCreaturesSpeed", etc. or/and "Get/Set...Stack...Attack/Defense/etc.".
I think that should be possible to add these expressions to Ironfist because it is already possible to modify these values with the spells.


Last edited by Unknown_Hero on 2019-01-04, 07:41; edited 1 time in total
Back to top Go down
Darmani
Master Modder
Master Modder
Darmani


Messages : 289
Quality Points : 47
Registration Date : 2014-12-27

[Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() Empty
PostSubject: Re: [Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart()   [Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() Icon_minitime2018-12-31, 16:20

You can already modify creature's stats during combat. However, it looks like we've only made it possible to change their quantity. I'll get on this ASAP.
Back to top Go down
Unknown_Hero
Mage
Mage
Unknown_Hero


Messages : 780
Quality Points : 78
Registration Date : 2015-09-06

[Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() Empty
PostSubject: Re: [Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart()   [Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() Icon_minitime2019-01-03, 04:00

Very nice, thanks. Smile
Back to top Go down
Darmani
Master Modder
Master Modder
Darmani


Messages : 289
Quality Points : 47
Registration Date : 2014-12-27

[Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() Empty
PostSubject: Re: [Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart()   [Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() Icon_minitime2019-01-04, 18:44

I have added 10 new scripting functions to get/set a stack's attack, defense, speed, HP, and shots.
Back to top Go down
Unknown_Hero
Mage
Mage
Unknown_Hero


Messages : 780
Quality Points : 78
Registration Date : 2015-09-06

[Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() Empty
PostSubject: Re: [Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart()   [Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() Icon_minitime2019-01-05, 04:41

Oh, that's really good. Smile
I will already use some of them when I adapt the current Unknonw Mod script for the next official version of Ironfist.
I already have code in the Unknonw Mod script for the official version 1.3.0 but the results are not perfect.
These additions will help me a lot in the realization of some ideas for the script and it will also be much easier with these additions. Thank you very much for that. Very Happy
Back to top Go down
Sponsored content





[Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() Empty
PostSubject: Re: [Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart()   [Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart() Icon_minitime

Back to top Go down
 
[Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart()
Back to top 
Page 1 of 1
 Similar topics
-
» [Script System][Suggestions] AddPrimarySkill(hero, skill, quantity, duration) and more
» Duplicating Hero Problem
» [Ironfist ver 1.3.0] Lua script, instructions validation problem
» [Ironfist ver 1.3.0] Bug the number of creatures in the hero's army changes at the beginning of new turn
» Global Hero/Settlement/Skill/Spell/ Wandering Monster/Gladiator Bans.

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: