Connection ErrorBad RequestSession ExpiredSign in requiredForbiddenNot FoundToo Many RequestsServer ErrorBad GatewayService UnavailableGateway TimeoutHTTP Version Not Supported
Session Expired
Your session has expired. Please log in to continue.
Sign in required
You need an account to do that. Sign in or create one — it only takes a minute.
Request Failed
We encountered an issue while processing your request.
Please check your internet connection and try again.
Okay, fine (I'm just too lazy to write everything out, and I'm having some issues with the script on the map myself).
2) Create a region and change the Priority to something suitable. **(I haven't tested this!)**, and you can also set the priority to -1 for other objects.
The result is approximately this:
- Hmm... something in the region, hey you helmet-heads, we have guests.
- OK! Whatever, there's an enemy!
Okay, fine (I'm just too lazy to write everything out, and I'm having some issues with the script on the map).
2) Create a region and change the Priority to something suitable (I haven't tested this!), and you can also set the priority to -1 for other objects.
The result is roughly this: - Hmm... something in the region, hey you helmet-heads, we have guests. - OK! Whatever, there's an enemy!
Is this priority a script or a function?
DarkLordax
7 years ago
Auto-translated
There should be a function called SetAIPlayerAttractor, but there is SetAIHeroAttractor (well, it's a script, I understand!). One is for a specific hero, the other is just for the player. Here's something else:
DoNotGiveTurnToPlayerAIIfNoTownsAndActiveHeroes should be in the script file.
function pobor1() if GetObjectiveState("SQ1", 1) ==OBJECTIVE_UNKNOWN then SetObjectiveState("SQ1", OBJECTIVE_ACTIVE, 1); MessageBox("Maps/SingleMissions/C1W1/poborQ1.txt", "nothing"); if IsObjectExists("pobornik1") ==false then if IsObjectExists("pobornik2") ==false then if IsObjectExists("pobornik3") ==false then SetObjectiveState("SQ1", OBJECTIVE_COMPLETED, 1); SetObjectEnabled("dwellquest1", true); SetObjectOwner("dwellquest1", 1); Trigger(OBJECT_TOUCH_TRIGGER, "dwellquest1", nil) end; end; end; elseif GetObjectiveState("SQ1", 1) ==OBJECTIVE_ACTIVE then if IsObjectExists("pobornik1") ==false then if IsObjectExists("pobornik2") ==false then if IsObjectExists("pobornik3") ==false then MesageBox("Maps/SingleMissions/C1W1/poborEND.txt", "nothing"); SetObjectEnabled("dwellquest1", true); SetObjectOwner("dwellquest", 1); SetObjectiveState("SQ1", OBJECTIVE_COMPLETED, 1); Trigger(OBJECT_TOUCH_TRIGGER, "dwellquest1", nil) end; end; end; end end Trigger(OBJECT_TOUCH_TRIGGER, "dwellquest1", "pobor1")
The almighty console writes ERROR attempt to call a nil value. But where is this nil value!
In short, everything works only if all three enemies (pobornik) are killed before taking the quest; then it will be completed! If you take the quest first, then some nil value pops up!
I wouldn't recommend ever using the word false! It's unlikely that the problem is in it, although who knows, but besides errors in the console, false and true haven't caused anything else for me.
Added 1 minute ago Using these two words is fundamentally incorrect. There is nil, 0, 1, etc. It already depends on the script command.
Added 52 minutes ago How can I give a hero Perfect Necromancy?
How can I give a hero the Perfect Necromancy skill?
1. Amulet of Mastery 2. In the editor, set the hero's PrimarySkillMastery to MASTERY_EXTRA_EXPERT. Unfortunately, it won't work through GiveHeroSkill. (At least, it didn't work for me).
AstralLein
7 years ago
Auto-translated
I mean, give it as a reward for completing a quest. Using a script.
Added 33 seconds later
There was a map where they did something similar...
Yes. But it is not possible to raise a racial skill to perfection using it.
AstralLein
7 years ago
Auto-translated
Ugh. I guess I'll have to give out the artifact after all... what a pain... but the whole point was to train 3 heroes in advanced necromancy and get Perfect Necromancy for Arantir.
I wouldn't recommend ever using the word "false"! It's unlikely that the issue is related to it, although who knows, but besides the errors in the console, "false" and "true" haven't caused me any other problems.
Added 1 minute ago Using these two words is fundamentally incorrect. There are "nil," 0, 1, etc. It depends on the scripting command.
Added 52 minutes ago How can I give a hero the "Perfect Necromancy" skill?
function portal(hero)
if GetObjectOwner(hero) == 1 then
if GetObjectiveState("tom") == OBJECTIVE_UNKNOWN then
MessageBox(path.."tom1.txt")
end
if GetObjectiveState("tom") == OBJECTIVE_ACTIVE then
QuestionBox(path.."tom2.txt",'Dragon("'..hero..'")')
end
end
end
Trigger(OBJECT_TOUCH_TRIGGER, "portal","portal")
function Dragon(hero)
local week = ceil(GetDate(DAY) / 7)
sleep(3)
--
StartCombat(hero,nil,3,84, diff * week, 84, diff * week, 84, diff * week,nil,'BattleResult',nil,nil)
end
Everything works fine, but... (see the screenshot)
What could be causing this? I just want the console to be clean and not display an error.
function portal(hero) if GetObjectOwner(hero) == 1 then if GetObjectiveState("tom") == OBJECTIVE_UNKNOWN then MessageBox(path.."tom1.txt") end if GetObjectiveState("tom") == OBJECTIVE_ACTIVE then QuestionBox(path.."tom2.txt",'Dragon("'..hero..'")') end end end
Trigger(OBJECT_TOUCH_TRIGGER, "portal","portal")
function Dragon(hero) local week = ceil(GetDate(DAY) / 7) sleep(3) -- StartCombat(hero,nil,3,84, diff * week, 84, diff * week, 84, diff * week,nil,'BattleResult',nil,nil) end
Everything works fine, but... (see screenshot)
What could be causing this? I just want the console to be clean and not display an error.
This is due to calling the callback with a parameter. By default, the scripting engine simply adds two parentheses (and parameters, in some cases) to the name and executes the resulting code. If you call the callback with custom parameters, the executable code will look like this:
'Dragon("'..hero..'")()'
that is, after calling the Dragon function, the result returned from it will be called, and since the function does not return anything, an error occurs when trying to call nil.
This is due to the callback being called with a parameter. By default, the scripting engine simply adds two parentheses (and parameters, in some cases) to the name and executes the resulting code. If you call the callback with custom parameters, the code to be executed will be something like this:
'Dragon("'..hero..'")()'
that is, after calling the Dragon function, the result returned from it will be called, and since the function returns nothing, an error occurs when trying to call nil.