Skip to content

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

5.0 (12 ratings)
In reply to Олегарх
#973
Auto-translated
Olegarkh
How can I make it so that when a player enters a region, they receive a red key (the key from the red tent)?
Using a trigger: first, create a region and name it (e.g., "RedKey"). Then, write a script to grant the key after a specific event (in your case, this event is the hero(es) of that player entering the region).
In reply to antonag07
User Avatar
#974
Auto-translated
antonag07
using a trigger - first, you create a region and name it (for example, "RedKey"), then you write a script to give the key after a corresponding event (in your case, this event is the entry of heroes/or a hero of a given player into the region).
Yes, that's clear. I would like the script for giving the key itself.
In reply to Олегарх
#975
Auto-translated
Oligarch
Yes, that's clear, I just need the script to generate the key.
Well, if everything is clear, then writing the script yourself shouldn't be a problem... ;)

However, I suspect that not everything is clear, so I'll provide a script outline with explanations.

function RedKeyFF (heroname)
Trigger(REGION_ENTER_AND_STOP_TRIGGER,"RedKeyF", nil);
MessageBox("/Maps/SingleMissions/Your_Map_Name/RedKey.txt");
GiveBorderguardKey(PLAYER_1,RED_KEY);
end;
Trigger (REGION_ENTER_AND_STOP_TRIGGER, "RedKeyF","RedKeyFF" );

where - heroname (the name of a random hero (you can replace it with the name of a scripted hero, in which case the script will only work with that hero)).

When your hero enters the region named RedKeyF, a trigger is activated, which launches the function (function RedKeyFF), a message RedKey.txt is displayed (with approximately the following content - "The guards, after conferring, decided to give you the keys to the red gate"), and, in fact, the key to the Red Gate is given.
In reply to Ment
User Avatar
#978
Auto-translated
Ment
Maybe you could share the map? That would increase the chances of figuring it out.
But there isn't really a map as such. I'm using it to test scripts.
Attachments 1
1 file attached • Total size: 22.0 KB
User Avatar
#979
Auto-translated
Okay, I understand. You were adding a new dialogue using the "Add" button, which created a new dialogue with a different number (it still runs, but the function parameter is set to 1). What you need to do is add a new line (right-click on "sentences").
 

К А
Стикеры GBF в Telegram
In reply to Ment
User Avatar
#980
Auto-translated
Thank you! Is it possible to change the camera angle during a dialogue?
User Avatar
#982
Auto-translated
Does anyone know if the computer in the Seer's hut is still working?
User Avatar
#984
Auto-translated
Does a trigger work (for example, when creatures spawn) if a computer-controlled hero passes through it?
User Avatar
#985
Auto-translated
Unless otherwise specified, the computer can trigger events. To prevent this, I usually add the following to the function body:
if GetObjectOwner(...)==1 then
...
end;
 

К А
Стикеры GBF в Telegram
In reply to Ment
User Avatar
#987
Auto-translated
Happy New Year!!!!! Could you please explain the difference between 2D and 3D sounds in the game, and how can I add my own music to play in the background during gameplay?
User Avatar
#988
Auto-translated
2D sound is not tied to a specific point on the map, unlike 3D sound. That is, the latter will only sound loudly near one location. Sounds are not very suitable for playing your own music for several reasons; it is better to use the music that plays for specific heroes or locations. This music is located in the game folder/music; to replace it, I found the music folder in the game archives in the advanced editor and changed the path to the music file.
 

К А
Стикеры GBF в Telegram