Posts from Creature banks.
Auto-translated
- Create script tables with guards and rewards (organize them in a way that is convenient for you)
- At the start of the map, iterate through all buildings of this type using GetObjectNamesByType("BUILDING_BLOOD_TEMPLE") and attach touch triggers
- Alternatively, you can create a class for the building-bank with corresponding initializers...
- Touching the bank emulates a battle using StartCombat, and in the callback upon the hero's victory, a random reward is given (or a reward tied to the strength of the guard)
- In the callback, the touch trigger is also reset (or a message is displayed, such as "The treasure has already been looted" + MarkObjectAsVisited()).
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
It seems you're familiar with scripts, so I'll just provide a general list of actions:
- Create script tables with guards and rewards (organize them in a way that's convenient for you)
- At the start of the map, iterate through all buildings of that type using GetObjectNamesByType("BUILDING_BLOOD_TEMPLE") and attach touch triggers
- Alternatively, you can create a building-bank class with corresponding initializers...
- Touching the bank emulates a battle using StartCombat, and in the callback after the hero wins, they receive a random reward (or a reward tied to the strength of the guard)
- In the callback, also reset the touch trigger (or, for a better visual, display a message like "The treasure has already been looted" + MarkObjectAsVisited())
Well, within a single scenario, there are no questions. But where and how do I save the script so that it applies to all maps, including RMG?
In data.pak, there is a folder called scripts. You should be interested in advmap-startup.lua. At the end of it, you need to write doFile with a link to your triggers.
Thank you for the guidance.
In data.pak, there is a folder called scripts. You should be interested in advmap-startup.lua. At the end of it, you need to write doFile with a link to your triggers.
The advice helped, thank you. But there is one problem. In single-player mode, the scripts work, the treasure chests work as they should, but this does not apply to multiplayer. When trying to start a game on an RMX map with an opponent, all creature banks reset their scripts and act according to their functions before the changes. When trying to play the same map in single-player mode, everything works fine again. Of course, the opponent also has the modification installed. What could be the problem?
The advice helped, thank you. But there's one problem. In single-player, the scripts work, and the treasure chests function as they should, but this doesn't apply to multiplayer. When attempting to start a game on an RMX map with an opponent, all creature banks reset their scripts and function according to their original functions before the changes. When attempting to play the same map in single-player mode, everything works as it should again. Of course, the opponent also has the modification installed. What could be the problem?
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
advmap-startup.lua is only loaded if the map's MapScript contains a reference to the script. Either the maps need to be patched, or the references need to be added manually.
Understood, I'll think about it.