Skip to content

Posts from Current questions and answers regarding the map editor. Auto-translated

5.0 (12 ratings)
In reply to Iriri
User Avatar
#5096
Auto-translated
Iriri


Added 12 hours 28 minutes ago
There are more and more questions...
Please tell me how to correctly set the parameters for the OBJECTIVE_KIND_BUILD_BUILDING_IN_TOWN task, which requires building a capitol in a town. If I set the town name in Parameter [0], the task is completed immediately when the map starts. If I add anything else, it stops being related to that town. I've already racked my brains over it.
Write something like this in the script:
function mybuilding()
while 1 do
sleep(10)
if GetTownBuildingLevel("nNameoftown", idIDofbuilding)==4 then
SetObjectiveState("nObjectivename", OBJECTIVE_COMPLETED, PLAYER_1);
end;
end;

startThread("mybuilding")
or
function newday()
if GetTownBuildingLevel("nNameoftown", idIDofbuilding)==4 then
SetObjectiveState("nObjectivename", OBJECTIVE_COMPLETED, PLAYER_1);
end;
end;
Trigger(NEW_DAY_TRIGGER, "newday")
This can only be done with scripts (most likely), since the capitol does not have its own ID. Before writing a script, try entering Town Hall Level 4 (possibly Level 3, I don't know all the IDs by heart) in the Parameters tab. If that doesn't help, enter TOWN_BUILDING_TOWN_HALL or TOWN_BUILDING_TOWN_HALL_LEVEL_4. If that doesn't help either, then use scripts.

Added 3 minutes ago
If you are going to use scripts, set OBJECTIVE_KIND_MANUAL

Added 14 minutes ago
Iriri
Thank you. It seems to be working)
Then another question. How to correctly change the hero's model? That is, let's say I want a swordsman to run around instead of a Knight hero, and he should be recolored. I found and recolored the model, but I need only the hero to be recolored, and not all swordsmen.
First, select the hero's parameters (AdvMapHeroShared) and click the three dots. A window will appear, and it will have many tabs. We need Model, AnimSet, and all tabs containing the word ...Character... In all these tabs, select the parameters corresponding to the swordsman; it will not be difficult to find them. For all the mentioned parameters, select the swordsman's parameters from the (AdvMapMonsterShared) tab, which are .../Haven/Swordsman/ or .../Rampart/Swordsman/. If you really want a recolored swordsman instead of a regular hero, I will explain in detail how to do this. You will have to copy files, and a lot of them, and also create Texture files in a new way, sending the recolored textures there. Therefore, I recommend being content with a regular swordsman.
By the way, if you suddenly have a choice, choose either a simple file or a file with the LOD suffix, choose the simple one. You will understand what I mean.

Added 2 minutes ago
If it helped, click something in the lower right corner of my answer next to the happy eagle)
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to }{0TT@6bI4
User Avatar
#5097
Auto-translated
}{0TT@6bI4
Before writing a script, try entering Town Hall Level 4 (possibly Level 3, I don't know all the IDs by heart) in the Parameters tab. If that doesn't help, enter TOWN_BUILDING_TOWN_HALL or TOWN_BUILDING_TOWN_HALL_LEVEL_4. If that still doesn't work, then it's a scripting issue.
Did I understand correctly that I need to create 2 parameters? That is, parameter [0] is the script name of the town, and parameter [1] is what you wrote? Or should they be separated by a comma? Or is the town name not needed?

I figured out the model, thanks. Forget about the painted one. The only thing I can't figure out is how to fix the attack animation. That is, when the hero points at the enemy, the figure freezes for a couple of seconds with its arms outstretched, after which the enemy takes damage. How can I fix this? But magic is cast normally. I was experimenting with a fairy, by the way.
In reply to Iriri
User Avatar
#5098
Auto-translated
Iriri
Did I understand correctly that I need to specify 2 parameters? That is, parameter [0] is the script name of the city, and parameter [1] is what you wrote? Or should they be separated by a comma? Or is the city name not needed?

I figured out the model, thank you. Never mind about the painted one. The only thing I can't figure out is how to fix the attack animation. That is, when the hero points at the enemy, the figure freezes for a couple of seconds with its arms outstretched, after which the enemy takes damage. How can I fix this? But magic is cast normally. I've already experimented with the fairy, by the way.
Regarding the model, the thing is that the developers didn't intend for there to be melee characters, so they didn't give the melee unit a ranged attack. You can fix this beautifully: in the AnimSet tab, select three dots; a window will appear with lists of animations on the right. Create a new one by first clicking the plus sign on the Animations tab, then right-clicking on it and selecting Add. Now, in the Name field, write exactly what I wrote: rangeattack. Now, decide which of the animations already created for the melee unit we will choose for the attack in battle. The complete list of them is in the Animations tab. Once you've decided, look at the other properties of the animation you've chosen. Copy all of its contents into the corresponding fields of the newly created rangeattack animation. After completing this procedure, try it out in battle. But for stable operation, use only those creatures for replacing heroes that have animations in the AnimSet parameter in the Animations tab, such as cast or specability, rangeattack. These are: Adepts, Inquisitors, Archliches, Greater Liches, Archmages, Mages, Battle Mages, Druids, Greater Druids, Elder Druids, Temptresses, Monks, Mummies. There will be no problems with them: even if some animation is missing, they have a worthy replacement.

Regarding the task, yes – the first is the city name, the second is what I already wrote. If this doesn't help you, the only thing left is to use scripts.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to }{0TT@6bI4
User Avatar
#5099
Auto-translated
}{0TT@6bI4
Regarding the quest, yes – the first is the city's name, and the second is what I already wrote. If that doesn't help, the only option left is scripts.
I figured out the model issue, and now everything works fine. I even managed to add a special ability! Thank you so much!)))
But with the quest, unfortunately, I'm still having trouble. I guess I'll have to deal with scripts. I put them off until the end, as they seem like the worst thing to do.
In reply to Iriri
User Avatar
#5100
Auto-translated
Iriri
I figured out the model, now everything works well. I even managed to add a special ability) Thank you so much!)))
But, unfortunately, I'm having trouble with the task(( I guess I'll have to struggle with the scripts. I put them off until the end, as they are the most daunting).
Firstly, if you only need to do one thing with scripts, like a quest, just copy the code snippet I provided into the script.
Secondly, after even the slightest attempt to do something with scripts, it's impossible to stop; it starts with "well, I'll also do this with a script" or "I can add even more cool stuff with a script"). When I started making levels, that's exactly what happened to me... The main thing is not to be afraid to learn).
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to }{0TT@6bI4
User Avatar
#5101
Auto-translated
}{0TT@6bI4
First, if you need scripts to do just one thing, like a quest, just copy the code snippet I provided into the script.
Second, once you try to do something with scripts, it's impossible to stop. It starts with "well, I'll also make this with a script" or "I can add even more cool stuff with a script." That's exactly what happened to me when I started making levels... The main thing is not to be afraid to learn.
Oh, if only it were just one! I have the most ambitious plans, and I'm scared just thinking that I'll have to figure this out. I'm still a pure humanist, as far away from any programming as possible.
So, I apologize in advance for the upcoming, undoubtedly stupid questions.)

Added after 10 hours and 17 minutes
I suddenly figured out how to deal with the capitol without scripts. But I've accumulated a couple more questions:
1) How do I change the color of the hero and their "skirt"? Because my elf is running around with a knight's skirt and under a red flag.
2) Is it possible to create a quest without scripts, where you have to clear the wreckage of a ship? The ship is not recognized as either a "kill creatures" quest, a "defeat neutrals" quest, or a "capture object" quest. Or is this only possible with a script?
In reply to Iriri
User Avatar
#5102
Auto-translated
Iriri
Oh, if only there was just one! I have the most ambitious plans, and I'm scared just thinking about having to figure all this out. I'm still a pure humanities person, as far removed from any programming as possible.
So, I apologize in advance for the undoubtedly silly questions to come.)

Added 10 hours 17 minutes ago
I suddenly figured out how to deal with the capitol without scripts. But I've accumulated a couple more questions:
1) How do I change the hero's color and their "skirt"? Because I have an elf running around with a knight's skirt and under a red flag.
2) Is it possible to create a quest without scripts, where you have to clear out the wreckage of a ship? The ship isn't recognized as either a kil creachers, defeat neutrals, or capture object quest. Or is this only possible with a script?
The quest can only be done with a script. Regarding the capitol, I assume you used dependencies?

1) The hero's color is changed by changing the color of the player who owns them, i.e., through
MapProperties=>Players=>+=>1=>Color
You can change the skirt with scripts and through AdvMapHeroShared, by clicking ... and looking for the corresponding line. You can also customize the trail (which... well, it's... the "poof" effect), the Trace parameter... choose the desired race (haven and rampart are humans, preserve are elves).
I think you'll figure out what's what. Don't be offended that I'm not giving you exact, specific information – I'm writing from memory on my smartphone. If you still can't figure it out, write to me, and I'll send you specific instructions.
It's spelled creaTUres
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
User Avatar
#5103
Auto-translated
Thanks, it seems like everything worked out.
It turned out to be easier with the capitol building. You just need to specify not 2, but 3 parameters: the city name, the town_hall building ID, and level 4.
And another question. If I'm creating a campaign, should I start working on the campaign right away? Or should I create several scenarios first, and then combine them?
In reply to Iriri
User Avatar
#5104
Auto-translated
Iriri
Thank you, it seems like everything worked out.
It turned out to be simpler with the capitol. I just needed to specify not 2, but 3 parameters. Namely, the city name, the town_hall building ID, and level 4.
And another question. If I'm creating a Campaign, should I start working on the Campaign right away? Or should I create several scenarios first and then combine them?
You can do it in any order you want. I recommend creating all the planned scenarios first, then go to Tools=>Create Campaign=> Enter the campaign name, add missions. Don't forget to choose heroes from the previous missions in each subsequent selected mission. You'll figure it out, it's not that complicated, and if you have any questions, I and others are here to help.
You can create one scenario, create a Campaign, save it, and then start creating other missions. In such cases, when a Campaign has already been created, to add a new scenario to the Campaign, click File=>Open=>/Game folder/User Campaigns/Campaign name.
And in the editor, the same window will open as you used when creating the Campaign earlier, add changes, save the file.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
#5106
Auto-translated
Hello everyone. Could you please tell me how to change the "CollectableArmy" status of a garrison using LUA (whether it's possible to take an army from the garrison). Because when you change the garrison's command, it resets this parameter (allowing you to take the army). I couldn't find a function in the manual that changes this parameter.
User Avatar
#5107
Auto-translated
Good day. The function DenyGarrisonCreaturesTakeAway(nGarrisonName, 1/0) does the following:
1 – prevents taking creatures, 0 – allows it.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to }{0TT@6bI4
User Avatar
#5108
Auto-translated
Good evening. Could you please help me? I've been struggling with this... I created a multiplayer map for 2 players, and there are additional castles for these 2 players (at least, they were of the same Faction... until I put heroes in to guard them, and I had to add a third player as a computer opponent.
I would like this third player (the computer) to:
1) Stay and guard the castles inside and use spells!
2) Not leave the castles.
3) Not buy an army.
4) Have the castles be of the same Faction as the ones assigned to players 1 and 2.
5) The AI shouldn't waste time on its turn.
6) And not buy heroes.
I recorded everything I could find in mapscript at the beginning and checked them (using print for each)... and the last 2 turned out to be completely non-functional...
* EnableHeroAI("Freyda", nil); works
* SetHeroLootable('Freyda', nil); works
* EnableAIHeroHiring(3, 'Castle1', nil); works, although it raises doubts since there were no errors
* BlockTownGarrisonForAI( 'Castle1', isBlocked ); - gives an error: value was NIL when getting global with name 'isBlocked'
* DoNotGiveTurnToPlayerAIIfNoTownsandactiveheroes (3, true); - gives an error: value was NIL when getting global with name 'DoNotGiveTurnToPlayerAIIfNoTownsandactiveheroes'
7) So that when the map starts, everything is blocked for the third player (slot, race, hero, starting bonus).
8) I also want to mention that heroes from the scenario were chosen to guard the castles (I had to work hard to get them into the garrison). Does this affect anything?
User Avatar
#5109
Auto-translated
BlockTownGarrisonForAI( 'Castle1', isBlocked )
Instead of isBlocked, it should be true.
DoNotGiveTurnToPlayerAIIfNoTownsandactiveheroes (3, true)
Check the function name (including the capitalization) and the space before the parentheses also seems suspicious. However, I think that in your case, the function will not work, as there are towns. Also, in theory, you can create a battle against neutral heroes using the StartCombat function in scripts, if I'm not mistaken.
To make everything blocked for player 3 when the map starts (slot, race, hero, starting bonus)
This is configured in MapPropretiesTree -> players. Settings for CanBeHumanPlayer and CanBeComputerPlayer.
 

К А
Стикеры GBF в Telegram
In reply to Fallenru
User Avatar
#5110
Auto-translated
Fallenru
Good evening. Please help, I'm having trouble... I created a multiplayer map for 2 players, and there are additional Castles for these 2 players (at least, they were of the same Faction... until I put heroes in them to guard them, I had to add a 3rd computer player.
I would like the 3rd computer player to:
1) stay and guard the Castles inside and use spells!
2) not leave
3) not buy an army
4) the Castles should be of the same Faction as the ones that spawned for players 1 and 2.
5) the AI shouldn't waste time on its turn.
6) and not buy heroes
I wrote down everything I could find in mapscript at the beginning, and checked them (using print)... and the last 2 turned out to be completely non-functional...
* EnableHeroAI("Freyda", nil); works
*SetHeroLootable('Freyda', nil); works
*EnableAIHeroHiring(3, 'Castle1', nil); works, although it raises doubts since there were no errors
* BlockTownGarrisonForAI( 'Castle1', isBlocked ); - gives an error: value was NIL when getting global with name 'isBlocked'
*DoNotGiveTurnToPlayerAIIfNoTownsandactiveheroes (3, true) ;- gives an error: value was NIL when getting global with name 'DoNotGiveTurnToPlayerAIIfNoTownsandactiveheroes'
7) So that at the start of the game, everything is blocked for the 3rd player (race, hero, starting bonus)
In the second-to-last script function, the values should be true or nil, not isBlocked. If true, it will block the town garrison; if nil, it will unblock it.
And the last script function is written correctly like this: DoNotGiveTurnToPlayerAIIfNoTownsAndActiveHeroes, not as you have it.
Next, point by point:
1. Simply immobilize the computer in the Castle using the EnableHeroAI function, and prevent it from hiring other heroes using the EnableAIHeroHiring function. Attach a trigger to touching the Castle, and in the function called by this trigger, enter EnableHeroAI(nHeroName, true); and disable the trigger. This trick is needed because I'm not sure if a non-working computer hero will be able to participate in defending against a Castle siege. Whether the computer will use spells is up to Elrath, not the scripts. But you can download the mega AI mod.
2. A non-working computer hero will not run anywhere.
3. It's banal, a cheat, and not entirely rational, but brilliant: we won't waste your time unnecessarily studying scripts and set the computer to 0 gold using the function SetPlayerStartResources(PLAYERID, wood, ore, mercury, crystals, sulfur, gems, 0);
And then in the script:
function NewDayCheck()
SetPlayerResource(1,6,0);
...
end;

Trigger(NEW_DAY_TRIGGER, "NewDayCheck");
4. I haven't seen a function that returns the race of a Castle. I have no ideas for now.
5. At the beginning of my answer, I wrote the correct formatting for the function. But keep in mind that as long as the computer controls at least 1 Castle, it will take its turn no matter what.
6. See point 1.
7. In the map, go to Map Properties Tree => Players => + => Player ID => The StartBonus line is responsible for the bonus, CanChangeBonus => set it to false so that it cannot be changed. Next, CanBeHumanPlayer set it to false. Then go to Map Properties => Players Properties => Select the player, in MainHero select the main hero, TOWN_TYPE set to the desired race. Done.
File, save.
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
In reply to Ment
User Avatar
#5111
Auto-translated
Ment

This can be configured in MapPropretiesTree -> players. Adjust the settings for CanBeHumanPlayer and CanBeComputerPlayer.
If I set everything to false, the 3rd player will disappear completely, meaning they will even vanish from the garrison.