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.
Is there a way to forget spells?
Is there a way to keep a spell if you forget a leveled magic school? (for example, keep the "Subjugation" spell even after forgetting the "Dark Magic" skill).
Is it possible to create a hero using scripts? And if not, will the game lag if I place a lot of heroes on the map, but they are all disabled? I just need a random hero to appear in a specific location.
Question 2: Is it possible to determine a monster's level using a script? I don't have the manuals handy right now, and I don't know/remember if there's a function for that...
Is it possible to create a hero using scripts? And if not, will the game lag if I place a lot of heroes on the map, but they are all disabled? I just need a random hero to appear in a specific location.
Question 2: Is it possible to determine the level of a monster using a script? I don't have the manuals handy right now, and I don't know/remember if there's a function for that...
1. Reserve them and then place them. ;) 2. GetGuardsTier(object) returns an array where each element is equal to the level of the object's creature multiplied by 2 and added to 1, if it is upgraded. For example, for a zombie, it will be 12, for a titan - 15, for an obsidian gargoyle - 5. The only problem is that this function doesn't work with heroes.
Yeah, I actually need it for heroes. Well, okay, I guess I'll have to manually enter it by ID... Thanks anyway.
Added 20 hours 17 minutes ago
nn = GetDate(ABSOLUTE_DAY) / 7 --- n = random (179) + 1 AddHeroCreatures(hh[gen] , n , nn * ?)
I have this question: I need a random creature to appear for the hero, but its quantity should depend on the current week * a special coefficient, unique for each monster in the game; I've already defined it. The problem is that I can't fit all of this into one line. Maybe it's possible to create an array of 179 values, for example, c[0] = 1, c[1] = 10, c[179] = 2, etc., and then, instead of ?, substitute c[n] into the above function? But, unfortunately, it doesn't work. What should I do? I hope for help.
Hello. Please help me. I created a Lord (name: Vlas) from a building. I added an animation so he stands still, and everything is fine. Now, the most difficult thing for me (if not to say, impossible) is the script. Please show me how. My idea is this: if the hero is a demon and has at least 50 Archdevils or Archdemons, then he should receive 25% of the experience from level 40 (the Lord is perfect in principle) and 50 Archdevils or Archdemons should be taken from him. It shouldn't be free, after all. And if the hero is not a demon, then 75% of the hero's experience should be taken from him, and all stats should be reduced by 5 units. So, don't bother the Lord. Something like that. If I missed any condition, please let me know.
Please send the answer in a private message. I might not find this page. It's easy to get lost here. I really hope for an answer.
Yeah, I actually need it for heroes. Well, okay, I guess I'll have to manually enter it by ID... Thanks anyway.
Added 20 hours and 17 minutes ago
nn = GetDate(ABSOLUTE_DAY) / 7 --- n = random (179) + 1 AddHeroCreatures(hh[gen] , n , nn * ?)
I have this question: I need a random creature to appear for the hero, but its quantity should depend on the current week * a special coefficient, unique for each monster in the game; I've already defined it. The problem is that I can't fit all of this into one line. Maybe it's possible to create an array of 179 values, for example, c[0] = 1, c[1] = 10, c[179] = 2, etc., and then, instead of ?, substitute into the above function: c[n] ? But, unfortunately, it doesn't work. What should I do? I hope for help.
The problem is that I have absolutely no idea how to create arrays in general. I tried using GetAllNames (or something like that), but it doesn't work at all. And I couldn't find anything in the manual about creating long arrays or artificially increasing their maximum size.
The problem is that I have no idea how to create arrays in general. I tried using GetAllNames (or something like that), but it doesn't work. And I couldn't find anything in the manual about creating long arrays or artificially increasing their maximum number. :(
and so on. The first element is index 1. This is a rough example; a better explanation of how to create them can be found on the Lua 4.0 developers' website, as well as here, section 4.4.5.7.
Okay, I understand everything now. I had all 179 coefficients recorded as c[0], c[1]... c[179], and then I added c = {} on top, and everything started working as it should. Thank you very much.
1) How do I raise a number to a power? It seems like n ^ 2 doesn't work... 2) How do I select a hero? In the sense that, for example, a player has 8 heroes, and I need one of them to be selected as if by clicking the left mouse button. Simply deleting 7 of them afterward, and it's impossible to select the last one by default at the start of the game (or make it the first one). 3) Does GetDate(ABSOLUTE_DAY) return any current day in the game? (1, 2,...101, 192)? 4) What does GetDate(WEEK) return? It seems to me that it goes in a circle, increasing to a larger number, and then starts again from 1 (or am I wrong?) 5) What will happen if I try to force a hero to learn a spell that he cannot learn due to a low skill level? (Will he be able to cast it?) 6) Will the map crash due to point 5, or if I try to force a human to learn a spell from another faction/vice versa?
I only know the answer to questions 5 and 6. If you force a hero to learn an ability that they cannot learn, they will learn it and be able to cast it. This can be done either through the ObjectTree (by selecting the hero) or through a script. Any hero can be given any spell. The map will not crash.
1) How do I raise a number to a power? n ^ 2 doesn't seem to work... 2) How do I select a hero? In the sense that, for example, a player has 8 heroes, and I need one of them to be "clicked" as if with the left mouse button. Simply deleting 7 of them afterwards, and it's impossible to select the last one by default at the start of the game (or make it the first one). 3) Does GetDate(ABSOLUTE_DAY) return any current day of the game? (1, 2,...101, 192)? 4) What does GetDate(WEEK) return? It seemed to me that it goes in a circle, increasing to a larger number, and then starts again from 1 (or am I wrong?) 5) What will happen if I try to force a hero to learn a spell that he cannot learn due to a low skill level? (Will he be able to cast it?) 6) Will there be a map error due to point 5, or if I try to force a human to learn an orcish spell/vice versa?
1) It doesn't work. Use multiplication and sqrt. 2) It's not possible. Make the player not click on a hero, but instead enter some region. 3) Yes. 4) Up to 4. You can find the week from the beginning of the game like this: ceil(GetDate(DAY) / 7) 5) He will learn it and use it. 6) Battle cries are only for orcs, spells are only for the rest.
2) That’s exactly what I need – for it to select the 8th hero by default. I don’t know what’s causing this bug; when the first hero is removed, the game automatically switches the screen to the second hero. However, this doesn’t work with the eighth hero, and the camera ends up stopping at an empty space where the seventh hero used to be. That’s not a big deal, as I can adjust the camera, but the real problem is that, until a hero is selected, the horse cursor (which indicates where to move) doesn’t appear, forcing the player to click on a hero again. And that just looks bad. ;)