Skip to content

Posts from Scripts for beginners.

4.5 (2 ratings)
In reply to ggroy
User Avatar
11 years ago
Auto-translated
ggroy
Incorrectly specified - is this the path to the question text?
And also, is the creature type written as a script name?
1) Yes
2) It's an identifier, either numerical or literal. For example, for skeletal archers, the numerical identifier is 30, and the literal identifier is CREATURE_SKELETON_ARCHER. You can find the identifier in Editor Documentation\HOMM5_IDs_for_scripts.pdf.
In reply to RedHeavenHero
User Avatar
11 years ago
Auto-translated
Thanks for the information, sorry if I'm bothering you with my stupidity. These scripts are just too complex, and I really want to create something original. :D

Added 1 minute ago
If such a thing exists (of course), could you please provide the Russian version of Editor Documentation\HOMM5_IDs_for_scripts.pdf?
In reply to RedHeavenHero
User Avatar
11 years ago
Auto-translated
Thank you very much, but I'll bother you again,
Add to this script so that, in addition, the specified creatures disappear from the map when they are recruited. Please help.:smile13:
User Avatar
11 years ago
Auto-translated
RemoveObject("object_name") – add this in the required quantity to the second function after then.
User Avatar
11 years ago
Auto-translated
Thank you very much, you helped me a lot. But I have a small problem. After hiring creatures, they don't want to enter the hero (like when clicking on the hero's picture). They only enter the castle.
User Avatar
11 years ago
Auto-translated
You can use hotkeys.
User Avatar
11 years ago
Auto-translated
Okay, thanks, I'll try.

Added after 38 seconds
Do you know what might be causing this?
User Avatar
11 years ago
Auto-translated
No, I don't know. I haven't encountered this before.
User Avatar
11 years ago
Auto-translated
Hey, here's another question. I installed the script you gave me twice (on two different territories), and here's the problem: on the first territory, the specified object disappears, but on the second, it doesn't. What's the issue?
User Avatar
11 years ago
Auto-translated
What does the final script look like?
User Avatar
11 years ago
Auto-translated
Here are two scripts. In the middle is another script.
function hire1(hero) hire1_hero = hero MessageBox("/Maps/Multiplayer/Test s Naimom/kamillaF.txt") QuestionBox("Maps/Multiplayer/Test s Naimom/Wopros.txt", "hire1_ok") end function hire1_ok() local gold = GetPlayerResource(PLAYER_1, GOLD) if gold >= 0 then RemoveObject("krest1") RemoveObject("krest2") RemoveObject("krest3") RemoveObject("krest4") RemoveObject("krest5") RemoveObject("krest6") RemoveObject("krest7") RemoveObject("krest8") Trigger(REGION_ENTER_AND_STOP_TRIGGER, "unnamed 0", nil) SetPlayerResource(PLAYER_1, GOLD, gold - 0) AddHeroCreatures(hire1_hero, CREATURE_PEASANT, 50) else end end Trigger(REGION_ENTER_AND_STOP_TRIGGER, "unnamed 0", "hire1"); SetRegionBlocked ("kamilla",true,1); function hire1(hero) hire1_hero = hero MessageBox("/Maps/Multiplayer/Test s Naimom/kamillaF.txt") QuestionBox("Maps/Multiplayer/Test s Naimom/Wopros.txt", "hire1_ok") end function hire1_ok() local gold = GetPlayerResource(PLAYER_1, GOLD) if gold >= 0 then RemoveObject("kr1") RemoveObject("kr2") RemoveObject("kr3") RemoveObject("kr4") Trigger(REGION_ENTER_AND_STOP_TRIGGER, "unnamed 1", nil) SetPlayerResource(PLAYER_1, GOLD, gold - 0) AddHeroCreatures(hire1_hero, CREATURE_PEASANT, 50) else end end Trigger(REGION_ENTER_AND_STOP_TRIGGER, "unnamed 1", "hire1");
User Avatar
11 years ago
Auto-translated
Because you didn't rename the copied functions.
User Avatar
11 years ago
Auto-translated
Sorry - WHAT?

Added 3 minutes later
I apologize, but I didn't quite understand.
User Avatar
11 years ago
Auto-translated
If you're duplicating, give the functions different names, not hire1, but hire2, for example. Do the same with everything else.

Statistics

Welcome our newest member: recijeb