~ Forums of Enroth ~

An Enroth diehard fan community
 
HomeHome  ChatChat  FAQFAQ  SearchSearch  RegisterRegister  Log inLog in  
Latest topics
» [Ironfist ver 1.3.0+] Bug with fonction OnLocationVisit(type, x, y)
by Unknown_Hero Yesterday at 23:49

» [Ironfist ver 1.3.0+] Unexpected program termination when a double click is performed on a town
by Unknown_Hero Yesterday at 23:46

» [Ironfist ver 1.3.0+] Pixel of blue color visible during fade to black when launching a scenario
by Unknown_Hero Yesterday at 23:43

» [Ironfist ver 1.3.0+] The bass.dll file is missing after installation
by Unknown_Hero Yesterday at 23:40

» [Ironfist ver 1.3.0] Bug in lua scripts with IDs "CREATURE_PEASANT" or "0"
by Unknown_Hero Yesterday at 23:35

» Let's talk about Wizards
by Orzie Yesterday at 05:23

» [Ironfist ver 1.3.0] Lua script, instructions validation problem
by Unknown_Hero 2018-10-13, 23:19

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
H3SW Map List: Work in progress
Welcome fellow Enrothians!
Enrothian Fan Art
Commanders?
Heroes of Might and Magic 3: The Succession Wars - General info & Announcements
Dervish Faction General Concept

Share | 
 

 [Ironfist ver 1.2.1+][Script System] OnUnitRecruit(creatureid)

Go down 
AuthorMessage
Unknown_Hero
Minotaur
Minotaur
avatar

Messages : 397
Quality Points : 56
Registration Date : 2015-09-06

PostSubject: [Ironfist ver 1.2.1+][Script System] OnUnitRecruit(creatureid)   2017-03-09, 03:40

Tested with Ironifist version 1.2.1+ (version of December 15, 2016).

*

In the scenario "TestScri.mx2" (Massive Test of Project Ironfist Script System), I recruited creatures with this code:

BUG: With OnUnitRecruit(creatureid), whenever a creature is recruited regardless of the name of the creature specified, the instuction is executed (test in a town and at the Ruins).
And (creatureid) cannot be replaced by the number correspondence, per example, "OnUnitRecruit(CREATURE_RANGER)" cannot be replaced by "OnUnitRecruit(2)".

function OnUnitRecruit(CREATURE_RANGER)
 MessageBox("I see you at Ranger.");
end;
--< it does not work, whenever a creature is recruited regardless of the name of the creature specified, the instuction is executed and the message box is displayed (test in a town and at the Ruins).

function OnUnitRecruit(CREATURE_MEDUSA)
 MessageBox("I see you at Medusa.");
end;
--< it does not work, whenever a creature is recruited regardless of the name of the creature specified, the instuction is executed and the message box is displayed (test in a town and at the Ruins).

function OnUnitRecruit(2)
--< it does not work and a Script Error window is displayed.
 MessageBox("I see you at Ranger with 2.");
end;

***** Edited *****

Do not bother, the expression has to be written this way and everything works well: Razz

function OnUnitRecruit(creatureid)
 if creatureid == CREATURE_MEDUSA then
   MessageBox("I see you at Medusa.");
 elseif creatureid == CREATURE_RANGER then
   MessageBox("I see you at Ranger.");
 elseif creatureid == 0 then
   MessageBox("I see you at Peasant.");
 end
end;
Back to top Go down
 
[Ironfist ver 1.2.1+][Script System] OnUnitRecruit(creatureid)
Back to top 
Page 1 of 1
 Similar topics
-
» [Script System][Suggestions] So, which expressions are the most desirable?
» One Woman in India dies every hour due to the dowry system
» Minecraft's Coordinate System
» Award system
» Latest Topics (new system)

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: