• check_circle Advancements
  • check_circle Functions
  • check_circle Loot Tables
  • check_circle Predicates
  • 584 views, 1 today
  • 15 downloads, 0 today
  • 5
  • 3
  • 6
CDed_kosoy_'s Avatar CDed_kosoy_
Level 5 : Apprentice Engineer
2
Now even i cant read this s-... Sense... Yeah

( На русском ниже )

This datapack adds a new flexible system of dialogs with elections! Let me tell you how to use it to create your own dialogues.Install the datapack in the new creative world, and enter this command - /function tmp:dialogues /ru/1.0 if after pressing enter, a dialog appears, go into the chat and click on it to move on to the next sentence. This dialog will thank you for the installation and offer to watch a video about the DataPack on the channel. (I'll attach the video later). Now let's see how the election system works - enter /function tmp:dialogues/en/2.0 You will be offered to choose from the 3 listed items: Option No. 1 | Kvass | Soup with bread and each of them will have its own answer. To create your own dialog, go to the DataPack files: StoryTools - data - tmp - functions: there, open the dialogues_player.mcfunction file in any text editor convenient for you (I have Notepad++). At the very bottom of the file, insert this line: "function tmp:dialogues/ur_name/npc_name/dialogues_player". Now go to the dialogues folder, and create a new folder "ur_name" and already in it "npc_name". In it we create two more files - "dialogues_player.mcfunction" and "1.0.mcfunction". Open the dialogues_player.mcfunction file and paste this into it:


execute if score *ur_name-npc_name-1.0 num matches 1 unless score *ur_name-npc_name-1.0 dialogue_num matches 0.. run scoreboard players set *ur_name-npc_name-1.0 dialogue_num 0
execute if score *ur_name-npc_name-1.0 num matches 1 run function tmp:dialogues/ur_name/npc_name/1.0
execute unless score *ur_name-npc_name-1.0 num matches 1 unless score *ur_name-npc_name-1.0 dialogue_num matches 0 run scoreboard players reset *ur_name-npc_name-1.0 dialogue_num



Go to the 1.0.mcfunction file and paste this code into it:


#Start dialogue if function executed.
execute unless score *ur_name-npc_name-1.0 num matches 1 run scoreboard players set *ur_name-npc_name-1.0 num 1

execute if score *ur_name-npc_name-1.0 dialogue_num matches 0 run function tmp:values_reset
execute if score *ur_name-npc_name-1.0 dialogue_num matches 0 run scoreboard players add @s dialogue_num 1

#Reset before next sentence
execute if score @s dialogue_num matches 1.. run stopsound @a voice
execute if score @s dialogue_num matches 1.. run scoreboard players add *ur_name-npc_name-1.0 dialogue_num 1

#Dialogs
execute if score @s dialogue_num matches 1.. if score *ur_name-npc_name-1.0 dialogue_num matches 1 run tellraw @a [{"text":"<NAME> ","color":"white","clickEvent":{"action":"run_command","value":"/trigger dialogue_num"}},{"text":"TEXT","color":"white"}]
execute if score @s dialogue_num matches 1.. if score *ur_name-npc_name-1.0 dialogue_num matches 2 run tellraw @a [{"text":"<NAME> ","color":"white","clickEvent":{"action":"run_command","value":"/trigger dialogue_num"}},{"text":"TEXT","color":"white"}]
execute if score @s dialogue_num matches 1.. if score *ur_name-npc_name-1.0 dialogue_num matches 3 run tellraw @a [{"text":"<NAME> ","color":"white","clickEvent":{"action":"run_command","value":"/trigger dialogue_num"}},{"text":"TEXT","color":"white"}]

#Voicer
execute if score @s dialogue_num matches 1.. if score *ur_name-npc_name-1.0 dialogue_num matches 1.. run playsound minecraft:item.axe.strip voice @a ~ ~ ~ 1 1 1

#Loop
scoreboard players enable @s dialogue_num
execute if score @s dialogue_num matches 1.. run scoreboard players reset @a dialogue_num
execute if entity @s[​tag=skip_dialogues] run scoreboard players add @s dialogue_num 1

#End
execute if score *template-1.0 dialogue_num matches 3.. run scoreboard players reset *ur_name-npc_name-1.0 num




And now I'll explain what each part of the code does.
1. #Start a dialog when the function is started.It is needed in order not to remember the dialog ID every time and turn it on manually, but to simply launch the function to start the entire dialog. I.e. if the function is activated, but in the num account, the dialog ID is turned off, then put the dialog on, + reset the selection options.
*ur_name-npc_name-1.0 is the Dialog Identifier (ID). It can be replaced, but it is important that in all parts of the code it is the same for one dialog. The dialog ID is the path to the dialog file itself, i.e. *ur_name-npc_name-1.0 = dialogues/ur_name/npc_name/1.0.mcfunction.

2. #Reset before the next sentence.Stops the Voice (Voiceover) of the sentence and adds the ID to the dialog in the dialogue_num 1 account to display the next dialog.
3. #Dialogues
There more details.
execute if score @s dialogue_num matches 1.. - check whether the player has activated the command to move to the next sentence.
if score *ur_name-npc_name-1.0 dialogue_num matches (offer number) - check which sentence to display.
tellraw @a is a command to display text in the chat
<NAME> - what will be displayed before the message in the chat. The way an ordinary player would communicate.
,"color":"white" - in this case, white is the color of the speaker's name.
,"ClickEvent":{"action":"run_command","value":"/trigger dialogue_num"} - when you click on the text, execute the command to display the following sentence.
,{"text":"TEXT","color":"white"} - The TEXT is the text of the dialog and white is the color of the dialog.

also, if you want to add new offers, just copy one of them and replace (offer number) with the number of the last offer + 1
4. #Voicer
if score *ur_name-npc_name-1.0 dialogue_num matches *offer number* - if the dialog number is equal to the specified one, play the sound
playsound *sound ID* voice @a ~ ~ ~ 1 1 1 - play the sound, with a volume of 1 pitch 1 and a minimum volume of 1.
5. #Cycle allows all players to use the command to display the next sentence and resets the value of their score.
6. #End If the number of the current sentence is equal to the number of the last sentence, end the dialog.Put instead of 3.. the number of the last offer.
I hope this help you to create your own dialogues in Minecraft!



Этот ДатаПак добавляет новую гибкую систему диалогов с выборами! Давайте я расскажу как с его помощью создать свои диалоги.
Устанавливаем ДатаПак в новый креатив мир, и вводим эту команду - /function tmp:dialogues/ru/1.0 если после нажатия enter, у Вас высветился диалог, зайдите в чат и нажмите на него, что-бы перейти к следующему предложению. Этот диалог скажет Вам спасибо за установку и предложит посмотреть ролик о ДатаПаке на канале. (потом прикреплю видео).
  Теперь посмотрим как работает система выборов - введите /function tmp:dialogues/ru/2.0 Вам предложат выбрать из 3 перечисленных пунктов: Опция№1 | Квас | Суп с хлебом и на каждый из них будет свой ответ.
  Чтобы создать свой диалог зайдите в файлы ДатаПака: StoryTools - data - tmp - functions: там откройте любым удобным для Вас текстовом редакторе (у меня это Notepad++) файл - dialogues_player.mcfunction. В самый низ файла вставьте эту строчку: "function tmp:dialogues/ur_name/npc_name/dialogues_player". Теперь заходим в папку dialogues, и создаём новую папку "ur_name" а уже в ней "npc_name". В ней мы создаём ещё два файла - "dialogues_player.mcfunction" и "1.0.mcfunction". Откройте файл dialogues_player.mcfunction и вставьте в него это:


execute if score *ur_name-npc_name-1.0 num matches 1 unless score *ur_name-npc_name-1.0 dialogue_num matches 0.. run scoreboard players set *ur_name-npc_name-1.0 dialogue_num 0
execute if score *ur_name-npc_name-1.0 num matches 1 run function tmp:dialogues/ur_name/npc_name/1.0
execute unless score *ur_name-npc_name-1.0 num matches 1 unless score *ur_name-npc_name-1.0 dialogue_num matches 0 run scoreboard players reset *ur_name-npc_name-1.0 dialogue_num


Дальше перейдите в файл 1.0.mcfunction и вставьте в него этот код:

#Начать диалог при запуске функции.
execute unless score *ur_name-npc_name-1.0 num matches 1 run scoreboard players set *ur_name-npc_name-1.0 num 1

execute if score *ur_name-npc_name-1.0 dialogue_num matches 0 run function tmp:values_reset
execute if score *ur_name-npc_name-1.0 dialogue_num matches 0 run scoreboard players add @s dialogue_num 1

#Ресет перед следующим предложением.
execute if score @s dialogue_num matches 1.. run stopsound @a voice
execute if score @s dialogue_num matches 1.. run scoreboard players add *ur_name-npc_name-1.0 dialogue_num 1

#Диалоги
execute if score @s dialogue_num matches 1.. if score *ur_name-npc_name-1.0 dialogue_num matches 1 run tellraw @a [{"text":"<ИМЯ> ","color":"white","clickEvent":{"action":"run_command","value":"/trigger dialogue_num"}},{"text":"ТЕКСТ","color":"white"}]
execute if score @s dialogue_num matches 1.. if score *ur_name-npc_name-1.0 dialogue_num matches 2 run tellraw @a [{"text":"<ИМЯ> ","color":"white","clickEvent":{"action":"run_command","value":"/trigger dialogue_num"}},{"text":"ТЕКСТ","color":"white"}]
execute if score @s dialogue_num matches 1.. if score *ur_name-npc_name-1.0 dialogue_num matches 3 run tellraw @a [{"text":"<ИМЯ> ","color":"white","clickEvent":{"action":"run_command","value":"/trigger dialogue_num"}},{"text":"ТЕКСТ","color":"white"}]

#Голос (Озвучка)
execute if score @s dialogue_num matches 1.. if score *ur_name-npc_name-1.0 dialogue_num matches 1.. run playsound minecraft:item.axe.strip voice @a ~ ~ ~ 1 1 1

#Цикл
scoreboard players enable @s dialogue_num
execute if score @s dialogue_num matches 1.. run scoreboard players reset @a dialogue_num
execute if entity @s[​tag=skip_dialogues] run scoreboard players add @s dialogue_num 1

#Конец
execute if score *template-1.0 dialogue_num matches 3.. run scoreboard players reset *ur_name-npc_name-1.0 num



А сейчас я объясню что делает каждая часть кода.1. #Начать диалог при запуске функции.
Нужен для того, что-бы не запоминать каждый раз ID диалога и включать его вручную, а простым запуском функции запустить весь диалог. Т. е. если функция активирована, но в счёте num, ID диалога выключен, тогда поставить диалог включённым, + ресетнуть Опции выбора.

*ur_name-npc_name-1.0 - это Идентификатор диалога (ID). Его можно заменить, но важно что-бы во всех частях кода он был одинаков для одного диалога. ID диалога - это путь до самого файла диалога т. е. *ur_name-npc_name-1.0 = dialogues/ur_name/npc_name/1.0.mcfunction.

2. #Ресет перед следующим предложением.
Останавливает Голос (Озвучку) предложения и добавляет ID диалогу в счёте dialogue_num 1 для отображения следующего диалога.

3. #Диалоги
Тут по подробнее.
execute if score @s dialogue_num matches 1.. - проверка, активировал ли игрок команду для перехода на следующее предложение.
if score *ur_name-npc_name-1.0 dialogue_num matches (номер_предложения) - проверка, какое предложение нужно отобразить.
tellraw @a - команда для отображения текста в чате
<ИМЯ> - то, что будет отображаться перед сообщением в чате. Так, как общался бы обычный игрок.
,"color":"white" - в этом случае white это цвет имени говорящего.
,"clickEvent":{"action":"run_command","value":"/trigger dialogue_num"} - при нажатии на текст, выполнить команду на отображение следующего предложения.
,{"text":"ТЕКСТ","color":"white"} - ТЕКСТ это текст диалога а white это цвет диалога.

также, если вы хотите добавить новые предложения, просто скопируйте одно из них и замените (номер_предложения) на номер прошлого предложения + 1
4. #Голос (Озвучка)
if score *ur_name-npc_name-1.0 dialogue_num matches *номер предложения* - если номер диалога равен указанному, воспроизвести звук
playsound *ID звука* voice @a ~ ~ ~ 1 1 1 - воспроизвести звук, с громкость 1 pitch 1 и минимальной громкостью 1.

5. #Цикл
Разрешает всем игрокам использовать команду отображения следующего предложения и ресетает значение их счёта.

6. #Конец
Если номер текущего предложения равен номеру последнего предложения, завершить диалог.
Поставьте вместо 3.. номер последнего предложения.


Надеюсь я помог Вам научиться как создавать свои диалоги в майнкрафт!
CompatibilityMinecraft 1.19
toMinecraft 1.20
Tags

Create an account or sign in to comment.

CDed_kosoy_
01/03/2024 11:32 am
Level 5 : Apprentice Engineer
CDed_kosoy_'s Avatar
Who waits for update: it be very soon)))
Кто ждёт обновления: оно будет очень скоро)))
1
CDed_kosoy_
06/11/2023 5:21 am
Level 5 : Apprentice Engineer
CDed_kosoy_'s Avatar
Скоро добавлю систему квестов в ДатаПак... И думаю заняться обучающим видео.

I wanna add quests into DataPack... And i wanna create tutorial video.
1
Miklevj
06/07/2023 3:04 pm
Level 1 : New Miner
Miklevj's Avatar
Чел , ты лучший ! Спасибо большое ! я долго искал что то подобное и наконец смог . Сейчас я буду заниматься картой с сюжетом . Твой датапак просто я бы сказал идеально подходит для диалогов . На карте я оставлю сылку на твой профиль и надеюсь твой датапак , как и тебя заметят !
2
CDed_kosoy_
06/10/2023 10:34 am
Level 5 : Apprentice Engineer
CDed_kosoy_'s Avatar
<3
1
CDed_kosoy_
06/10/2023 10:03 am
Level 5 : Apprentice Engineer
CDed_kosoy_'s Avatar
Слууушай... Как тебе идея сотрудничества? Мне просто как раз нечем заняться, давай встретимся где-нибудь в дс? Мой Ya Rich#9709 если что могу помочь тебе в пользовании ДатаПаком. Помню как сам пытался найти что-то похожее но не получалось, и решил создать свой) (прости что долго отвечал, не заходил на сайт несколько дней :|)
1
CDed_kosoy_
06/03/2023 11:13 am
Level 5 : Apprentice Engineer
CDed_kosoy_'s Avatar
Я вообще изначально не хотел публиковать этот ДатаПак, но подумал что использовать я его врятли буду. Да и закончить мои проекты сил нет. Так что держите, только пожалуйста, если будете использовать мой ДатаПак упомяните меня в описании, я хотел-бы посмотреть на Ваши творения)

I didn't want to publish this datapack at all initially, but I thought I would use it in the future. And I don't have the strength to finish my projects. So keep it, just please, if you use my datapack, mention me in the description, I would like to look at your creations)
1
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome