|
Thread: Editor Scripting Homm5 in WIndows 7 | |
|
JagoBC
Tavern Dweller
|
posted December 18, 2017 04:54 AM |
|
|
Editor Scripting Homm5 in WIndows 7
I recently got the game again, and am trying to use my old self-created maps but the scripts don't seem to work. They are pretty simple, and worked when I used to play on XP. I suspect the problem is the damned dynamic libraries thing Windows 7 does, since that strikes me as the root of all evil. Here is my script, in total:
jvar = 0;
sskill = 0;
hero = "Jago";
SetObjectEnabled("SHLite", nil);
SetObjectEnabled("SHLead", nil);
function PriestHutTouch(heroname)
if GetCurrentPlayer() == 1 then
hero = heroname;
MessageBox("Maps/SingleMissions/Isle of Man/LightMagicTxt.txt");
sskill = 11
jvar = GetHeroSkillMastery(hero, sskill);
if jvar > 0 and jvar < 3 then
QuestionBox("Maps/SingleMissions/Isle of Man/SkillQuery0.txt", "SkillAccept0", nil);
end;
end;
end;
function SLeadTouch(heroname)
if GetCurrentPlayer() == 1 then
hero = heroname;
MessageBox("Maps/SingleMissions/Isle of Man/LeadershipTxt.txt");
sskill = 4
jvar = GetHeroSkillMastery(hero, sskill);
if jvar > 0 and jvar < 3 then
QuestionBox("Maps/SingleMissions/Isle of Man/SkillQuery0.txt", "SkillAccept0", nil);
end;
end;
end;
function SkillAccept0()
jvar = GetHeroSkillMastery(hero, sskill);
if jvar == 1 then
QuestionBox("Maps/SingleMissions/Isle of Man/SkillQuery1.txt", "SkillAccept1", nil);
else QuestionBox("Maps/SingleMissions/Isle of Man/SkillQuery2.txt", "SkillAccept2", nil);
end;
end;
function SkillAccept1()
jvar = GetPlayerResource(1,6);
if jvar >= 2500 then
jvar = jvar - 2500;
SetPlayerResource(1, 6, jvar);
ShowFlyingSign('Maps/SingleMissions/Isle of Man/GoldDownFlySign1.txt', hero, 1, 2.5);
sleep(5)
GiveHeroSkill(hero, sskill);
ShowFlyingSign('Maps/SingleMissions/Isle of Man/SkillImprovedFlySign.txt', hero, 1, 2.5);
else MessageBox("Maps/SingleMissions/Isle of Man/NoGold.txt");
end;
end;
function SkillAccept2()
jvar = GetPlayerResource(1,6);
if jvar >= 5000 then
jvar = jvar - 5000;
SetPlayerResource(1, 6, jvar);
ShowFlyingSign('Maps/SingleMissions/Isle of Man/GoldDownFlySign2.txt', hero, 1, 2.5);
sleep(5)
GiveHeroSkill(hero, sskill);
ShowFlyingSign('Maps/SingleMissions/Isle of Man/SkillImprovedFlySign.txt', hero, 1, 2.5);
else MessageBox("Maps/SingleMissions/Isle of Man/NoGold.txt");
end;
end;
Trigger(OBJECT_TOUCH_TRIGGER, "SHLite", "PriestHutTouch");
Trigger(OBJECT_TOUCH_TRIGGER, "SHLead", "SLeadTouch");
Like I said, it worked perfectly when I used to play on XP. Is there anything I can do to make it work on W7?
Thanks!
____________
|
|
mctronic
Hired Hero
|
posted December 19, 2017 01:39 AM |
|
Edited by mctronic at 01:41, 19 Dec 2017.
|
Hello JagoBC,
You are missing some semi columns at:
sskill = 11;
sskill = 4;
sleep(5) at SkillAccept1() function
sleep(5) at SkillAccept2() function
That may of prevented the script in working properly.
Also, I don't think the function QuestionBox accepts a nil value as a callbackNo value (see QuestionBox function in manual). I recommend replacing the nil value by "".
I am scripting in Win10 and I have no issues.
Hope this helps.
|
|
JagoBC
Tavern Dweller
|
posted December 19, 2017 09:57 AM |
|
|
Thanks! Oh, I hope it's that simple! I can't wait to get home and try it.
____________
|
|
JagoBC
Tavern Dweller
|
posted December 20, 2017 01:42 AM |
|
|
That didn't do it.
I still think it's a Windows resource problem (but I know very little about the inner workings of operating systems). For instance, some (but not all) of my maps have a little gold lock icon next to the file name when I view them in a file folder. Anyone know what this means?
____________
|
|
mctronic
Hired Hero
|
posted December 20, 2017 12:13 PM |
|
|
Hello JagoBC,
Please send me the map to the email that I PMed you.
I'll have a look.
|
|
JagoBC
Tavern Dweller
|
posted December 20, 2017 01:10 PM |
|
|
Sorry, where do I find private messages?
|
|
mctronic
Hired Hero
|
posted December 21, 2017 12:40 AM |
|
|
Hello JagoBC,
Just send it to mctronic@hotmail.com
|
|
JagoBC
Tavern Dweller
|
posted December 21, 2017 04:40 AM |
|
|
Your email was in my spam folder! Sent. Thanks for taking the time to give this a look.
|
|
|
|