~ Forums of Enroth ~

An Enroth diehard fan community
 
HomeHome  FAQFAQ  SearchSearch  RegisterRegister  Log inLog in  
Latest topics
» [H3SW 0.8.1] The Ultimate Mug of Ale
[Script][WWWT] Problem of Variable? Icon_minitimeby Ctesiphon Today at 06:27

» Lands of Enroth 2018 & 2019
[Script][WWWT] Problem of Variable? Icon_minitimeby GodRage Today at 06:14

» Heroes of Might & Magic 2 Civilization 2 Mod!
[Script][WWWT] Problem of Variable? Icon_minitimeby GodRage Today at 05:15

» [H3SW 0.8.1] A Crossroad Tavern
[Script][WWWT] Problem of Variable? Icon_minitimeby GodRage Yesterday at 21:23

» [H3SW 0.8.1] Migration
[Script][WWWT] Problem of Variable? Icon_minitimeby Ctesiphon Yesterday at 20:46

» play online
[Script][WWWT] Problem of Variable? Icon_minitimeby YhyJasne Yesterday at 09:30

» Lands of Enroth - Maps system
[Script][WWWT] Problem of Variable? Icon_minitimeby Orzie Yesterday at 00:45

Poll
"Wait" in HoMM2?
Yes
[Script][WWWT] Problem of Variable? Redbar1180%[Script][WWWT] Problem of Variable? Redbar12
 80% [ 55 ]
No
[Script][WWWT] Problem of Variable? Redbar1120%[Script][WWWT] Problem of Variable? Redbar12
 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!
Heroes III: The Succession Wars v0.8.1 Beta
Enrothian Fan Art
Commanders?

Share
 

 [Script][WWWT] Problem of Variable?

Go down 
AuthorMessage
Unknown_Hero
Vampire
Vampire
Unknown_Hero

Messages : 471
Quality Points : 63
Registration Date : 2015-09-06

[Script][WWWT] Problem of Variable? Empty
PostSubject: [Script][WWWT] Problem of Variable?   [Script][WWWT] Problem of Variable? Icon_minitime2017-03-09, 03:55

What's wrong with this: Problem of variable?

*

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

*

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

rangerRecruit = 0;

function OnUnitRecruit(CREATURE_RANGER)
 MessageBox("I see you.");
 rangerRecruit = 1;
 MessageBox(rangerRecruit);
end;

if rangerRecruit == 1 then
 MessageBox("This should be displayed after recruiting Ranger.");
end;

The message box "This should be displayed after recruiting Ranger." is never displayed.

***** Edited *****

rangerRecruit = 0;

function OnUnitRecruit(creatureid)
 if creatureid == CREATURE_RANGER then
   MessageBox("I see you at Ranger.");
   rangerRecruit = 1;
   MessageBox(rangerRecruit);
 end
end;

if rangerRecruit == 1 then
 MessageBox("This should be displayed after recruiting Ranger.");
end;

The message box "This should be displayed after recruiting Ranger." is never displayed.
Back to top Go down
Darmani
Master Modder
Master Modder
Darmani

Messages : 244
Quality Points : 40
Registration Date : 2014-12-27

[Script][WWWT] Problem of Variable? Empty
PostSubject: Re: [Script][WWWT] Problem of Variable?   [Script][WWWT] Problem of Variable? Icon_minitime2017-03-13, 07:51

The code you mentioned runs at the start of the map, when the script is first loaded.
Back to top Go down
Unknown_Hero
Vampire
Vampire
Unknown_Hero

Messages : 471
Quality Points : 63
Registration Date : 2015-09-06

[Script][WWWT] Problem of Variable? Empty
PostSubject: Re: [Script][WWWT] Problem of Variable?   [Script][WWWT] Problem of Variable? Icon_minitime2017-03-14, 06:42

Ok, I see, it was too simple, thank you. Razz
Back to top Go down
Sponsored content




[Script][WWWT] Problem of Variable? Empty
PostSubject: Re: [Script][WWWT] Problem of Variable?   [Script][WWWT] Problem of Variable? Icon_minitime

Back to top Go down
 
[Script][WWWT] Problem of Variable?
Back to top 
Page 1 of 1
 Similar topics
-
» Problem with "Add a Copyright Notice to Copied Text" script
» problem in merge multi step login script
» A bit of a strange problem...
» help with admin password problem
» (Only Topic) Problem with Breadcrumb in Invision

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 :: Modding and Mapmaking-
Jump to: