Connection ErrorBad RequestThis page went staleSession 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.
This page went stale
Your security token was rejected, usually because the page sat open too long or you signed in elsewhere. Nothing was saved. Reload the page and try again.
Request Failed
We encountered an issue while processing your request.
Please check your internet connection and try again.
Why not? He tricked the hero, escaped, bought more troops, and attacked again. It's not necessary to make the quest about the 'hero surviving'.
Let the author decide.
Heroist, the xdb and lua files should not be in intermediate folders. Here are their actual paths (not the ones you need to write in the function) \Maps\map1.h5m\CombatScript.xdb \Maps\map1.h5m\CombatScript.lua
No, I'm not that clueless about scripts. Here's the full path to the file:
('/Maps/SingleMissions/NewRandomMap21/CombatScript.xdb#xpointer(/Script)')
It's strange, but it seems like the path is specified incorrectly:
SetHeroCombatScript(hero1, '/CombatScript.xdb#xpointer(/Script)')
No, I'm not that clueless about scripts. Here's the full file path: ('/Maps/SingleMissions/NewRandomMap21/CombatScript.xdb#xpointer(/Script)')
It's strange, but it seems like the path is incorrect: SetHeroCombatScript(hero1, '/CombatScript.xdb#xpointer(/Script)')
The problem is that the full path should not be /Maps/SingleMissions/NewRandomMap21/CombatScript.xdb#xpointer(/Script), but rather /CombatScript.xdb#xpointer(/Script), meaning the xdb file should not be in any folder at all.
Here's an example of what the map archive should look like.
yes, everything finally works as it should! Thank you very much for your help; I wouldn't have figured it out on my own.
Added 3 hours and 59 minutes ago
Here's a new question.
With which function can I work with combat creatures?
Here's an excerpt of what I forgot again and did wrong:
GetDefenderCreatures returns an array, and only one variable should be placed before the "=" sign:
xnn=GetDefenderCreatures()
Accessing the array is done differently: after its name, you should place square brackets with the number of the element you need. xnn[0] xnn[length(xnn)-1]
LUA is actually a VERY flexible language; it often allows constructions that any other compiler would strongly object to. But even it has its limits sometimes, so it's best to try to do everything correctly.
Ah, so how can I artificially influence the stats of creatures directly in battle? (Well, most likely, this is a combat function). For example, many heroes have a special ability that gives a bonus to creatures. But I haven't found a similar function in the combat scripts.
Thank you again. By the way, in mapscript.lua, I was able to retrieve a hero's army using several variables, and it worked.
If you're referring to GetHeroCreaturesTypes, then yes, it will return multiple values. Other functions return arrays mainly because the number of values can be quite large. Therefore, arrays are more convenient if you know how to handle them. ;)
Well, I looked at the developers' scripts (all of them, except for those in the bonus missions, but there didn't seem to be anything like that there), and I didn't find such a function. I would recommend experimenting: come up with your own idea of what such a function would look like if it existed, based on what is known. By the way, regarding what is known: here are some functions I found that are not in the official manual (maybe they are in unofficial ones, I don't know): SetUnitManaPoints(to whom, how much) {it seems that it was mentioned here} setATB(to whom, position) {this is really interesting in my opinion; you can implement specializations for creatures using it instead of increasing stats, if you simply give a certain creature initiative in this way} UnitCastGlobalSpell(to whom, which) {this has definitely been mentioned} GetRagePoints(creatureName) GetRageLevel(creatureName) playAnimation(who, animation name, repetition) Based on this, I can assume that the function you need, if it exists, looks like this: SetUnitAttack|SetUnitStat|SetAttack|SetStat Possibly...
I would take a look, but the thing is that the Lua mechanics for hero specializations are so deeply embedded that I haven't been able to find them yet... and there's nothing particularly special about them in regular battle scripts. Although, I found a very interesting trick for myself – resurrecting Nicholas, I finally understood how it was done properly in the campaign.
I'm not sure if it's implemented through combat scripts. Otherwise, it would be mentioned somewhere. Try those four options I listed. Something might work.
That doesn't make sense. The functions that exist are in the executable file. There are no others. At least, the ones that Ment was talking about aren't there.
but how can we then implement the mechanics of hero specializations? if, for example, the get...race function (or something like that), implemented in 3.1, can be replaced using the capabilities of 3.0, then I can't even think of any options here.
Added 2 minutes later
it should be something like changemonsterstat.