XGM Forum
Сайт - Статьи - Проекты - Ресурсы - Блоги

Форуме в режиме ТОЛЬКО ЧТЕНИЕ. Вы можете задать вопросы в Q/A на сайте, либо создать свой проект или ресурс.
Вернуться   XGM Forum > Warcraft> Академия: форум для вопросов
Ник
Пароль
Войти через VK в один клик
Сайт использует только имя.

Ответ
 
bugmaker
invulnerable
offline
Опыт: 2,282
Активность:
Запутался )))
Вобщем я нумного запутался в своем триггере )
короче поясняю идею - у юнита в слотах 1 и 2 есть рюкзаки (листать вверх/вниз соответственно) после нажатия на рюкзак (вверх например) он берет кустом валю у юнита (в инициализации онитам даются кустом и рюкзаки) прибавляет к переменной InvPage 1. далее делает цикл от 1 до общего колва юнитов у кого есть рюкзак (в инийиализайии все ето устанавливается) далее еще один от 3 до 6 (слоты в которые мона класть вещи, потом сеттит строковые переменные 0 + кустом юнита, 0+ стр., и слот (т.е. если например юнит № 5, стр 8, слот 3 то будет 5083(ну вобщем понятно, далее дропаем эти итемы с хира, после сэтим к временной переменной стр+1 и даем ему итемы (из примера 5084. Вобщем плохо работает листание вниз (итемы просто путаются страницами (а некоторые дают несколько ссылок на один и тот же айтем (эта проблема только с листаним вниз)

понимаете - я не нуб, даже если и задаю такие тупые вопросы, но все же хелп плиз )

ПОЯСНЕНИЯ:
CUnit - кустом валю
Код:
Listing up n down
    Events
        Unit - A unit Uses an item
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Item-type of (Item being manipulated)) Equal to Рюкзак up
            Then - Actions
                Set IUnit = (Hero manipulating item)
                Set PNum = (Player number of (Owner of IUnit))
                Set CUnit = (Custom value of IUnit)
                Set InvPage[CUnit] = (InvPage[CUnit] + 1)
                If (InvPage[CUnit] Greater than max_backpack[CUnit]) then do (Set InvPage[CUnit] = 1) else do (Do nothing)
                For each (Integer A) from 1 to UNum, do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Custom value of UUnit[CUnit]) Equal to (Integer A)
                            Then - Actions
                                For each (Integer B) from 3 to 6, do (Actions)
                                    Loop - Actions
                                        Set ISlot = (Integer B)
                                        If (CUnit Less than 10) then do (Set Fstr[1] = (0 + (String(CUnit)))) else do (Set Fstr[1] = (String(CUnit)))
                                        If (InvPage[CUnit] Less than 10) then do (Set Fstr[2] = (0 + (String(InvPage[CUnit])))) else do (Set Fstr[2] = (String(InvPage[CUnit])))
                                        Set Fstr[3] = (String(ISlot))
                                        Set ArrayIndex = (Integer(((Fstr[1] + Fstr[2]) + Fstr[3])))
                                        Set ItemsHero[ArrayIndex] = (Item carried by IUnit in slot ISlot)
                                        Hero - Drop ItemsHero[ArrayIndex] from IUnit
                                        Item - Hide ItemsHero[ArrayIndex]
                                        Item - Set the custom value of ItemsHero[ArrayIndex] to ArrayIndex
                                        //Game - Display to (All players) the text: (предметы -  + ((|c0000F000 + (Name of ItemsHero[ArrayIndex])) + ((|r, личный номер - + |c00EE0000) + ((String(ArrayIndex)) + |r))))
                                        If (ISlot Equal to 3) then do (Set InvPg = (InvPage[CUnit] + 1)) else do (Do nothing)
                                        If (InvPg Greater than max_backpack[CUnit]) then do (Set InvPg = 1) else do (Do nothing)
                                        If (InvPg Less than 10) then do (Set Fstr[2] = (0 + (String(InvPg)))) else do (Set Fstr[2] = (String(InvPg)))
                                        Set ArrayIndex = (Integer(((Fstr[1] + Fstr[2]) + Fstr[3])))
                                        Hero - Give ItemsHero[ArrayIndex] to IUnit
                                        Item - Show ItemsHero[ArrayIndex]
                                        Item - Set the custom value of ItemsHero[ArrayIndex] to ArrayIndex
                                        //Game - Display to (All players) the text: (новое -  + ((|c0000F000 + (Name of ItemsHero[ArrayIndex])) + ((|r, личный номер - + |c00EE0000) + ((String(ArrayIndex)) + |r))))
                            Else - Actions
                Set InvPg = (InvPage[CUnit] + 1)
                If (InvPg Greater than max_backpack[CUnit]) then do (Set InvPg = 1) else do (Do nothing)
                Item - Set charges remaining in (Item carried by IUnit of type Рюкзак down) to InvPg
                Item - Set charges remaining in (Item carried by IUnit of type Рюкзак up) to InvPg
                Skip remaining actions
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Item-type of (Item being manipulated)) Equal to Рюкзак down
            Then - Actions
                Set IUnit = (Hero manipulating item)
                Set PNum = (Player number of (Owner of IUnit))
                Set CUnit = (Custom value of IUnit)
                Set InvPage[CUnit] = (InvPage[CUnit] - 1)
                If (InvPage[CUnit] Less than 1) then do (Set InvPage[CUnit] = max_backpack[CUnit]) else do (Do nothing)
                For each (Integer A) from 1 to UNum, do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Custom value of UUnit[CUnit]) Equal to (Integer A)
                            Then - Actions
                                For each (Integer B) from 3 to 6, do (Actions)
                                    Loop - Actions
                                        Set ISlot = (Integer B)
                                        If (CUnit Less than 10) then do (Set Fstr[1] = (0 + (String(CUnit)))) else do (Set Fstr[1] = (String(CUnit)))
                                        If (InvPage[CUnit] Less than 10) then do (Set Fstr[2] = (0 + (String(InvPage[CUnit])))) else do (Set Fstr[2] = (String(InvPage[CUnit])))
                                        Set Fstr[3] = (String(ISlot))
                                        Set ArrayIndex = (Integer(((Fstr[1] + Fstr[2]) + Fstr[3])))
                                        Set ItemsHero[ArrayIndex] = (Item carried by IUnit in slot ISlot)
                                        Hero - Drop ItemsHero[ArrayIndex] from IUnit
                                        Item - Hide ItemsHero[ArrayIndex]
                                        Item - Set the custom value of ItemsHero[ArrayIndex] to ArrayIndex
                                        //Game - Display to (All players) the text: (сейчас -  + ((|c0000F000 + (Name of ItemsHero[ArrayIndex])) + ((|r, личный номер - + |c00EE0000) + ((String(ArrayIndex)) + |r))))
                                        If (ISlot Equal to 3) then do (Set InvPg = (InvPage[CUnit] - 1)) else do (Do nothing)
                                        If (InvPg Less than 1) then do (Set InvPg = max_backpack[CUnit]) else do (Do nothing)
                                        If (InvPg Less than 10) then do (Set Fstr[2] = (0 + (String(InvPg)))) else do (Set Fstr[2] = (String(InvPg)))
                                        Set ArrayIndex = (Integer(((Fstr[1] + Fstr[2]) + Fstr[3])))
                                        Hero - Give ItemsHero[ArrayIndex] to IUnit
                                        Item - Show ItemsHero[ArrayIndex]
                                        Item - Set the custom value of ItemsHero[ArrayIndex] to ArrayIndex
                                        //Game - Display to (All players) the text: (новое -  + ((|c0000F000 + (Name of ItemsHero[ArrayIndex])) + ((|r, личный номер - + |c00EE0000) + ((String(ArrayIndex)) + |r))))
                            Else - Actions
                Set InvPg = (InvPage[CUnit] + 1)
                If (InvPg Greater than max_backpack[CUnit]) then do (Set InvPg = 1) else do (Do nothing)
                Item - Set charges remaining in (Item carried by IUnit of type Рюкзак down) to InvPg
                Item - Set charges remaining in (Item carried by IUnit of type Рюкзак up) to InvPg
                Skip remaining actions
            Else - Actions





З.Ы. я на мапе которую выложил делаю небольшую инвентарную скилл систему (тригги я удалил есессено) так что не обращайте внимания на объекты )
Старый 10.12.2005, 10:15
bugmaker
invulnerable
offline
Опыт: 2,282
Активность:
ну че все молчат то (
)
Старый 11.12.2005, 16:16
NETRAT

offline
Опыт: 83,712
Активность:
Что-то я с ним никаких проблем не заметил... вроде все работает
Старый 11.12.2005, 16:31
bugmaker
invulnerable
offline
Опыт: 2,282
Активность:
ну папробуй заполнить его полностью, потом полистать наверх/вниз. Они почемуто путаются страницами?
я сам не знаю почему, вроде и триги простые...
Старый 11.12.2005, 18:38
Ответ

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск

Ваши права в разделе
Вы не можете создавать темы
Вы не можете отвечать на сообщения
Вы не можете прикреплять файлы
Вы можете скачивать файлы

BB-коды Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход



Часовой пояс GMT +3, время: 07:08.