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.
Could you help me understand what the problem is with
SetObjectDwellingCreatures('elftown' , 2, 100)
? I don't really understand why there's such a strange range (2-15) in the second parameter...
I'm not sure, I haven't worked with this command, but maybe its description from the manual will help:
Allows you to set/get the number of creatures that will "grow" in an object, if the latter is a recruitment point (e.g., a town). To clarify, you cannot change the type of creatures being recruited, you can only control their quantity. For example, if you try to use SetObjectDwellingCreatures for an Inferno town with the parameter nCreatureID=1 (peasants), no peasants will appear in the town. (However, this call does not lead to an error). That is, the specified type of stack should, in principle, be possible to recruit in the specified location.
Added 37 minutes ago here are a couple more questions:
1) What is the error? The script doesn't work at all, it doesn't even try
---transformation (trans)---
trans = 0
function trans() while 1 do sleep(1) if GetObjectOwner ('elftown') == 1 and trans == 0 then sleep(1) ShowFlyingSign(GetMapDataPath().."trans1.txt", "Berein", -1, 7); sleep(5) TransformTown ('elftown' , 4) ReplaceDwelling ('elfdwel1' , 4) ReplaceDwelling ('elfdwel2' , 4) ReplaceDwelling ('elfdwel3' , 4) ReplaceDwelling ('elfdwel4' , 4) trans = 1 end end end startThread (trans)
(Everything is named correctly, as in the editor)
2) Can I immediately destroy the tavern in the town right after the transformation? (I remember asking a similar question, but I didn't quite manage it, or I was just lazy)
I mean, the StartTread command is written with a lowercase letter. I think it shouldn't be.
In my opinion, it's not forbidden, but necessary. It seems that writing it with a capital letter doesn't work; it results in an error. Writing it with a lowercase letter works 100%.
In my opinion, it's not just possible, but necessary. It seems that using a capital letter at the beginning causes an error, while using a lowercase letter works 100%.
That's a perfectly accurate observation. I just couldn't remember why I always write all startThread calls like that...
The following question arose: I place a powerful hero with the AI, level 20, at the very beginning of the game, but I disable it until my hero levels up enough for a battle. However, several problems arise: a) The AI hero is placed directly in the city: the AI doesn't want to send out its heroes, and it hires them, places the disabled hero in the garrison, but still doesn't send out its own. b) The AI hero is one tile away from the city: the AI hires heroes, but transfers the entire army to the disabled hero, which makes the game less interesting, as it already has an army.
How can I make the AI ignore its own hero if it is disabled?
I have a question: I place a powerful hero with AI, level 20, at the beginning of the game, but I disable him until my hero levels up enough for a battle. However, several problems arise: a) The AI hero is placed directly in the city: the AI doesn't want to send out its heroes, and it hires them, places the disabled hero in the garrison, but still doesn't send out its own. b) The AI hero is one tile away from the city: the AI hires heroes, but sends the entire army to the disabled hero, which makes the game less interesting, as he already has an army.
How can I make the AI ignore its own hero if it is disabled?
I have a question: I place a powerful hero, level 20, for the AI at the very beginning of the game, but I disable him until my hero levels up enough for a battle. However, several problems arise: a) The AI hero is placed directly in the city: the AI doesn't want to send out its heroes, and it hires them, places the disabled hero in the garrison, but still doesn't send out its own. b) The AI hero is one tile away from the city: the AI hires heroes, but transfers the entire army to the disabled hero, which makes the game less interesting, as he already has an army.
How can I make the AI ignore its own hero if it is disabled?
Try simply placing the hero in an inaccessible location and teleporting him to the city for battle using SetObjectPosition.
Well... that's too obvious a method. Besides, it's somewhat unrealistic and unsightly. Maybe it could be done using an AI attractor? Or something like that. Set the hero's priority to zero...
What about Juss456's method? I would do the same. Not just disable the AI, but completely disable it so it can't be touched. Although, it's possible that the computer will still try... But you can only use the priority function at your own risk; it doesn't work when you need it to, but when it feels like it. An ideal solution: surround the hero with a region (even a very small one) that cannot be passed through, and then unlock the region with a script.
But the hero is in the city ;) I think the region won't be able to do anything here.
As for the method – maybe through "enabled"? It's a good option. Even a very good one. But... how do you bring it back to life when player 1 touches it? As far as I know, you can't attach a trigger to a hero, and I would really like the mayor not to leave the city until the end. Besides, the computer will really aggressively keep clicking on the poor hero.
And wasn't something similar done in the original campaigns?
Well, in general, you could put a non-stopping region in front of this hero that would check and, accordingly, disable "enable" if the first player passes through it. As an option... But it won't save it from the clicking...