~ Forums of Enroth ~

An Enroth diehard fan community
 
HomeHome  FAQFAQ  SearchSearch  RegisterRegister  Log inLog in  
Latest topics
» Minecraft: HoMMII Resource pack!
by GodRage 2019-03-17, 12:57

» Introduce yourself
by kingarthur 2019-03-15, 12:44

» [H3SW v0.8.1] XP bug on random maps
by Figo 2019-03-14, 07:30

» H3SW: Artifact system
by robizeratul 2019-03-13, 23:46

» [H3SW v0.8.1] growth with external dwelling
by Figo 2019-03-13, 06:35

» Feature list, release notes, to-do list...
by Orzie 2019-03-13, 03:32

» [H3SW v0.8.1] Dragon Rider - map suggestion / not a bug
by Orzie 2019-03-13, 03:21

Poll
"Wait" in HoMM2?
Yes
80%
 80% [ 55 ]
No
20%
 20% [ 14 ]
Total Votes : 69
Most Viewed Topics
H3SW: General Graphics discussion
Ragoon's Graphics For HoMM3SW
H3SW General Discussion
H3SW: Dwelling Development
Heroes of Might and Magic 3: The Succession Wars - General info & Announcements
H3SW Map List: Work in progress
Welcome fellow Enrothians!
Enrothian Fan Art
Commanders?
H3SW Recruitment Point - Enroth Needs You!

Share | 
 

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

Go down 
AuthorMessage
Unknown_Hero
Vampire
Vampire
Unknown_Hero

Messages : 459
Quality Points : 58
Registration Date : 2015-09-06

PostSubject: [Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart()   2018-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.



Back to top Go down
DarkAtom
Pikeman
Pikeman
DarkAtom

Messages : 32
Quality Points : 2
Registration Date : 2018-02-27

PostSubject: Re: [Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart()   2018-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
Vampire
Vampire
Unknown_Hero

Messages : 459
Quality Points : 58
Registration Date : 2015-09-06

PostSubject: Re: [Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart()   2018-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 : 237
Quality Points : 38
Registration Date : 2014-12-27

PostSubject: Re: [Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart()   2018-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
Vampire
Vampire
Unknown_Hero

Messages : 459
Quality Points : 58
Registration Date : 2015-09-06

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

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

Messages : 237
Quality Points : 38
Registration Date : 2014-12-27

PostSubject: Re: [Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart()   2019-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
Vampire
Vampire
Unknown_Hero

Messages : 459
Quality Points : 58
Registration Date : 2015-09-06

PostSubject: Re: [Ironfist ver 1.3.0] Problem with SetPrimarySkill(hero, skill, quantity) and OnBattleStart()   2019-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




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

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
-
» A bit of a strange problem...
» help with admin password problem
» Problem how not to repeat the post
» (Only Topic) Problem with Breadcrumb in Invision
» Switch Editor Mode Problem + Color Tags

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: