ubi.com    Forums  Hop To Forum Categories  Might and Magic  Hop To Forums  Might and Magic Maps and Mods    Witch's Hut Scripting Question

Moderators: Mana_SG
Go
New
Find
Notify
Tools
Reply
  
  Login/Join 
Posted
I've just begun working on custom maps in HoM&MV and using the scripting from Chapter 2-Mission 1 as an example, I am trying to create Witch's Huts which always give a specific Skill.

At present, my Script will cause the huts to only give a skill to one hero, and no other hero may then use the hut. I'd rather not manually type out the code agian, and again, and again for each individual hero, so I'm wondering if anyone knows how to make this function.

Thanks in advance to anyone who can offer any assistance.

An example of the scripting code I am currently using is listed below.

--
SetObjectEnabled("witch_hut_Log_Tor",nil);

function witch_hut_first_visit_LogT(HeroName)
print(HeroName, " has visited witch hut");
MarkObjectAsVisited("witch_hut_Log_Tor",HeroName);
GiveHeroSkill(HeroName,SKILL_LOGISTICS);
Trigger(OBJECT_TOUCH_TRIGGER,"witch_hut_Log_Tor","witch_hut_already_visited_LogT");
end;

function witch_hut_already_visited_LogT(HeroName)
print(HeroName, " has visited witch hut one more time");
Trigger(OBJECT_TOUCH_TRIGGER,"witch_hut_Log_Tor","witch_hut_already_visited_LogT");
end;

Trigger(OBJECT_TOUCH_TRIGGER,"witch_hut_Log_Tor","witch_hut_first_visit_LogT");
 
Posts: 3 | Registered: Mon October 20 2008Reply With QuoteEdit or Delete MessageReport This Post
Posted Hide Post
It's been ages, and no reply. Dang. Well, I created a workaround, but it effectively permits for unlimited use of a Witch's Hut for any hero, and doesn't display the normal message.

Anyone able to help tidy this up and make them behave more like normal Witch's Huts?

--
--SetObjectEnabled("witch_hut_Log_Tor",nil);
--SetObjectEnabled("witch_hut_Enl_Tor",nil);
SetObjectEnabled("witch_hut_Att_Tor",nil);
SetObjectEnabled("witch_hut_Dar_Tor",nil);
SetObjectEnabled("witch_hut_Luc_Tor",nil);

--SetObjectEnabled("witch_hut_Log_Des",nil);
--SetObjectEnabled("witch_hut_Enl_Des",nil);
SetObjectEnabled("witch_hut_Att_Des",nil);
SetObjectEnabled("witch_hut_Soc_Des",nil);
SetObjectEnabled("witch_hut_War_Des",nil);

--SetObjectEnabled("witch_hut_Log_Gra",nil);
--SetObjectEnabled("witch_hut_Enl_Gra",nil);
SetObjectEnabled("witch_hut_Luc_Gra",nil);
SetObjectEnabled("witch_hut_Lig_Gra",nil);
SetObjectEnabled("witch_hut_Def_Gra",nil);

function witch_hut_first_visit_LogT(HeroName)
MarkObjectAsVisited("witch_hut_Log_Tor",HeroName);
GiveHeroSkill(HeroName,SKILL_LOGISTICS);
end;

function witch_hut_first_visit_EnlT(HeroName)
MarkObjectAsVisited("witch_hut_Enl_Tor",HeroName);
GiveHeroSkill(HeroName,SKILL_LEARNING);
end;

function witch_hut_first_visit_AttT(HeroName)
MarkObjectAsVisited("witch_hut_Att_Tor",HeroName);
GiveHeroSkill(HeroName,SKILL_OFFENCE);
end;

function witch_hut_first_visit_DarT(HeroName)
MarkObjectAsVisited("witch_hut_Dar_Tor",HeroName);
GiveHeroSkill(HeroName,SKILL_DARK_MAGIC);
end;

function witch_hut_first_visit_LucT(HeroName)
MarkObjectAsVisited("witch_hut_Luc_Tor",HeroName);
GiveHeroSkill(HeroName,SKILL_LUCK);
end;

function witch_hut_first_visit_LogD(HeroName)
MarkObjectAsVisited("witch_hut_Log_Des",HeroName);
GiveHeroSkill(HeroName,SKILL_LOGISTICS);
end;

function witch_hut_first_visit_EnlD(HeroName)
MarkObjectAsVisited("witch_hut_Enl_Des",HeroName);
GiveHeroSkill(HeroName,SKILL_LEARNING);
end;

function witch_hut_first_visit_AttD(HeroName)
MarkObjectAsVisited("witch_hut_Att_Des",HeroName);
GiveHeroSkill(HeroName,SKILL_SUMMONING_MAGIC);
end;

function witch_hut_first_visit_SocD(HeroName)
MarkObjectAsVisited("witch_hut_Soc_Des",HeroName);
GiveHeroSkill(HeroName,SKILL_SORCERY);
end;

function witch_hut_first_visit_WarD(HeroName)
MarkObjectAsVisited("witch_hut_War_Des",HeroName);
GiveHeroSkill(HeroName,SKILL_WAR_MACHINES);
end;

function witch_hut_first_visit_LogG(HeroName)
MarkObjectAsVisited("witch_hut_Log_Gra",HeroName);
GiveHeroSkill(HeroName,SKILL_LOGISTICS);
end;

function witch_hut_first_visit_EnlG(HeroName)
MarkObjectAsVisited("witch_hut_Enl_Gra",HeroName);
GiveHeroSkill(HeroName,SKILL_LEARNING);
end;

function witch_hut_first_visit_LucG(HeroName)
MarkObjectAsVisited("witch_hut_Luc_Gra",HeroName);
GiveHeroSkill(HeroName,SKILL_LEARNING);
end;

function witch_hut_first_visit_LigG(HeroName)
MarkObjectAsVisited("witch_hut_Lig_Gra",HeroName);
GiveHeroSkill(HeroName,SKILL_LIGHT_MAGIC);
end;

function witch_hut_first_visit_DefG(HeroName)
MarkObjectAsVisited("witch_hut_Def_Gra",HeroName);
GiveHeroSkill(HeroName,SKILL_DEFENCE);
end;

Trigger(OBJECT_TOUCH_TRIGGER,"witch_hut_Log_Tor","witch_hut_first_visit_LogT");
Trigger(OBJECT_TOUCH_TRIGGER,"witch_hut_Enl_Tor","witch_hut_first_visit_EnlT");
Trigger(OBJECT_TOUCH_TRIGGER,"witch_hut_Att_Tor","witch_hut_first_visit_AttT");
Trigger(OBJECT_TOUCH_TRIGGER,"witch_hut_Dar_Tor","witch_hut_first_visit_DarT");
Trigger(OBJECT_TOUCH_TRIGGER,"witch_hut_Luc_Tor","witch_hut_first_visit_LucT");

Trigger(OBJECT_TOUCH_TRIGGER,"witch_hut_Log_Des","witch_hut_first_visit_LogD");
Trigger(OBJECT_TOUCH_TRIGGER,"witch_hut_Enl_Des","witch_hut_first_visit_EnlD");
Trigger(OBJECT_TOUCH_TRIGGER,"witch_hut_Att_Des","witch_hut_first_visit_AttD");
Trigger(OBJECT_TOUCH_TRIGGER,"witch_hut_Soc_Des","witch_hut_first_visit_SocD");
Trigger(OBJECT_TOUCH_TRIGGER,"witch_hut_War_Des","witch_hut_first_visit_WarD");

Trigger(OBJECT_TOUCH_TRIGGER,"witch_hut_Log_Gra","witch_hut_first_visit_LogG");
Trigger(OBJECT_TOUCH_TRIGGER,"witch_hut_Enl_Gra","witch_hut_first_visit_EnlG");
Trigger(OBJECT_TOUCH_TRIGGER,"witch_hut_Luc_Gra","witch_hut_first_visit_LucG");
Trigger(OBJECT_TOUCH_TRIGGER,"witch_hut_Lig_Gra","witch_hut_first_visit_LigG");
Trigger(OBJECT_TOUCH_TRIGGER,"witch_hut_Def_Gra","witch_hut_first_visit_DefG");
 
Posts: 3 | Registered: Mon October 20 2008Reply With QuoteEdit or Delete MessageReport This Post
  Powered by Eve Community  
 

ubi.com    Forums  Hop To Forum Categories  Might and Magic  Hop To Forums  Might and Magic Maps and Mods    Witch's Hut Scripting Question

Terms of Use

Privacy Policy