Posts from Scripts for beginners.
Auto-translated
a neutral monster is present
displays a text message
the monster disappears
a specific building appears
kycaka, please refer to the FAQ from the link in my signature: question "How to perform an action when a specific monster is touched?", question "How to display a simple text message?" (and possibly "I'm trying to display a text message, but it doesn't appear. What should I do?"), question "How to remove a specific object from the map?". See the CreateDwelling() function in the documentation.
kycaka, please refer to the FAQ from the link in my signature: question "How to perform an action when a specific monster is touched?", question "How to display a simple text message?" (and possibly "I'm trying to display a text message, but it doesn't appear. What should I do?"), question "How to remove a specific object from the map?". See the CreateDwelling() function in the documentation.
1. I have read your FAQ. There is almost nothing there about my problem. I know how to place a monster. I just wrote down all the steps I need as an example.
2. I couldn't find anywhere in your FAQ how to use a script to PLACE, not REMOVE, a building.
3. I know how to display a text message, but it is displayed at the end, not at the beginning of the event.
And I repeat, I don't want to delve into studying scripts and writing code. THIS TOPIC IS CALLED - SCRIPTS FOR BEGINNERS, not learning how to write scripts and code. I just need help on how to configure the monster so that the message is displayed before the script, not after. So that first there is a message that describes everything, then you close it, the monster disappears, and a building appears, and not the other way around - first the monster disappears, a house appears, and then a message appears saying what happened. And I need the script itself so that the monster disappears and a building appears at specific coordinates.
I will even write down again what I need step by step.
- Explain how to prepare the monster. Don't just give links to read for half a year about how to do it, but provide an EXAMPLE. I, and many others, will simply read the example, and that will be ENOUGH so that we don't have to read tons of unnecessary information.
- Write a script where a piece of the script is highlighted and it is indicated what it is for and what it does. And this will be an EXAMPLE of how to write such a script. Not an attempt to teach me to code. You yourself spent a lot of time figuring this out, so why send others down the same path? The topic was created specifically so that you share your knowledge with those who need it at the moment. WE NEED YOUR KNOWLEDGE, NOT LINKS TO READ SOMETHING AND LEARN IT OURSELVES.
- Explain the nuances, such as if a building is being placed, then here in the script it is indicated that the coordinates are above or in the Dungeon. That here in the script it is written that the message is displayed before the script's action, or if it is written this way, then after. BELIEVE ME, ONE LESSON OF PRACTICE IS BETTER THAN 100 HOURS OF THEORY.
In the future, I wanted to ask a couple more questions, and they are not related to this question. For example, how to make it so that at the beginning of each month, a script moves the strongest hero of each player to a specific location. But I'm already afraid of the pile of links that I will be given. Probably, after reading them, I will no longer want to create a map, but to develop artificial intelligence...
And Jack_of_shadows has already written everything you need; you're just too lazy to figure it out. Here's an example:
function MyMobHandler(hero, obj)
if hero == "hero name" then -- So that the script only works for the main hero. If it should work for everyone, remove this
MessageBox("Path/To/Text/file.txt", "MyMobHandlerCallback('"..obj.."')")
end
end
function MyMobHandlerCallback(obj)
Trigger(OBJECT_TOUCH_TRIGGER, obj, nil)
RemoveObject(obj)
-- CreateDwelling("dwell", TOWN_HEAVEN, 3, PLAYER_1 115, 115, GROUND)
-- You can't create an arbitrary building with a script, only a dwelling
end
SetObjectEnabled("MobName", nil)
Trigger(OBJECT_TOUCH_TRIGGER, 'MobName', 'MyMobHandler')
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
Also, if I assign the same group to both a Portal of Water and an Underground Passage, will they conflict?