[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4505: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3706)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4507: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3706)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4508: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3706)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4509: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3706)
AERIE Team • Просмотр темы - Кодирование мультидиалогов

AERIE Team

Все об играх серии Baldur's Gate
Текущее время: 19 апр 2024, 02:57

Часовой пояс: UTC + 3 часа




Начать новую тему Ответить на тему  [ Сообщений: 39 ]  На страницу 1, 2, 3  След.
Автор Сообщение
 Заголовок сообщения: Кодирование мультидиалогов
СообщениеДобавлено: 12 янв 2007, 21:19 
Не в сети

Зарегистрирован: 16 мар 2006, 23:20
Сообщения: 84


Последний раз редактировалось Vlad 13 янв 2007, 06:14, всего редактировалось 1 раз.

Вернуться к началу
 Профиль  
 
 Заголовок сообщения:
СообщениеДобавлено: 12 янв 2007, 22:32 
Не в сети
Аватара пользователя

Зарегистрирован: 09 сен 2006, 19:38
Сообщения: 558
Откуда: СПб
Спасибо, пару моментов это прояснило, но есть вопросы (правда чуть-чуть не по основной теме):
1) в чем разница между StartDialog и StartDialogNoSet?
2) для чего нужна команда Interact? Насколько я понял, она не отличается от Dialog. Или все же отличается?

EDIT Мне явно стоит прекратить дописывать фразы в своих постах. А то порой такой бред получается :)


Последний раз редактировалось Ardanis 13 янв 2007, 22:35, всего редактировалось 1 раз.

Вернуться к началу
 Профиль  
 
 Заголовок сообщения:
СообщениеДобавлено: 13 янв 2007, 06:12 
Не в сети

Зарегистрирован: 16 мар 2006, 23:20
Сообщения: 84


Вернуться к началу
 Профиль  
 
 Заголовок сообщения:
СообщениеДобавлено: 14 янв 2007, 11:25 
Не в сети
Администратор

Зарегистрирован: 23 сен 2003, 12:13
Сообщения: 1149
Откуда: Санкт-Петербург


Вернуться к началу
 Профиль  
 
 Заголовок сообщения:
СообщениеДобавлено: 14 янв 2007, 12:45 
Не в сети

Зарегистрирован: 16 мар 2006, 23:20
Сообщения: 84


Вернуться к началу
 Профиль  
 
 Заголовок сообщения:
СообщениеДобавлено: 14 янв 2007, 14:20 
Не в сети
Аватара пользователя

Зарегистрирован: 29 мар 2005, 05:04
Сообщения: 233


Вернуться к началу
 Профиль  
 
 Заголовок сообщения:
СообщениеДобавлено: 14 янв 2007, 17:36 
Не в сети

Зарегистрирован: 16 мар 2006, 23:20
Сообщения: 84


Вернуться к началу
 Профиль  
 
 Заголовок сообщения:
СообщениеДобавлено: 17 янв 2007, 11:21 
Не в сети
Администратор

Зарегистрирован: 23 сен 2003, 12:13
Сообщения: 1149
Откуда: Санкт-Петербург
Так-так-так, кое-что становится гораздо понятнее чем раньше.
Я даже осмелился замахнуться на реальный практический опыт :-)
Небольшая предистория: задумал я сделать малюсенький мод со старым знакомым еще по первой части - Тиаксом. Разработчики поместили его в Лечебницу и во время битвы с Айреникусом убивают, а я позволяю ему счастливо избежать гибели и вернуться в свою камеру (где мы его при желании и нанимаем).
Чтоб хоть как-то оживить этого несчастного задаваку, для него были написаны несколько диалогов - с Шарнейм, с Корганом, с Янсоном и с Керндом (это для начала, потом может и еще чего-нибудь придумаю).
И вот теперь пытаюсь закодировать эти маленькие задумки. (Я вовсе не считаю себя каким-то великим писателем и модмейкером, на основе этого маленького мода я надеюсь набраться опыта и помочь другим с созданием иных гораздо более серьезных задумок. На сегодняшний день я знаю как минимум три почти полностью написанных мода, которые ждут только когда их закодируют).
Итак:
файл скриптов
//TIAX.BAF

IF
InParty("KORGAN")
See("KORGAN")
!StateCheck("KORGAN",STATE_SLEEPING)
Global("TiaxTalkKorgan","LOCALS",0)
OR(2)
RealGlobalTimerExpired("VP_Korgan_Vs_Tiax","GLOBAL")
Global("VP_Korgan_Vs_Tiax","GLOBAL",1)
THEN
RESPONSE #100
SetGlobal("TiaxTalkKorgan","LOCALS",1)
Interact("Korgan")
END


IF
InParty("JAN")
See("JAN")
!StateCheck("JAN",STATE_SLEEPING)
Global("TiaxTalkJan","LOCALS",0)
OR(2)
RealGlobalTimerExpired("VP_Jan_Vs_Tiax","GLOBAL")
Global("VP_Jan_Vs_Tiax","GLOBAL",1)
THEN
RESPONSE #100
SetGlobal("TiaxTalkJan","LOCALS",1)
Interact("Jan")
END


IF
InParty("CERND")
See("CERND")
!StateCheck("CERND",STATE_SLEEPING)
Global("TiaxTalkCernd","LOCALS",0)
OR(2)
RealGlobalTimerExpired("VP_Cernd_Vs_Tiax","GLOBAL")
Global("VP_Cernd_Vs_Tiax","GLOBAL",1)
THEN
RESPONSE #100
SetGlobal("TiaxTalkCernd","LOCALS",1)
Interact("Cernd")
END


IF
Global("TiaxCharname","LOCALS",0)
OR(2)
RealGlobalTimerExpired("VP_PC_Vs_Tiax","GLOBAL")
Global("VP_PC_Vs_Tiax","GLOBAL",1)
THEN
RESPONSE #100
SetGlobal("TiaxCharname","LOCALS",1)
Interact("PC")
END

Файл диалогов:
// BTIAX.D

APPEND ~BTIAX~

// Диалог Тиакса с Корганом

IF WEIGHT #-1 ~Global("TiaxTalkKorgan","LOCALS",1)~ THEN BEGIN tiaxtalk1
SAY ~Корган, ты произодишь устрашающее впечатление. Не хотел бы ты пойти служить ко мне начальником дворцовой стражи, когда я стану повелителем мира?~
IF ~~ THEN DO ~SetGlobal("TiaxTalkKorgan","LOCALS",2)~ EXTERN ~BKORGAN~ kortiax1
END

IF ~~ THEN BEGIN kortiax2
SAY ~О какой это плате ты там бурчишь? Служить великому Тиаксу - вот истинная награда для таких, как ты.~
IF ~~ THEN DO ~SetGlobal("TiaxTalkKorgan","LOCALS",4)~ EXTERN ~BKORGAN~ kortiax3
END

IF ~~ THEN BEGIN kortiax4
SAY ~Ты многое теряешь, Корган. Придет время - в ногах будешь валяться, но великий Тиакс таких обид не забывает.~
IF ~~ THEN DO ~SetGlobal("TiaxTalkKorgan","LOCALS",6)~ EXTERN ~BKORGAN~ kortiax5
END

IF ~~ THEN BEGIN kortiax6
SAY ~(бормочет в полголоса и отходит на пару шагов в сторону) Все эти варвары, просто дикари какие-то... Но ничего, Великий Тиакс тебе это припомнит...~
IF ~~ THEN DO ~SetGlobal("TiaxTalkKorgan","LOCALS",8)~
END
EXIT

// Диалог Тиакса с Янсеном

IF WEIGHT #-1 ~Global("TiaxTalkJan","LOCALS",1)~ THEN BEGIN tiaxtalk2
SAY ~Эй, коротышка, что ты там все время про себя подсчитываешь и искоса поглядываешь на Великого Тиакса?~
IF ~~ THEN DO ~SetGlobal("TiaxTalkJan","LOCALS",2)~ EXTERN ~BJAN~ jantiax1
END

IF ~~ THEN BEGIN jantiax2
SAY ~О чем ты болтаешь? Зачем Великому Тиаксу, Владыке мира, какая-то никчемная репа, да еще и оптом?~
IF ~~ THEN DO ~SetGlobal("TiaxTalkJan","LOCALS",4)~ EXTERN ~BJAN~ jantiax3
END

IF ~~ THEN BEGIN jantiax4
SAY ~Великий Тиакс не собирается покупать твою репу ни тоннами, ни поштучно. Ешь свою репу сам и отстань от меня, пока я не разгневался.~
IF ~~ THEN DO ~SetGlobal("TiaxTalkJan","LOCALS",6)~ EXTERN ~BJAN~ jantiax5
END

IF ~~ THEN BEGIN jantiax6
SAY ~О какой выгоде ты говоришь? Великий Тиакс будет править всем миром и его не интересует презренная выручка мелких торговцев. Однако, если твоя репа может ускорить приход Тиакса к власти, то я готов тебя выслушать. Но не вздумай меня надуть, а не то гнев Кирика поразит твою лживую голову!~
IF ~~ THEN DO ~SetGlobal("TiaxTalkJan","LOCALS",8)~ EXTERN ~BJAN~ jantiax7
END

IF ~~ THEN BEGIN jantiax8
SAY ~Великого Тиакса не интересует "небольшое графство"! Заруби это себе на носу! Судьбою и Кириком мне уготовлена власть над миром!~
IF ~~ THEN DO ~SetGlobal("TiaxTalkJan","LOCALS",10)~ EXTERN ~BJAN~ jantiax9
END

IF ~~ THEN BEGIN jantix10
SAY ~Хмм. А почему ты сам не займешься столь выгодным дельцем?~
IF ~~ THEN DO ~SetGlobal("TiaxTalkJan","LOCALS",12)~ EXTERN ~BJAN~ jantix11
END

IF ~~ THEN BEGIN jantix12
SAY ~Ладно, Тиакс согласен. Для достижения великой цели, все способы хороши. Сколько стоит твоя репа и где товар?~
IF ~~ THEN DO ~SetGlobal("TiaxTalkJan","LOCALS",14)~ EXTERN ~BJAN~ jantix13
END

IF ~~ THEN BEGIN jantix14
SAY ~Да пропади он пропадом, твой троюродный племянник, ты сам и вся ваша семейка! Похоже, ты пытаешься обмануть Великого Тиакса. Сперва товар, потом деньги. Или проваливай и не отвлекай меня больше.~
IF ~~ THEN DO ~SetGlobal("TiaxTalkJan","LOCALS",16)~ EXTERN ~BJAN~ jantix15
END

IF ~~ THEN BEGIN jantix16
SAY ~Да-да, убирайся прочь с глаз Великого Тиакса, пока он не испепелил тебя одним взглядом.~
IF ~~ THEN DO ~SetGlobal("TiaxTalkJan","LOCALS",18)~
END
EXIT

// Диалог Тиакса с Керндом

IF WEIGHT #-1 ~Global("TiaxTalkCernd","LOCALS",1)~ THEN BEGIN tiaxtalk3
SAY ~До чего же надоели все эти леса и поля! Вырубить и выжечь каленым железом!~
IF ~~ THEN DO ~SetGlobal("TiaxTalkCernd","LOCALS",2)~ EXTERN ~BCERND~ certiax1
END

IF ~~ THEN BEGIN certiax2
SAY ~Они все равно бесполезны. А на освободившемся месте можно было бы построить Храмы Кирика и монументы Великому Тиаксу!~
IF ~~ THEN DO ~SetGlobal("TiaxTalkCernd","LOCALS",4)~ EXTERN ~BCERND~ certiax3
END

IF ~~ THEN BEGIN certiax4
SAY ~Меня совершенно не волнует, что ты там бурчишь. Все должны поклоняться Кирику и его воплощению на земле - Великому Тиаксу! И все должны платить дань.~
IF ~~ THEN DO ~SetGlobal("TiaxTalkCernd","LOCALS",6)~ EXTERN ~BCERND~ certiax5
END

IF ~~ THEN BEGIN certiax6
SAY ~Ерунда! Власть и богатство помогут достичь всего! И у Великого Тиакса вскоре будет вдоволь и того, и другого!~
IF ~~ THEN DO ~SetGlobal("TiaxTalkCernd","LOCALS",8)~ EXTERN ~BCERND~ certiax7
END

IF ~~ THEN BEGIN certiax8
SAY ~Не задавай глупых вопросов. ЗАЧЕМ Великому Тиаксу вся эта чепуха? Когда Тиакс будет править миром, каждый клочек суши и воды будет освобожден от "так называемой природы" и станет работать на славу Тиакса.~
IF ~~ THEN DO ~SetGlobal("TiaxTalkCernd","LOCALS",10)~ EXTERN ~BCERND~ certiax9
END

IF ~~ THEN BEGIN certix10
SAY ~Тебе просто не понять моих грандиозных планов. А-а-а... да что с тобой разговаривать...~
IF ~~ THEN DO ~SetGlobal("TiaxTalkCernd","LOCALS",12)~
END
EXIT

// Диалог Тиакса и <CHARNAME>

IF ~Global("TiaxCharname","LOCALS",1)~ THEN BEGIN banter1
SAY ~<CHARNAME>, после того как я помог тебе сбежать из Асилума, у тебя было время обдумать слова благодарности и признательности. Тиакс готов тебя выслушать.~
IF ~~ THEN REPLY ~Кто кому помог сбежать - это еще вопрос...~ GO TO banter2
IF ~~ THEN REPLY ~О великий Тиакс, прими мою искреннюю благодарность! Без тебя мы бы наверняка все погибли!~ GO TO banter3
IF ~~ THEN REPLY ~Заткнись, Тиакс! Я больше не собираюсь прислушиваться к твоей прогрессирующей мании величия.~ GO TO banter4
END

IF ~~ THEN BEGIN banter2
SAY ~Та-а-ак, похоже, что сегодня Тиакс не услышит слов благодарности... Ты меня очень огорчаешь, Шарнейм. Я думал, ты сможешь по достоинству оценить преимущества близкого знакомства с грядущим повелителем мира. Знай же, отныне ты не рассматриваешься как кандидат на должность первого визиря.~
IF ~~ THEN REPLY ~Не забывайся, Тиакс. Во мне течет кровь бога!~ GO TO banter5
IF ~~ THEN REPLY ~Меня никогда не интересовала должность первого визиря.~ GO TO banter6
IF ~~ THEN REPLY ~(пытаешься его поддразнить) Тиакс, ну прости меня пожалуйста! Должность первого визиря - с ума сойти, это мечта всей моей жизни!~ GO TO banter7
END

IF ~~ THEN BEGIN banter3
SAY ~Наконец-то Тиакс слышит от тебя мудрые речи! Тебе надо чаще и подробнее рассказывать о величии Тиакса везде, где нам приходится бывать.~
IF ~~ THEN REPLY ~Итак уже повсюду, где мы проходим, люди шепчутся у нас за спиной. Все узнают великого Тиакса и в благоговении замирают.~ GO TO banter8
IF ~~ THEN REPLY ~Ну уж, нет! Одного сумасшедшего в группе вполне достаточно!~ GO TO banter4
END

IF ~~ THEN BEGIN banter4
SAY ~Так вот, что в этой группе обо мне думают! Тиакс не потерпит такого обращения! Я немедленно собираю вещи и ухожу. Больше вы меня не увидите.~
IF ~~ THEN REPLY ~Скатерьтю дорожка! Никто плакать не станет!~ GO TO banter9
IF ~~ THEN REPLY ~Да ладно, Тиакс! Не сердись. Это была просто шутка. Куда же мы без тебя?~ GO TO banter10
END

IF ~~ THEN BEGIN banter5
SAY ~Со всеми этими битвами, скоро в тебе вовсе не останется ни капли крови. А мировое господство уготовлено мне Кириком! Прекратим этот разговор.~
END
EXIT

IF ~~ THEN BEGIN banter6
SAY ~Тебя интересуют только битвы. Ты даже понятия не имеешь сколь упоительна власть над миром. Не каждому дано это оценить. Не отвлекай больше Тиакса.~
END
EXIT

IF ~~ THEN BEGIN banter7
SAY ~Твой шанс уже ушел. Тиакс не собирается менять своего решения! Позволь мне в тишине обдумать грядущее мироустройство.~
END
EXIT

IF ~~ THEN BEGIN banter8
SAY ~Тиаксу нравится ход твоих мыслей! Вероятно со временем из тебя получится хороший слуга. А теперь помолчи, и дай Тиаксу подумать.~
END
EXIT

IF ~~ THEN BEGIN banter9
SAY ~Прощайте, невежы! Локти будете кусать, но не видать вам больше великого Тиакса! Я ухожу навсегда!~
END
EXIT

IF ~~ THEN BEGIN banter10
SAY ~Так-то лучше! Но предупреждаю, впредь Тиакс не потерпит таких шуточек!~
END
EXIT
END


И, наконец, один из дописываемых диалогов НПС:
// BKORGAN.D

APPEND ~BKORGAN~

IF ~~ THEN BEGIN kortiax1
SAY ~Мой топор всегда готов служить тем, кто хорошо платит.~
IF ~InParty("Tiax")~ THEN DO ~SetGlobal("TiaxTalkKorgan","LOCALS",3)~ EXTERN ~BTIAX~ kortiax2
END

IF ~~ THEN BEGIN kortiax3
SAY ~В таком случае, великому Тиаксу придется подыскивать себе другого начальника стражи. Для меня звон золотых монет и крепкая выпивка гораздо важнее, чем ум, честь и совесть вместе взятые. Ха-ха-ха.~
IF ~InParty("Tiax")~ THEN DO ~SetGlobal("TiaxTalkKorgan","LOCALS",5)~ EXTERN ~BTIAX~ kortiax4
END

IF ~~ THEN BEGIN kortiax5
SAY ~(поигрывает своим боевым топором) Если кто-то здесь и будет в ногах валяться, так это сам великий Тиакс с проломленным черепом!~
IF ~InParty("Tiax")~ THEN DO ~SetGlobal("TiaxTalkKorgan","LOCALS",7)~ EXTERN ~BTIAX~ kortiax6
END
END

Файлы BJAN.D и BCERND.D делаю по аналогии с этим, поэтому приводить их здесь не буду.
Несколько вопросов напоследок:
1 - Правильно ли я понял, что переменная WEIGHT должна быть только в том случае, если планируется несколькл диалогов между одими и теми же персонажами? Тогда в моем примере эта переменная вроде бы не нужна...
2 - Не получится ли при наличии в группе и Коргана, и Янсона, и Кернда, что Тиакс выдаст ВСЕ диалоги один за другим, а все оставшееся время будет тяжко и угрюмо помалкивать? И если да, то как этого можно избежать?
3 - И просто хотелось бы узнать, где (в приведенных примерах) я напортачил и накосячил? Ну, не верится мне, что я мог с первого же раза все сделать правильно :-)


Вернуться к началу
 Профиль  
 
 Заголовок сообщения:
СообщениеДобавлено: 17 янв 2007, 20:52 
Не в сети

Зарегистрирован: 16 мар 2006, 23:20
Сообщения: 84
Хорошо, со структурой диалогов вроде бы разобрались, но как использовать переменные - попытаюсь объяснить с самого начала.


Последний раз редактировалось Vlad 17 янв 2007, 21:24, всего редактировалось 1 раз.

Вернуться к началу
 Профиль  
 
 Заголовок сообщения:
СообщениеДобавлено: 17 янв 2007, 21:06 
Не в сети
Аватара пользователя

Зарегистрирован: 09 сен 2006, 19:38
Сообщения: 558
Откуда: СПб

_________________
They killed Fry :( Them bastards have killed her :'(


Вернуться к началу
 Профиль  
 
 Заголовок сообщения:
СообщениеДобавлено: 17 янв 2007, 22:43 
Не в сети

Зарегистрирован: 16 мар 2006, 23:20
Сообщения: 84


Вернуться к началу
 Профиль  
 
 Заголовок сообщения:
СообщениеДобавлено: 18 янв 2007, 00:45 
Не в сети

Зарегистрирован: 16 мар 2006, 23:20
Сообщения: 84


Вернуться к началу
 Профиль  
 
 Заголовок сообщения:
СообщениеДобавлено: 20 янв 2007, 14:16 
Не в сети
Администратор

Зарегистрирован: 23 сен 2003, 12:13
Сообщения: 1149
Откуда: Санкт-Петербург


Вернуться к началу
 Профиль  
 
 Заголовок сообщения:
СообщениеДобавлено: 20 янв 2007, 19:31 
Не в сети

Зарегистрирован: 16 мар 2006, 23:20
Сообщения: 84


Вернуться к началу
 Профиль  
 
 Заголовок сообщения:
СообщениеДобавлено: 08 фев 2007, 09:14 
Не в сети

Зарегистрирован: 27 июн 2003, 04:22
Сообщения: 26
Vlad ty ne ispol'zuesh' CHAIN :o

CHAIN - samyi prosteyshiy i nadejnyi sposob dialoga mejdu neskol'kimi NPC.

Eeto je tak prosto i nadejno.... U menya prosto net slov.

Sovetuyu Interact ne ispol'zovat' voobtshe potomu chto problem s Weights ne oberesh'sya. Vse 'scriptirovannye dialogi u menya vsegda idut tol'ko v J, togda ne byyvaet nikakih 'podmen' dialogov.

I hrista radi, ispol'zuyte CHAIN! Oh, i mejdu prochim, I_C_T - otlichnyy sposob dobavit' repliki drugih personajey v dialog. :D

Vot, izvinite chto na angliyskom, no ne mogu ya chto byy lyudi muchalis' s kodirovaniem vremen 2000 goda. Kstati chto byy posovremenee - ya kak-raz ushla v IWD2, no oni seichas delayut kuda bolee horoshie Checks vmesto starogo dobrogo troynogo (See, !Dead !State)

Some Tips and Tricks

Tools You Need: WeiDU (Weimer Dialogue Utility), NI (Near Infinity) and IESDP (Infinity Engine Description Project)

D-FILE SYNTAXIS

All this information can be found in Road to Banter Tutorial (by JC and Blue) and WeiDU Documantation (by Wes Weimer).

For the character to talk he or she needs a DIALOGUE FILE. Dialogue Files are of 2 sorts: INTERPARTY BANTER (called from the script by command Interact()) OR if they have no special conditions attached (and therefore do not require script) run by the engine and ALL OTHER BANTER (called from the Script by Dialogue() or StartDialogueNoSet()) I usually put all the banters between the characters into B-file and use Interact() to summon the ones that require SCRIPT. All other talks I place into J file and call for by Dialogue() commands. The Dialogue() command will force CREATURE to walk towards the person he is going to talk to. DialogueNoSet() will fire it ‘on spot’

The TWO useful syntaxes to write a D-file are: CHAIN and SAY. CHAIN is useful when you have lots of characters talking. SAY is good when you have NPC talking ONLY to PC. Your full dialogue can use a combination of SAY and CHAIN, depending on what you need.

Both CHAIN and SAY can be used to initiate a dialogue or be a block that is ‘sent to’ from an earlier one. The difference is in how the “top” is handled. No conditions on a dialogue block which is shown by using a double tilde after IF (like this: IF ~~ ) means that the block can not be used to start a conversation.

Let us look at a simple CHAIN.

CHAIN
IF WEIGHT #-1 ~InParty("AJANTIS")
See("AJANTIS")
!StateCheck("AJANTIS",STATE_SLEEPING)
AreaType(FOREST)
TineofDay(DAY)
Global("XZAJ1","LOCALS",0)~ THEN ~_BXZAR~ XZAJ1
~Sir Paladin, quickly! A dragon!~ [XZAR99]
DO ~SetGlobal("XZAJ1","LOCALS",1)~
== ~_BAJANT~ ~Eh, what? I see nothing.~
== ~_BXZAR~ ~There! In that gorse bush!~
== ~_BAJANT~ ~Your mockery is repellent as is all else about you. You see clearly enough that I am a paladin but feign to believe that a sparrow is a dragon.~
== ~_BXZAR~ ~Ah, your pardon, sirrah; curse these wandering senses of mine. I perceive now that I was twice mistaken.~
== ~_BAJANT~ ~Twice?!~
== ~_BXZAR~ ~Indeed. For an instant, I had truly believed yon twitting avian to be a paladin.~
EXIT

This is one coded dialogue from b-file. B-file contains all dialogues initiated by an NPC (in this case Xzar)

CHAIN
IF WEIGHT #-1 ~InParty("AJANTIS")
See("AJANTIS")
!StateCheck("AJANTIS",STATE_SLEEPING)

The beginning is always the same – shows whom with Xzar is going to talk to. Please, note that there is a bunch of stuff in tildes after IF – that’s mean that the first line of this CHAIN can serve to initiate a conversation and if the dialogue was scripted, then it will show up when called for (or when it has the condition that script has and is the top most or lowest weight one! It causes major headaches sometimes, so be careful to set up your conditions properly!)

If, for example Skie and Ajantis BOTH will have to be there – you will have the conditions set as shown below:


CHAIN
IF WEIGHT #-1 ~InParty("AJANTIS")
See("AJANTIS")
!StateCheck("AJANTIS",STATE_SLEEPING)
InParty("SKIE")
See("SKIE")
!StateCheck("SKIE",STATE_SLEEPING)

Note: “!” means “not”, in this case Ajantis and Skie are not sleeping

AreaType(FOREST)
TineofDay(DAY)

Those are Triggers. First tells you that the dialogue has to happen in the forest and the second one – that in the Daytime.


Where do you take triggers?

One word IESDP:

http://iesdp.gibberlings3.net/


Tokens (<CHARNAME>, <PRO_HESHE>, etc – where the game automatically put in the name, He/She etc of the PC are here:)

http://iesdp.gibberlings3.net/scripting/tokens.htm

Please note, that if you start a sentence with a TOKEN, it will still display first letter in low case. Conclusion: DO NOT START sentence with a TOKEN

IDS files (areatype etc) – those are the files browsable with Near Infinity as well as published in some places on the net (as on the site below)– gives you the types of Area, time of day etc – ie the variable in the parenthesis of the trigger. Usually the parameter you fish out of IDS is used without QUOTES ie AreaType(FOREST).

All IDS are collected in the IDS folder which you can browse with your NI Editor.

Really good BG1 walk-through is here:

http://www.dudleyville.com/bg1/index.htm

Tutorials:

General Page: PPG, FW, G3 all have separate forums for that stuff!


Rode to Banter (NPC-NPC talks):

Tutorial na Bantera “Road to Banter” is the single best tutorial on dialogue coding.

Global("XZAJ1","LOCALS",0)~ THEN ~_BXZAR~ XZAJ1

This line is very important! It asks the game if the banter has happened ALREADY! (Local = 0 means that nope, it did not!)

The naming of the files: first two letters of character’s name, starting with the NPC who initiates conversation. XZAJ means that XZ starts the conversatiuon with Ajantis. And then just count the banters: 1, 2 or whatever. XZAJ1 – first talk, XZAJ2 – second etc.

Note! It is a good idea to name all your GLOBALs using your personal PREFIX (ie all globals introduced by BG1NPC project should start with X#)

~_BXZAR~ is the name of the file to which the dialogue is going to. Tildas and underscores are there because of TUTU compatibility. Pure BG2 does not use them, like that: == BAJANT ~: New versions of WeiDU allow us to go the way of BG2, so it is not necessary anymore to enclose your FILE NAME in tildes (~)

ie == _BXZAR ~ is perfectly acceptable in TUTU


~Sir Paladin, quickly! A dragon!~ [XZAR99]

That’s the first line Xzar will say. In the square parentheses is the musical theme associated with the character.

DO ~SetGlobal("XZAJ1","LOCALS",1)~

This line changes Global from 0 to 1 to tell the game that the conversation did occur already.

This is the first time we are discussing operator DO. DO in the dialogue is used when you need simple actions performed, like setting GLOBAL or making character leave the screen. IESDP in its Actions subdivision documents all ACTIONS that will work with DO. To use DO with a CHAIN, just insert it anywhere in exactly the same fasion as shown. The action will occur after the dialogue is over. If it is important to have the action occurring after a certain phrase, we can do the following:

== ~_BAJANT~ ~Eh, what? I see nothing.~
END
IF ~~ THEN DO ~ SetGlobal("XZAJ1","LOCALS",1)~ EXTERN _BXZAR StateName

(we will talk about EXTERN more later on)

== ~_BAJANT~ ~Eh, what? I see nothing.~
== ~_BXZAR~ ~There! In that gorse bush!~

Those lines are “who says what” and transfer between files.

If a third character has something to say but it is not necessary for conversation to occur, then use this line:

== ~_BMONTA~ ~IF ~InParty("MONTARON")~ THEN ~text text text~

If the paragraph is too big, then use:
~ where you break it up and strat next line with:
= ~

== ~_BAJANT~ ~Eh, what? I see nothing.~
= ~and I really want to say much, much, much more about that, Xzar…~
== ~_BXZAR~ ~There! In that gorse bush!~

== ~_BXZAR~ ~Indeed. For an instant, I had truly believed yon twitting avian to be a paladin.~
EXIT

EXIT tells the game to get the hell out of DIALOGUE MODE! Ie that will finish the banter for us.

HOW TO INTRODUCE PC SPEECH?

CHAIN can handle PC responses or different actions… Let us say I want PC to interfere after Xzar said:

== ~_BXZAR~ ~Indeed. For an instant, I had truly believed yon twitting avian to be a paladin.~

Now, we cannot EXIT from dialogue mode. So we will use a neat command, called END instead and add PC response after it:

== ~_BXZAR~ ~Indeed. For an instant, I had truly believed yon twitting avian to be a paladin.~
END
IF ~~ THEN REPLY ~I, PC, have something to say~ EXIT

The line is finished by EXIT option. But what if we want to let XZAR put in another word? Well… we can GOTO to XZAR’s remark, like this:

== ~_BXZAR~ ~Indeed. For an instant, I had truly believed yon twitting avian to be a paladin.~
END
IF ~~ THEN REPLY ~I, PC, have something to say~ GOTO XzarReplyPC

And in the B-file we need to add that Xzar’s Reply. XzarReplyPC is called STATE NAME. Make sure that all STATE NAMES are different. You can sent multiple PC options to the same STAET NAME. If you send to a non-existent STATE name it will hick up WeiDU as well (surprise, surprise!)

Let’s consider the situation where XZAR only talks to a PC after out CHAIN. That calls for syntaxes with SAY. SAY does not have the FILE NAME in its SYNTAXIS so to indicate which file SAY is attached to we use APPEND command:

APPEND _BXZAR

IF ~~ XzarReplyPC
SAY ~And here is Xzar’s Reply~
IF ~~ THEN REPLY ~I, PC, have something to say~ GOTO XzarReplyPC1
IF ~Race(Player1,ELF)~ THEN REPLY ~I am an Elf and I have my special reply!~ GOTO XzarReplyPC2
IF ~~ THEN REPLY ~And I do not want to talk to anyone any more~ EXIT
IF ~~ THEN REPLY ~And I want to use a DO function!~ DO ~SetGlobal(“X#XzarGlobal”,GLOBAL”,1)~ EXIT
IF ~InParty(“Ajantis”)~ THEN REPLY ~And I want to show you how to use EXTERN~ EXTERN _BAJANT AjantisReplyPC
END

Note, that when we use SAY syntax, every block is started without mentioning file name (in case of CHAIN we had IF ~~ THEN _BXZAR XzarReplyPC) and is finished by END.

Please, also note that this BLOCK cannot initiate a dialogue. Tildas after IF are empty! A block that would have started a dialogue will look like this:

IF ~Global(“X#XzarStartTalking”,”GLOBAL”)~ XzarReplyPC
SAY ~And here is Xzar’s Reply~

Please, note that it’s NOT a good idea to have ANYTHING but GLOBAL value in IF condition on scripted dialogues with SAY. Set every condition up in the script.


And now comments to every one of PC replies:

First one sends you to Xzar’s reply XzarReplyPC1 on _BXZAR file!
Second one will only be showing up if the player1 is an ELF (setting conditions just like in the ‘top’ of the CHAIN, via IESDP options called TRIGGERs)
Third one is an option, which will kick us out of conversation
Fourth one shows how to use DO operator after PC reply
Fifth demonstrates the use of EXTERN EXTERN is the same as GOTO, but is used when we need to switch from file to file. If I used a GOTO after that line, I would have send the program to search AjantisReplyPC in _BXZAR file! But I want Ajantis to speak, therefore, I use EXTERN and specify which file I want to cross to after it.

What if we do NOT want PC to speak after a SAY block?

IF ~~ XzarReplyPC
SAY ~And here is Xzar’s Reply~
IF ~~ THEN EXIT
END

Is the construction you want.

And, if we want to use DO operator before getting out then, you guessed! It will be:

IF ~~ XzarReplyPC
SAY ~And here is Xzar’s Reply~
IF ~~ THEN DO ~SetGlobal(“X#XzarGlobal”,GLOBAL”,1)~ EXIT
END



USE of SHORTHAND

If you look on the files of a old-timer modder you will often see a bunch of +

Well, it’s a neat thingy called SHORTHAND that JC once suggested to Wes.

IF ~~ THEN REPLY in shorthand is ++ (double plus)

IF ~InParty(“Minsc”)~ THEN REPLY in SHORTHAND is IF ~InParty(“Minsc”)~ +

GOTO in SHORTHAND is + (single plus)

There s no shorthand for IF ~~ THEN EXIT or IF ~~ THEN DO

Interjections in its simplest incarnation are CHAINs only "inserted" into the existing text.

Here is an example of a simple interjection and below is the explanation of what's going on:

Please, note, this example uses IsValidForPartyDialogue("Kivan") throughout. It is not a good command, use the combination of:
InParty(“Kivan”) !Dead(“Kivan”) !StateCheck("Kivan",STATE_SLEEPING)

INTERJECT_COPY_TRANS ~_KELDDA~ 0 X#KivanKeldath
== ~_KIVANJ~ IF ~IsValidForPartyDialogue("Kivan")~ THEN ~Fair is your temple and full of hope, priest.~
== ~_KELDDA~ IF ~IsValidForPartyDialogue("Kivan")~ THEN ~And have you forsaken hope, my son?~
== ~_KIVANJ~ IF ~IsValidForPartyDialogue("Kivan")~ THEN ~I have hope but it lies beyond this plane, Keldath Ormlyr~
== ~_KELDDA~ IF ~IsValidForPartyDialogue("Kivan")~ THEN ~Gaze upon the sun as it rises, elf. It is born anew every morn - here and everywhere in this world... on this plane. Rejoice, for you are blessed by its rays.~
END

INTERJECT_COPY_TRANS

that's the command that seeks out the specific "state" on the file named:
~_KELDDA~

Please, note that if you are interjecting after a STATE that has a single action woth one DO function after it, you should be using (ie a DO something and EXIT state)

INTERJECT_COPY_TRANS2

In SHORTHAND INTERJECT_COPY_TRANS will be I_C_T and guess what will I_C_T2 stands for?


And here is this state (or simply the number of the line after which you want to interject:

0

if you look into the _KELDDA.D you will see:

IF WEIGHT #3 /* Triggers after states #: 1 2 6 even though they appear after this state */
~True()
~ THEN BEGIN 0 // Here is your state number! IE, you will be asking to insert your lines after that particular phrase.
SAY #77961 /* ~Welcome! The traveling adventurer is never turned away from a house of Lathander, as we strive to aid all who make a difference in the Realms. If you are battle-worn we can extend a number of necromantic restorations, whatever your need. A small donation is all the compensation that we require. If you wish nothing then let me tell you of the madman Bassilus.~ */
//Here is where the shown code will stick in Kivan - Keldoth conversation
IF ~~ THEN REPLY #77962 /* ~What kind of aid can you give us?~ */ DO ~StartStore("_TEM3402",LastTalkedToBy(Myself))
~ EXIT
IF ~!Dead("bassilus")
~ THEN REPLY #77963 /* ~We don't require any help at the moment. ~ */ GOTO 8
IF ~Dead("bassilus")
~ THEN REPLY #77963 /* ~We don't require any help at the moment. ~ */ EXIT
END


X#KivanKeldath
simply the name of the interjection. They should be unique and start with your prefix, since WeiDU will transform it into a GLOBAL.

== ~_KIVANJ~ IF ~IsValidForPartyDialogue("Kivan")~ THEN ~Fair is your temple and full of hope, priest.~

and here is the syntax - it is exactly the same as the CHAIN. Make sure that the condition IF-THEN is the same throughout. Please, note that traditionally J-files are used for handling interjections. All J file names are listed in PDIALOGUE.2DA file you can access via NI (in 2DA folder)


Where can you take the D files to look up their names (I already listed the states)?

It is done in a few stages:
1) open NI and find the CRE of the character which you interject with. F.ex: Elminster. You will find a bunch of CRE's for him; the ones that are from BG1 are the ones that have _ in front of them. Since I want to interject with Elminster in Chapter 3, I pick the _ELMIN3.CRE. When you open it up you will see that the dialogue assigned to him is _ELMIN3.DLG.
2) Write down the name of the dlg file.
3) open WeiDU. After the command line enter the command:
weidu _elmin3.dlg
the _elmin3.d will be created in the BG2 main folder.


EXTEND_BOTTOM

Is another useful command that allows you to add whatever you want after a STATE. For example, if I wanted to add PC replies after ~_KELDDA~ 0 it would look like:

EXTEND_BOTTOM ~_KELDDA~ 0
IF ~~ THEN REPLY ~Whatever~ EXIT
END


Other useful commands for D-files are:

ADD_TRANSACTION_TRIGGER
ADD_STATE_TRGGER
INTERJECT
JOURNAL
ADD_TRANS_ACTION
REPLACE_STATE_TRIGGER

Useful Reading:

Sim's Complete Scripting Guide (scripting!)
Ghreyfain's A Beginner's Guide to NPC Creation with WeiDU (explains file structure very well and gives simple examples of SAY dialogues)
Blue's and JC's Road to Banter (covers CHAIN in detail)
Japeth's State Weights (covers WEIGHTs)
JC's Another look at WEIGHTs (covers WEIGHTs)
Rastor's romance Authoring Tutorial (shows how to combine D and BAF to run a standard romance sequence with timered dialogues, dream scripts and flirts)
WeiDU Documentation (the bestselling mystery novel)


Вернуться к началу
 Профиль  
 
Показать сообщения за:  Поле сортировки  
Начать новую тему Ответить на тему  [ Сообщений: 39 ]  На страницу 1, 2, 3  След.

Часовой пояс: UTC + 3 часа


Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 1


Вы не можете начинать темы
Вы не можете отвечать на сообщения
Вы не можете редактировать свои сообщения
Вы не можете удалять свои сообщения
Вы не можете добавлять вложения

Найти:
Перейти:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Русская поддержка phpBB
Not able to open ./cache/data_global.php