Skip to content

Posts from Scripts

4.8 (8 ratings)
13 years ago
Auto-translated
for some reason, it doesn't work.
In reply to JORAJAN
User Avatar
13 years ago
Auto-translated
Write down the error from the console. It is displayed in red/orange.
In reply to JORAJAN
User Avatar
13 years ago
Auto-translated
Also at the very beginning of the game?
In reply to RedHeavenHero
13 years ago
Auto-translated
at the beginning, I didn't have enough brains
found a bug, thanks, I'll keep experimenting.
In reply to JORAJAN
User Avatar
13 years ago
Auto-translated
In the nineteenth line, after `while i`, there is `=`, but it should be `==`.
In reply to RedHeavenHero
13 years ago
Auto-translated
I already removed that; I thought you had added it unnecessarily, but I found the error.
It was my mistake; I didn't sign one of the gates.
I thought it wouldn't cause an error.
In reply to JORAJAN
13 years ago
Auto-translated
Another question -
is it possible to make this script
garrisons={'G1', 'G2', 'G3', 'G4', 'G5', 'G6', 'G7', 'G8', 'G9'}
for j, gar in garrisons do
Trigger(5, gar, 'capture_gar')
garrisons[gar] = {}
for i = 0, 6 do
local t, n = GetObjectArmySlotCreature(gar, i)
garrisons[gar]= {t, n}
end
end

function capture_gar(oldowner, newowner, hero, gar)
for i = 0, 6 do
if garrisons[gar][1] ~= 0 then
AddObjectCreatures(gar, garrisons[gar][1], garrisons[gar][2]*2)
end
end
DenyGarrisonCreaturesTakeAway(gar, 1)
Trigger(5, gar, nil)
end
work infinitely?
because one time is not enough for me
In reply to JORAJAN
User Avatar
13 years ago
Auto-translated
Remove the second to last line: Trigger(5, gar, nil).
User Avatar
13 years ago
Auto-translated
Who can help complete a function that works for any hero? Example: function FFFFFF (heroname) lalalala... it doesn't matter in general. SetObjectPosition (heroname, 110, 45, 0, 0) -- produces a strange script error. However, GetObjectPosition heroname seems to work. How can I do it correctly?
In reply to Heroist
User Avatar
13 years ago
Auto-translated
Everything is important here: both the "lalala" and, especially, the strange errors. ;)
User Avatar
13 years ago
Auto-translated
Here. In the second screenshot, at the end, there are a couple more endow commands, but that's not the issue. In the first screenshot, the error is on line 295, and in the second screenshot, that line is the first line above SetObjectPosition.
Attachments 2
2 files attached • Total size: 19.8 KB
In reply to Heroist
User Avatar
13 years ago
Auto-translated
Generally, it's not recommended to write one function inside another. But if it's absolutely necessary, you should put a '%' sign before 'heroname'.

Statistics

Welcome our newest member: recijeb