[ПРОБЛЕМА] Игра виснет при когда проигрывает союзник-ИИ - Форум HeroesWorld-а

Быстрая навигация по основным разделам форума:
Турниры
КАРТЫ
Heroes 6
Heroes 5
Heroes 4
Heroes 3
Heroes 2
Heroes 1
Might&Magic

Технические вопросы Heroes 5 Этот раздел создан специально чтобы не создавать кучу тем вида ("Пожалуйста помогите"). Если вы хотите создать в нем новую тему, то создавайте ее по примеру: "Ошибка при запуске Heroes 5 на GeForce 6600" - приблизительно в таком стиле.

Внимание: Описывайте свою проблему подробно и желательно прилагайте скришот, иначе первые сообщения на ваш вопрос будут с просьбой уточнения.

Ответ
 
Опции темы
#1
Старый 14.11.2020, 21:06
  #1
^
itisdepp
📖
Регистрация: 14.11.2020
Сообщения: 4
Регистрация: 14.11.2020
Сообщения: 4
По умолчанию
[ПРОБЛЕМА] Игра виснет при когда проигрывает союзник-ИИ

Доброго времени суток! Облазил форум, но такой проблемы не нашел: 
На двух разных мощных ноутах в случае, когда компьютерный союзник проигрывает (по прошествии 7 дней после потери им всех замков), игра виснет наглухо. То есть я завершаю ход, ходят соперники-ИИ и на последнем сопернике игра виснет. Иногда доходит до состояния "Идёт сохранение"
Win7, Core i5, AMD Radeon 330. Повелители Орды.
itisdepp вне форума
Ответить с цитированием
#2
Старый 14.11.2020, 21:09
  #2
^
}{0TT@6bI4
 
Аватар для }{0TT@6bI4
📖
Регистрация: 05.09.2019
Адрес: Серебряные Города, Аль-Сафир
Сообщения: 1965
Выставка наград
Регистрация: 05.09.2019
Адрес: Серебряные Города, Аль-Сафир
Сообщения: 1965
Выставка наград
По умолчанию
Re: [ПРОБЛЕМА] Игра виснет при когда проигрывает союзник-ИИ

Скрипт на картах есть какой-то?
__________________
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
}{0TT@6bI4 вне форума
Ответить с цитированием
#3
Старый 14.11.2020, 21:41
  #3
^
itisdepp
📖
Регистрация: 14.11.2020
Сообщения: 4
Регистрация: 14.11.2020
Сообщения: 4
По умолчанию
Re: [ПРОБЛЕМА] Игра виснет при когда проигрывает союзник-ИИ

Да, целый набор скриптов.
itisdepp вне форума
Ответить с цитированием
#4
Старый 14.11.2020, 21:50
  #4
^
}{0TT@6bI4
 
Аватар для }{0TT@6bI4
📖
Регистрация: 05.09.2019
Адрес: Серебряные Города, Аль-Сафир
Сообщения: 1965
Выставка наград
Регистрация: 05.09.2019
Адрес: Серебряные Города, Аль-Сафир
Сообщения: 1965
Выставка наград
По умолчанию
Re: [ПРОБЛЕМА] Игра виснет при когда проигрывает союзник-ИИ

Это точно не весь скрипт; плюс можно посмотреть скрипт creature_table.lua?
__________________
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
}{0TT@6bI4 вне форума
Ответить с цитированием
#5
Старый 14.11.2020, 22:06
  #5
^
itisdepp
📖
Регистрация: 14.11.2020
Сообщения: 4
Регистрация: 14.11.2020
Сообщения: 4
По умолчанию
Re: [ПРОБЛЕМА] Игра виснет при когда проигрывает союзник-ИИ

MapScript.lua--Two Brothers version 1.0 by ****** --
--commented strings aren't work ='(  --
path = GetMapDataPath()
diff = GetDifficulty()
enemy={PLAYER_3,PLAYER_4,PLAYER_5,PLAYER_6}
enemy_town={}
enemy_town[PLAYER_3]="p3town"
enemy_town[PLAYER_4]="p4town"
enemy_town[PLAYER_5]="p5town"
enemy_town[PLAYER_6]="p6town"

doFile(path.."creature_table.lua")

---------------------------------------------
--Adventure Spells---------------------------
---------------------------------------------
function call_way(hero,object)
    local current=GetObjectOwner(hero)
    current=GetPlayerFilter (current)
    if know_call[hero]==1 then
        MessageBoxForPlayers(current,path.."adv_magic/known_refuse.txt")
    elseif GetHeroStat(hero,STAT_EXPERIENCE)>34141 then
        currenthero=hero
        if object=="light_way_teacher" then    QuestionBoxForPlayers(current,path.."adv_magic/a_question.txt","give_light_ability",nil)
        elseif object=="dark_way_teacher" then QuestionBoxForPlayers(current,path.."adv_magic/d_question.txt","give_dark_ability",nil)
        end
    else
        MessageBoxForPlayers(current,path.."adv_magic/pitty_refuse.txt")
    end
end

function haste_way(hero,object)
    local current=GetObjectOwner(hero)
    current=GetPlayerFilter (current)
    if know_haste[hero]==1 then
        MessageBoxForPlayers(current,path.."adv_magic/haste_refuse.txt")
    elseif GetHeroStat(hero,STAT_EXPERIENCE)>81977 then
        currenthero=hero
        QuestionBoxForPlayers(current,path.."adv_magic/haste_question.txt","give_haste",nil)
    else
        MessageBoxForPlayers(current,path.."adv_magic/haste_refuse.txt")
    end
end

function give_light_ability()
    PlayVisualEffect("/Effects/_(Effect)/Spells/Bless.xdb#xpointer(/Effect)",currenthero)
    x,y,z=GetObjectPosition(currenthero)
    Play3DSound("/Sounds/_(Sound)/Spells/bless.xdb#xpointer(/Sound)", x,y,z)    
    PlayObjectAnimation("light_way_teacher","happy",ONESHOT)
    ControlHeroCustomAbility(currenthero, CUSTOM_ABILITY_1, CUSTOM_ABILITY_ENABLED);
    know_call[currenthero]=1
    MarkObjectAsVisited("light_way_teacher",currenthero)
    currenthero=""
end

function give_dark_ability()
    PlayVisualEffect("/Effects/_(Effect)/Spells/DisruptingRay.xdb#xpointer(/Effect)",currenthero)
    local x,y,z=GetObjectPosition(currenthero)
    Play3DSound("/Sounds/_(Sound)/Spells/DisruptingRay.xdb#xpointer(/Sound)", x,y,z)    
    PlayObjectAnimation("dark_way_teacher","speech_orator",ONESHOT)
    ControlHeroCustomAbility(currenthero, CUSTOM_ABILITY_2, CUSTOM_ABILITY_ENABLED);
    know_call[currenthero]=1
    MarkObjectAsVisited("dark_way_teacher",currenthero)
    currenthero=""
end

function give_haste()
    PlayVisualEffect("/Effects/_(Effect)/Spells/Haste.xdb#xpointer(/Effect)",currenthero)
    local x,y,z=GetObjectPosition(currenthero)
    Play3DSound("/Sounds/_(Sound)/Spells/Haste.xdb#xpointer(/Sound)", x,y,z)    
    ControlHeroCustomAbility(currenthero, CUSTOM_ABILITY_3, CUSTOM_ABILITY_ENABLED);
    know_haste[currenthero]=1
    MarkObjectAsVisited("dancer",currenthero)
    currenthero=""
end

function call(hero, ability)
    if ability==CUSTOM_ABILITY_1 then
        SetObjectPosition(hero,4,62,0,3)
        temp=GetHeroStat(hero,STAT_MOVE_POINTS)
        ChangeHeroStat(hero,STAT_MOVE_POINTS,-temp)
        temp=GetHeroStat(hero,STAT_MANA_POINTS)
        ChangeHeroStat(hero,STAT_MANA_POINTS,-temp)
        for i=1,4 do
            AddResource(PLAYER_3)
            AddCreatures(3)
            AddExp(3)
        end
    elseif ability==CUSTOM_ABILITY_2 then
        SetObjectPosition(hero,113,48,1,3)
        SetStoppingRegions()
    elseif ability==CUSTOM_ABILITY_3 then
        temp=GetHeroStat(hero,STAT_MANA_POINTS)
        ChangeHeroStat(hero,STAT_MANA_POINTS,-temp)
        ChangeHeroStat(hero,STAT_MOVE_POINTS,10*temp)
    --elseif ability==CUSTOM_ABILITY_4 then
    --    RMP[hero]=GetHeroStat(hero,STAT_MOVE_POINTS)+RMP[hero]
    --    ChangeHeroStat(hero,STAT_MOVE_POINTS,-RMP[hero])
    end
end

know_call={}
know_haste={}
--RMP={}
--function give_wait(hero)
--    ControlHeroCustomAbility(hero, CUSTOM_ABILITY_4, CUSTOM_ABILITY_ENABLED)
--    RMP[hero]=0
--end

--for i=1,2 do
--    Heroes=GetPlayerHeroes(i)
--    for j,hero in Heroes do
--        give_wait(hero)
--    end
--    Trigger(PLAYER_ADD_HERO_TRIGGER, i, "give_wait")
--end

SetObjectEnabled("light_way_teacher",nil)
SetObjectEnabled("dark_way_teacher",nil)
SetObjectEnabled("dancer",nil)
Trigger(OBJECT_TOUCH_TRIGGER,"light_way_teacher","call_way")
Trigger(OBJECT_TOUCH_TRIGGER,"dark_way_teacher","call_way")
Trigger(OBJECT_TOUCH_TRIGGER,"dancer","haste_way")

Trigger(CUSTOM_ABILITY_TRIGGER, "call");
---------------------------------------------
--End Adventure Spells-----------------------
---------------------------------------------
--Custom Temples-----------------------------
---------------------------------------------
function imp_ask(hero,object)
    currenthero=hero
    local current=GetObjectOwner(hero)
    QuestionBoxForPlayers(current,path.."temples/imp_ask.txt","imp_battle",nil)
end;    
    
function imp_battle()
    local count={}
    for i=1,5 do
        count[i]=(random(5)+1)*GetDate(DAY)
    end
    StartCombat(currenthero,nil,5,CREATURE_IMP,count[1],CREATURE_FAMILIAR,count[2],CREATURE_QUASIT,count[3],CREATURE_FAMILIAR,count[4],CREATURE_IMP,count[5],nil,"imp_result","/Scenes/CombatArenas/Lava_Citadel.(AdventureFlybyScene).xdb#xpointer(/AdventureFlybyScene)",nil)
end

function imp_result(hero,isWin)
    if isWin then
        local count=(random(5)+1)*GetDate(DAY)
        count=sqrt(count)
        count=round(count)
        local side=GetObjectOwner(hero)
        count=GetPlayerResource(side,MERCURY)+count
        ShowFlyingSign(path.."temples/imp_fs.txt",hero,side,3)
        SetPlayerResource(side,MERCURY,count,hero)
        MarkObjectAsVisited("imp_temple",hero)
        Trigger(OBJECT_TOUCH_TRIGGER,"imp_temple","imp_refuse")
    end
end

function imp_refuse(hero,object)
    local current=GetObjectOwner(hero)
    MessageBoxForPlayers(current,path.."temples/imp_refuse.txt")
end

SetObjectEnabled("imp_temple",nil)
Trigger(OBJECT_TOUCH_TRIGGER,"imp_temple","imp_ask")

function cemetry_ask(hero,object)
    currenthero=hero
    local current=GetObjectOwner(hero)
    QuestionBoxForPlayers(current,path.."temples/cemetry_ask.txt","cemetry_battle",nil)
end;    
    
function cemetry_battle()
    local count=(random(5)+5)*10
    StartCombat(currenthero,nil,2,CREATURE_SKELETON,co unt,CREATURE_SKELETON_ARCHER,count,nil,"cemetry_result",nil,nil)
end

function cemetry_result(hero,isWin)
    if isWin then
        local count=(random(10)+1)*100
        local side=GetObjectOwner(hero)
        count=GetPlayerResource(side,GOLD)+count
        ShowFlyingSign(path.."temples/cemetry_fs.txt",hero,side,3)
        SetPlayerResource(side,GOLD,count,hero)
        MarkObjectAsVisited("cemetry_temple",hero)
        Trigger(OBJECT_TOUCH_TRIGGER,"cemetry_temple","cemetry_refuse")
    end
end

function cemetry_refuse(hero,object)
    local current=GetObjectOwner(hero)
    MessageBoxForPlayers(current,path.."temples/cemetry_refuse.txt")
end

SetObjectEnabled("cemetry_temple",nil)
Trigger(OBJECT_TOUCH_TRIGGER,"cemetry_temple","cemetry_ask")


function arc_ask(hero,object)
    currenthero=hero
    local current=GetObjectOwner(hero)
    QuestionBoxForPlayers(current,path.."temples/arc_ask.txt","arc_battle",nil)
end;    
    
function arc_battle()
    local count={}
    for i=1,3 do
        count[i]=(random(3)+2)*GetDate(DAY)
    end
    StartCombat(currenthero,nil,3,CREATURE_MARKSMAN,co unt[1],CREATURE_ARCHER,count[2],CREATURE_LONGBOWMAN,count[3],nil,"arc_result",nil,nil)
end

function arc_result(hero,isWin)
    if isWin then
        local count=(random(3)+2)*100*GetDate(DAY)
        local side=GetObjectOwner(hero)
        count=GetPlayerResource(side,GOLD)+count
        ShowFlyingSign(path.."temples/arc_fs.txt",hero,side,3)
        SetPlayerResource(side,GOLD,count,hero)
        MarkObjectAsVisited("arc_tower",hero)
        Trigger(OBJECT_TOUCH_TRIGGER,"arc_tower","arc_refuse")
    end
end

function arc_refuse(hero,object)
    local current=GetObjectOwner(hero)
    MessageBoxForPlayers(current,path.."temples/arc_refuse.txt")
end

SetObjectEnabled("arc_tower",nil)
Trigger(OBJECT_TOUCH_TRIGGER,"arc_tower","arc_ask")



function cry_ask(hero,object)
    currenthero=hero
    local current=GetObjectOwner(hero)
    QuestionBoxForPlayers(current,path.."temples/cry_ask.txt","cry_battle",nil)
end;    
    
function cry_battle()
    local count={}
    for i=1,3 do
        count[i]=(random(6)+2)+7*GetDate(WEEK)
    end
    StartCombat(currenthero,nil,3,CREATURE_POLTERGEIST ,count[1],CREATURE_POLTERGEIST,count[2],CREATURE_POLTERGEIST,count[3],nil,"cry_result",nil,nil)
end

function cry_result(hero,isWin)
    if isWin then
        local count=(random(9)+2)+4*GetDate(WEEK)
        local side=GetObjectOwner(hero)
        count=GetPlayerResource(side,CRYSTAL)+count
        ShowFlyingSign(path.."temples/cry_fs.txt",hero,side,3)
        SetPlayerResource(side,CRYSTAL,count,hero)
        MarkObjectAsVisited("crystal",hero)
        Trigger(OBJECT_TOUCH_TRIGGER,"crystal","cry_refuse")
    end
end

function cry_refuse(hero,object)
    local current=GetObjectOwner(hero)
    MessageBoxForPlayers(current,path.."temples/cry_refuse.txt")
end

SetObjectEnabled("crystal",nil)
Trigger(OBJECT_TOUCH_TRIGGER,"crystal","cry_ask")
---------------------------------------------
--End Custom Temples-------------------------
---------------------------------------------
--Gift Column--------------------------------
---------------------------------------------
function ask_gift(hero,object)
    currenthero=hero
    temp=GetObjectOwner(hero)
    current=temp
    if temp==PLAYER_1 then
        temp=PLAYER_2
    elseif temp==PLAYER_2 then
        temp=PLAYER_1
    end
    QuestionBoxForPlayers(current,path.."clons/gift_ask.txt","do_gift",nil)
    --twn="p"..temp.."town"
    --twn=enemy_town[temp]
    --print(temp)
    --print(twn)
    --local owner=GetObjectOwner(twn)
    --print(owner)
    --if owner==current then
    --    QuestionBoxForPlayers(current,path.."clons/return_ask.txt","return_town",nil)
    --end
end

--function return_town()
--    SetObjectOwner(twn,temp)
--end

function do_gift()
    PlayVisualEffect("/Effects/_(Effect)/Spells/LightningBolt.xdb#xpointer(/Effect)","gift_col")
    local x,y,z=GetObjectPosition("gift_col")
    Play3DSound("/Sounds/_(Sound)/Spells/LightningBolt.xdb#xpointer(/Sound)", x,y,z)    
    SetObjectOwner(currenthero,temp)
end

SetObjectEnabled("gift_col",nil)
Trigger(OBJECT_TOUCH_TRIGGER,"gift_col","ask_gift")
    
---------------------------------------------
--End Gift Column----------------------------
---------------------------------------------
--Computer's help----------------------------
---------------------------------------------
function AddResource(player)
    if GetPlayerState(player)==PLAYER_ACTIVE then
        local temp=0
        for i=0,1 do
            temp=GetPlayerResource(player,i)
            SetPlayerResource(player,i,temp+diff*20)
        end
        for i=2,5 do
            temp=GetPlayerResource(player,i)
            SetPlayerResource(player,i,temp+diff*10)
        end
            temp=GetPlayerResource(player,6)
            SetPlayerResource(player,6,temp+diff*10000)
    end
end

function AddExp(player)
    if GetPlayerState(player)==PLAYER_ACTIVE then
        local heroes=GetPlayerHeroes(player)
        local count=GetDate(MONTH)*1000
        for i,h in heroes do
            GiveExp(h,count)
        end
    end
end

function AddCreatures(player)
    local owner=GetObjectOwner(enemy_town[player])
    if owner==player then
        for i=1,7 do
            local bl=GetTownBuildingLevel(enemy_town[player],6+i)
            if bl~=0 then
                local race=GetPlayerRace(player)
                local creature=GetCreatureByData(race,i,1)
                local count=GetObjectDwellingCreatures(enemy_town[player],creature)
                SetObjectDwellingCreatures(enemy_town[player],creature,count+diff*(8-i))
            end
        end
    end
end
    
---------------------------------------------
--End Computer's help------------------------
---------------------------------------------
--New Day------------------------------------
---------------------------------------------
function NewDayF()
    for i=1,4 do
        AddExp(enemy[i])
    end
    local temp=GetDate(DAY_OF_WEEK)
    if temp==1 then
        for i=1,4 do
            AddResource(enemy[i])
            AddCreatures(enemy[i])
        end
    end
    temp=GetDate(DAY)
    if temp==2 then
        --do_test()
    end
    for i=1,6 do
        if temp==52-diff*12+5*i then
            object="entrance2"..i
            player=floor((12-i)/2)
            SetObjectEnabled(object,not nil)
            if GetPlayerState(player)==PLAYER_ACTIVE then
                SetAIPlayerAttractor(object,player,1)
                local x,y,f=GetObjectPosition(object)
                OpenCircleFog(x,y,f,5,player)
            end
        end
    end
end

for i=1,6 do
    object="entrance2"..i
    SetObjectEnabled(object,nil)
end

for i=3,6 do
    if GetPlayerState(i)==PLAYER_ACTIVE then
        SetAIPlayerAttractor("p1town",i,2)
        SetAIPlayerAttractor("p2town",i,2)
    end
end

Trigger(NEW_DAY_TRIGGER,"NewDayF")

function Lost_check(player)
    while not nil do
        local state=GetPlayerState(player)
        if state==PLAYER_NOT_IN_GAME or state==PLAYER_LOST then
            local temp=player
            if temp==PLAYER_1 then
                temp=PLAYER_2
            elseif temp==PLAYER_2 then
                temp=PLAYER_1
            end
            Loose(temp)
        else
            sleep(1)
        end
    end
end

startThread(Lost_check,PLAYER_1)
startThread(Lost_check,PLAYER_2)
---------------------------------------------
--End New Day--------------------------------
---------------------------------------------
--Dark Way-----(Black Hole)------------------
---------------------------------------------
n_regions=97
region_free={}
battle_bonuses={HERO_BATTLE_BONUS_LUCK,HERO_BATTLE _BONUS_MORALE,HERO_BATTLE_BONUS_ATTACK,HERO_BATTLE _BONUS_DEFENCE,HERO_BATTLE_BONUS_INITIATIVE,HERO_B ATTLE_BONUS_SPEED}
battle_length=length(battle_bonuses)

for i=0,n_regions do
    reg="unnamed "..i
    Trigger(REGION_ENTER_WITHOUT_STOP_TRIGGER,reg,"DarkWayTrouble")
    region_free[reg]=not nil
end

function SetStoppingRegions()
    local num=diff*2+2+random(5)
    print(num)
    for i=1,num do
        repeat
            reg="unnamed "..random(n_regions)
        until region_free[reg]
        region_free[reg]=nil
        print(reg)
        Trigger(REGION_ENTER_AND_STOP_TRIGGER,reg,"DarkWayPig")
        Trigger(REGION_ENTER_WITHOUT_STOP_TRIGGER,reg,nil)
    end
    for i=84,n_regions do
        local rnd=random(100)+1
        if rnd<3 then
            reg="unnamed "..i
            region_free[reg]=nil
            Trigger(REGION_ENTER_AND_STOP_TRIGGER,reg,"GhostTrouble")
            Trigger(REGION_ENTER_WITHOUT_STOP_TRIGGER,reg,nil)
        end
    end
end

function DarkWayTrouble(hero,region)
    local rnd=random(100)+1
    if rnd<15 then
        local r1,r2=random(battle_length)+1,random(5)+1
        GiveHeroBattleBonus(hero,battle_bonuses[r1],-r2)
    end
end

function GhostTrouble(hero,region)
    local rnd=random(100)+1
    reg=region
    if rnd<40 then
        temp=GetHeroStat(hero,STAT_MOVE_POINTS)
        ChangeHeroStat(hero,STAT_MOVE_POINTS,-temp)
        local side=GetObjectOwner(hero)
        ShowFlyingSign(path.."clons/mp_end.txt",hero,side,3)
        DarkWayBattleFinish(hero,nil)
    elseif rnd<70 then
        temp=GetHeroStat(hero,STAT_MANA_POINTS)
        ChangeHeroStat(hero,STAT_MANA_POINTS,-temp)
        local side=GetObjectOwner(hero)
        ShowFlyingSign(path.."clons/mana_end.txt",hero,side,3)
        DarkWayBattleFinish(hero,nil)
    else
        for k=1,7 do
            local r1,r2=random(3)+1,random(5)+11
            creature[k]=GetCreatureByData(4,3,r1)
            count[k]=GetDate(WEEK)*r2
        end
        StartCombat(hero,nil,7,creature[1],count[1],creature[2],count[2],creature[3],count[3],creature[4],count[4],creature[5],count[5],creature[6],count[6],creature[7],count[7],nil,"DarkWayBattleFinish",nil,nil)
    end
end

function DarkWayPig(hero,region)            
    local rnd=(random(100)+1)
    if rnd<95 then
        local creature={}
        local count={}
        for k=1,7 do
            local r1,r2=random(7)+1,random(3)+1
            creature[k]=GetCreatureByData(4,r1,r2)
            count[k]=(15-r1*2)*GetDate(WEEK)*r2
        end    
        reg=region
        StartCombat(hero,nil,7,creature[1],count[1],creature[2],count[2],creature[3],count[3],creature[4],count[4],creature[5],count[5],creature[6],count[6],creature[7],count[7],nil,"DarkWayBattleFinish",nil,nil)
    else
        reg=region
        call(hero,CUSTOM_ABILITY_2)
        DarkWayBattleFinish(hero,nil)
    end
end
 
function DarkWayBattleFinish(hero,isWin)
    region_free[reg]=not nil
    Trigger(REGION_ENTER_AND_STOP_TRIGGER ,reg,nil)
    Trigger(REGION_ENTER_WITHOUT_STOP_TRIGGER,reg,"DarkWayTrouble")
end
---------------------------------------------
--End Dark Way-------------------------------
---------------------------------------------
--Portals------------------------------------
---------------------------------------------
Portal={}
P_name={}
for i=1,5 do
    Portal[i]="portal"..i
    sleep(1)
    P_name[i]=path.."portals/"..Portal[i]..".txt"
    OverrideObjectTooltipNameAndDescription(Portal[i],P_name[i],"/Text/Game/Buildings/Monoliths/TwoWay-Description.txt")
    SetObjectEnabled(Portal[i],nil)
    Trigger(OBJECT_TOUCH_TRIGGER,Portal[i],"teleport_q")
end

function teleport_q(hero,object)
    local side=GetObjectOwner(hero)
    currenthero=hero
    if (IsAIPlayer(side)==0) then
        TalkBoxForPlayers(side, "/Textures/SpellBook______2618/Spells/Spell_Teleport.xdb#xpointer(/Texture)", path.."portals/"..object..".txt", path.."portals/dialog.txt", path.."portals/down_message.txt", "teleport", 1, path.."portals/"..object..".txt", path.."portals/up_message.txt", 0, P_name[1], P_name[2], P_name[3], P_name[4], P_name[5])
    else
        local n=1+random(5)
        teleport(side,n)
    end
end

function teleport(player,choice)
    if choice>0 then
        local x,y,f=GetObjectPosition(Portal[choice])
        SetObjectPosition(currenthero,x,y,f)
    end
end
---------------------------------------------
--End Portals--------------------------------
---------------------------------------------

function do_test()
    enemy_town[PLAYER_1]="p1town"
    enemy_town[PLAYER_2]="p2town"
    local x,y,f=GetObjectPosition("gift_col")
    OpenCircleFog(x,y,f,100,1)
    OpenCircleFog(x,y,f,100,2)
    local x,y,f=GetObjectPosition("portal5")
    OpenCircleFog(x,y,f,100,1)
    OpenCircleFog(x,y,f,100,2)
    
    for i=1,6 do
        print(i.." player testing")
        AddExp(i)
        AddResource(i)
        AddCreatures(i)
    end
    
    for temp=1,60 do
        for i=1,6 do
            if temp==52-diff*12+5*i then
                object="entrance2"..i
                player=floor((12-i)/2)
                SetObjectEnabled(object,not nil)
                if GetPlayerState(player)==PLAYER_ACTIVE then
                    SetAIPlayerAttractor(object,player,1)
                    local x,y,f=GetObjectPosition(object)
                    OpenCircleFog(x,y,f,5,player)
                end
            end
        end
    end
end


Добавлено через 11 минут
creature_table.lua--GetPlayerRace
--no neutrals
--version 1.0
--by ******
CreatureTable={}
CreatureTable[0]={
                            {CREATURE_PEASANT,CREATURE_MILITIAMAN,CREATURE_LAN DLORD},
                            {CREATURE_ARCHER,CREATURE_MARKSMAN,CREATURE_LONGBO WMAN},
                            {CREATURE_FOOTMAN,CREATURE_SWORDSMAN,CREATURE_VIND ICATOR},
                            {CREATURE_GRIFFIN,CREATURE_ROYAL_GRIFFIN,CREATURE_ BATTLE_GRIFFIN},
                            {CREATURE_PRIEST,CREATURE_CLERIC,CREATURE_ZEALOT},
                            {CREATURE_CAVALIER,CREATURE_PALADIN,CREATURE_CHAMP ION},
                            {CREATURE_ANGEL,CREATURE_ARCHANGEL,CREATURE_SERAPH }
}
CreatureTable[1]={
                              {CREATURE_PIXIE,CREATURE_SPRITE,CREATURE_DRYAD},
                              {CREATURE_BLADE_JUGGLER,CREATURE_WAR_DANCER,CREATU RE_BLADE_SINGER},
                              {CREATURE_WOOD_ELF,CREATURE_GRAND_ELF,CREATURE_SHA RP_SHOOTER},
                              {CREATURE_DRUID,CREATURE_DRUID_ELDER,CREATURE_HIGH _DRUID},
                              {CREATURE_UNICORN,CREATURE_WAR_UNICORN,CREATURE_WH ITE_UNICORN},
                              {CREATURE_TREANT,CREATURE_TREANT_GUARDIAN,CREATURE _ANGER_TREANT},
                              {CREATURE_GREEN_DRAGON,CREATURE_GOLD_DRAGON,CREATU RE_RAINBOW_DRAGON}
}
CreatureTable[2]={
                             {CREATURE_GREMLIN,CREATURE_MASTER_GREMLIN,CREATUR E_GREMLIN_SABOTEUR},
                             {CREATURE_STONE_GARGOYLE,CREATURE_OBSIDIAN_GARGOY LE,CREATURE_MARBLE_GARGOYLE},
                             {CREATURE_IRON_GOLEM,CREATURE_STEEL_GOLEM,CREATUR E_OBSIDIAN_GOLEM},
                             {CREATURE_MAGI,CREATURE_ARCH_MAGI,CREATURE_COMBAT _MAGE},
                             {CREATURE_GENIE,CREATURE_MASTER_GENIE,CREATURE_DJ INN_VIZIER},
                             {CREATURE_RAKSHASA,CREATURE_RAKSHASA_RUKH,CREATUR E_RAKSHASA_KSHATRI},
                             {CREATURE_GIANT,CREATURE_TITAN,CREATURE_STORM_LOR D}
}
CreatureTable[3]={
                             {CREATURE_SCOUT,CREATURE_ASSASSIN,CREATURE_STALKE R},
                             {CREATURE_WITCH,CREATURE_BLOOD_WITCH,CREATURE_BLO OD_WITCH_2},
                             {CREATURE_MINOTAUR,CREATURE_MINOTAUR_KING,CREATUR E_MINOTAUR_CAPTAIN},
                             {CREATURE_RIDER,CREATURE_RAVAGER,CREATURE_BLACK_R IDER},
                             {CREATURE_HYDRA,CREATURE_CHAOS_HYDRA,CREATURE_ACI DIC_HYDRA},
                             {CREATURE_MATRON,CREATURE_MATRIARCH,CREATURE_SHAD OW_MISTRESS},
                             {CREATURE_DEEP_DRAGON,CREATURE_BLACK_DRAGON,CREAT URE_RED_DRAGON}
}
CreatureTable[4]={
                                {CREATURE_SKELETON,CREATURE_SKELETON_ARCHER,CREATU RE_SKELETON_WARRIOR},
                                {CREATURE_WALKING_DEAD,CREATURE_ZOMBIE,CREATURE_DI SEASE_ZOMBIE},
                                {CREATURE_MANES,CREATURE_GHOST,CREATURE_POLTERGEIS T},
                                {CREATURE_VAMPIRE,CREATURE_VAMPIRE_LORD,CREATURE_N OSFERATU},
                                {CREATURE_LICH,CREATURE_DEMILICH,CREATURE_LICH_MAS TER},
                                {CREATURE_WIGHT,CREATURE_WRAITH,CREATURE_BANSHEE},
                                {CREATURE_BONE_DRAGON,CREATURE_SHADOW_DRAGON,CREAT URE_HORROR_DRAGON}
}
CreatureTable[5]={
                             {CREATURE_FAMILIAR,CREATURE_IMP,CREATURE_QUASIT},
                             {CREATURE_DEMON,CREATURE_HORNED_DEMON,CREATURE_HO RNED_LEAPER},
                             {CREATURE_HELL_HOUND,CREATURE_CERBERI,CREATURE_FI REBREATHER_HOUND},
                             {CREATURE_SUCCUBUS,CREATURE_INFERNAL_SUCCUBUS,CRE ATURE_SUCCUBUS_SEDUCER},
                             {CREATURE_NIGHTMARE,CREATURE_FRIGHTFUL_NIGHTMARE, CREATURE_HELLMARE},
                             {CREATURE_PIT_FIEND,CREATURE_BALOR,CREATURE_PIT_S PAWN},
                             {CREATURE_DEVIL,CREATURE_ARCHDEVIL,CREATURE_ARCH_ DEMON}
}
CreatureTable[6]={
                           {CREATURE_DEFENDER,CREATURE_STOUT_DEFENDER,CREATU RE_STONE_DEFENDER},
                           {CREATURE_AXE_FIGHTER,CREATURE_AXE_THROWER,CREATU RE_HARPOONER},
                           {CREATURE_BEAR_RIDER,CREATURE_BLACKBEAR_RIDER,CRE ATURE_WHITE_BEAR_RIDER},
                           {CREATURE_BROWLER,CREATURE_BERSERKER,CREATURE_BAT TLE_RAGER},
                           {CREATURE_RUNE_MAGE,CREATURE_FLAME_MAGE,CREATURE_ FLAME_KEEPER},
                           {CREATURE_THANE,CREATURE_WARLORD,CREATURE_THUNDER _THANE},
                           {CREATURE_FIRE_DRAGON,CREATURE_MAGMA_DRAGON,CREAT URE_LAVA_DRAGON}
}
CreatureTable[7]={
                                {CREATURE_GOBLIN,CREATURE_GOBLIN_TRAPPER,CREATURE_ GOBLIN_DEFILER},
                                {CREATURE_CENTAUR,CREATURE_CENTAUR_NOMAD,CREATURE_ CENTAUR_MARADEUR},
                                {CREATURE_ORC_WARRIOR,CREATURE_ORC_SLAYER,CREATURE _ORC_WARMONGER},
                                {CREATURE_SHAMAN,CREATURE_SHAMAN_WITCH,CREATURE_SH AMAN_HAG},
                                {CREATURE_ORCCHIEF_BUTCHER,CREATURE_ORCCHIEF_EXECU TIONER,CREATURE_ORCCHIEF_CHIEFTAIN},
                                {CREATURE_WYVERN,CREATURE_WYVERN_POISONOUS,CREATUR E_WYVERN_PAOKAI},
                                {CREATURE_CYCLOP,CREATURE_CYCLOP_UNTAMED,CREATURE_ CYCLOP_BLOODEYED}
}

function GetCreatureData(creature)
         for i=0,7 do
             for j=1,7 do
                 for k=1,3 do
                     if CreatureTable[i][j][k]==creature then
                        return i,j,k
                     end
                 end
             end
         end
end

function GetCreatureByData(race,level,update)
         if race~=nil then
            if level~=nil then
               if update~=nil then
                  return CreatureTable[race][level][update]
               else
                   return CreatureTable[race][level]
               end
            else
                return CreatureTable[race]
            end
         else
             return CreatureTable
         end
end

function GetCreatureRace(creature)
         local x1,x2,x3=GetCreatureData(creature)
         return x1
end

function GetCreatureLevel(creature)
         local x1,x2,x3=GetCreatureData(creature)
         return x2
end

function GetCreatureUpdate(creature)
         local x1,x2,x3=GetCreatureData(creature)
         return x3
end
itisdepp вне форума
Ответить с цитированием
#6
Старый 14.11.2020, 22:06
  #6
^
}{0TT@6bI4
 
Аватар для }{0TT@6bI4
📖
Регистрация: 05.09.2019
Адрес: Серебряные Города, Аль-Сафир
Сообщения: 1965
Выставка наград
Регистрация: 05.09.2019
Адрес: Серебряные Города, Аль-Сафир
Сообщения: 1965
Выставка наград
По умолчанию
Re: [ПРОБЛЕМА] Игра виснет при когда проигрывает союзник-ИИ

Я так понимаю, союзный игрок - PLAYER_2, и после его гибели цикл while работает вечно вхолостую... А это приводит как раз к той оишбке, что у вас! Хотя судя по скрипту, после этого игрок проигрывает...
__________________
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
}{0TT@6bI4 вне форума
Ответить с цитированием
#7
Старый 14.11.2020, 22:30
  #7
^
itisdepp
📖
Регистрация: 14.11.2020
Сообщения: 4
Регистрация: 14.11.2020
Сообщения: 4
По умолчанию
Re: [ПРОБЛЕМА] Игра виснет при когда проигрывает союзник-ИИ

Удалил этот блок из скрипта и всё заработало. Огромное спасибо!
itisdepp вне форума
Ответить с цитированием
#8
Старый 14.11.2020, 22:44
  #8
^
}{0TT@6bI4
 
Аватар для }{0TT@6bI4
📖
Регистрация: 05.09.2019
Адрес: Серебряные Города, Аль-Сафир
Сообщения: 1965
Выставка наград
Регистрация: 05.09.2019
Адрес: Серебряные Города, Аль-Сафир
Сообщения: 1965
Выставка наград
По умолчанию
Re: [ПРОБЛЕМА] Игра виснет при когда проигрывает союзник-ИИ

Вношу небольшую поправку: при потере союзника, по задумке, игрок проигрывает, так что рекомендую начать заново, аля всё отработало нормально)
__________________
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
С уважением, }{0TT@6bI4
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________
}{0TT@6bI4 вне форума
Ответить с цитированием
Ответ


Опции темы



Часовой пояс GMT +4, время: 15:33.


vBulletin v3.5.0, Copyright ©2000-2024, Jelsoft Enterprises Ltd. (Русский)

Яндекс цитирование    Top.Mail.Ru