Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
New Server | HOMM1: info forum | HOMM2: info forum | HOMM3: info forum | HOMM4: info forum | HOMM5: info forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 5 - Modders Workshop > Thread: Editor Scripting Homm5 in WIndows 7
Thread: Editor Scripting Homm5 in WIndows 7
JagoBC
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!
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
mctronic
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.



 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
JagoBC
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.
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
JagoBC
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?
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
mctronic
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.


 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
JagoBC
JagoBC

Tavern Dweller
posted December 20, 2017 01:10 PM

Sorry, where do I find private messages?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
mctronic
mctronic


Hired Hero
posted December 21, 2017 12:40 AM

Hello JagoBC,

Just send it to mctronic@hotmail.com

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
JagoBC
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.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread »
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0289 seconds