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

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

Ответ
 
Just Fear
Loading --•••----
offline
Опыт: 2,062
Активность:
хм // выдаёт 256 ошибок
Вобщем вся соль, решил сделать коментарии к спелам которые делал до этого все работало. сделал, написал решил сохранить но тут вижу при сохранении компилятор выдаёт 256 ошибок причем совершенно отвартительные ( все ошибки он показывал были за -//-)
В карте 6-7 триггеров но покажу вам только 1 и если что расскажите мне как надо ставить -//- чтобы нечего не показывало
» 1 триг
function Trig_Instable_Arcana_Conditions takes nothing returns boolean
return GetUnitAbilityLevel(GetAttacker(), 'A003') > 0//this condition will see if attacker ability level of 'A002' is greater then 0 then whole trigger will work
endfunction

function Text takes string text, real size, real colorR, real colorG, real colorB, real alpha returns nothing 
//this func will create textags
local texttag t = CreateTextTagUnitBJ( text, GetTriggerUnit(), 100.00, size, colorR, colorG, colorB, alpha )
call SetTextTagPermanent(t,false)
call SetTextTagFadepoint(t , 2)
call SetTextTagLifespan(t , 4)
endfunction

function Trig_Instable_Arcana_Actions takes nothing returns nothing
//setting locals
local integer lvl = (5+(2*GetUnitAbilityLevel(GetAttacker(),'A003')))//this is chance to provoke dmg heal or stun
local unit atacker = GetAttacker()
local unit atacked = GetTriggerUnit()
local integer random = GetRandomInt(0,4)//this random is for see what it will provoke stun dmg or heal
local real randomr = GetRandomReal(50,250)//this is for stun
local integer randomi = GetRandomInt(50,250)//this is for heal and dmg
if GetRandomReal(0,100) < lvl then//condition
    call PolledWait2(0.3)// waiting for attack
    call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl"​, atacked, "chest"))//eyecandy
    call UnitRemoveAbility(atacker,'A003')//removing ability to prevent abusing it
    call SetPlayerAbilityAvailable(GetOwningPlayer(atacker),'A003',false)//remove it from "+" to prevent bugs
    if random < 1 then//if random is 0 then it will stun
        call Text(R2S(randomr/100) + "sec",(randomr /10), 0,0,100,0)//creating blue text tag with stun sec
        call CastStun((randomr/100), atacked, atacker)//stuning target
    else
        if random < 3 then//if random is less then it will dmg
            call UnitDamageTarget(atacker, atacked, randomr, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)//dmg target
            call SetUnitState(atacked,UNIT_STATE_MANA,(GetUnitState(atacked,UNIT_STATE_MANA)-randomr))//burning his mana
            call Text("-" + (I2S(randomi)) + "hp",I2R(randomi /10), 100,0,0,0)//creating red textag with dmg count
        else// if random is more or = 3 then it will heal
            call SetWidgetLife(atacker,GetUnitState(atacker,UNIT_STATE_LIFE)+randomr/2)//healing
            call Text("+" + (I2S(randomi/2)) + "hp",I2R(randomi /10), 35,100,0,0)//creating green textag with healing count
        endif
    endif
    call PolledWait2(2)//waiting cooldown
    //adding ability again
    call UnitAddAbility(atacker,'A003')
    call SetUnitAbilityLevel(atacker, 'A003', lvl)
    call SetPlayerAbilityAvailable(GetOwningPlayer(atacker),'A003',true)
    //nulling locals to prevent leaks
    set atacker = null
    set atacked = null
endif
endfunction
Just Fear добавил:
Вот нашел еще 1 триг сильно фаталит на 152 ошибки компиляции
» код
function FT takes nothing returns boolean
    return (GetUnitAbilityLevel(GetSpellTargetUnit(), 'B000') > 0) == true and IsUnitEnemy(GetTriggerUnit(), GetOwningPlayer(GetSpellTargetUnit())) == true// If target of Caster is enemy and he has Buff 'B000' then whole trigger will work
endfunction


function Trig_Magic_Defence_Actions takes nothing returns nothing
    local unit ST = GetSpellTargetUnit()// Setting the main unit
    local real x1 = GetUnitX(ST)//Get The X of main unit
    local real y1 = GetUnitY(ST)//Get The Y of main unit
    local real x2 = GetUnitX(GetTriggerUnit())// Get The X of caster
    local real y2 = GetUnitY(GetTriggerUnit())// Get The Y of caster
    local integer dmg = (GetHeroInt(ST) / 2)//This is damage of each orb. Now it is half of hero INT u can change it to his STR AGI or remaining mana and so on ( u can SET remaing mana by GetUnitState(ST,UNIT_STATE_MANA))
    local unit last
    local integer AL = GetUnitAbilityLevel(ST,'A004')// Change 'A004' to ur ability code (or if u copy past skill then no need of changing)
    local integer MSHi = AL * 2// u can set this local to GetRandomInt(0,AL*2) this will create random units between 0 and ur level of ability * 2
    local real F = bj_RADTODEG * Atan2((y2 - y1),( x1 - x2))// Get angle between caster and target (main unit)
    set x2 = (x1 + 300 * Cos(F * bj_DEGTORAD))// Setting new X (U can change Range of TP by changing 300 to random number or fixed number what ever u want)
    set y2 = (y1 + 300 * Sin(F * bj_DEGTORAD))// Setting new Y (U can change Range of TP by changing 300 to random number or fixed number what ever u want)
    if GetRandomReal(0,100) >= 10*AL then// Chance of provoke TP 10*Level%
        call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl", x1, y1))//creating some eye candy
        call SetUnitX( ST, x2)//Move ST to new X
        call SetUnitY( ST, y2)//Move ST to new Y
        call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl", x2 , y2))//creating some eye candy
    endif
    loop
        set MSHi = MSHi - 1
        exitwhen MSHi <= 0
        set last = CreateUnit(GetOwningPlayer(ST),'e001',x2,y2,((F - 180) - GetRandomReal(-10,10)))// creating unit and setting his facing to random number
        call SetUnitPathing(last,false)// seting his pathing to null
        call SetUnitState(last, UNIT_STATE_MANA, dmg)// Mana of this unit will be his damage
        call UnitApplyTimedLife(last,'BTLF', 3)// change last number to inscrize control time or set it to ~ 0.5 sec to remove it
        call AddSpecialEffectTarget("Abilities\\Weapons\\SpiritOfVengeanceMissile\\SpiritOfVengeanceMissile.​mdl", last, "origin")// adding special effect to dummy
        call GroupAddUnit(udg_UG, last)// add last created unit to move unit group
    endloop
    set last = null// nulling locals to prevent leaks
    set ST = null//nulling locals to prevent leaks
endfunction

//===========================================================================
function InitTrig_Magic_Defence takes nothing returns nothing
local trigger gg_trg_Magic_Defence = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Magic_Defence, EVENT_PLAYER_UNIT_SPELL_CHANNEL )
    call TriggerAddCondition( gg_trg_Magic_Defence, Condition( function FT ) )
    call TriggerAddAction( gg_trg_Magic_Defence, function Trig_Magic_Defence_Actions )
    set gg_trg_Magic_Defence = null
endfunction
Старый 24.05.2010, 13:24
Rewenger
The culprit will not die
offline
Опыт: 35,873
Активность:
У меня такое было... как-то давно, на версии где-то 1.14 или 1.16... Решилось переустановкой вара.
Rewenger добавил:
Переустановкой на вар более новой версии и из другого источника.
Старый 24.05.2010, 14:27
ScorpioT1000
Работаем
offline
Опыт: отключен
что за компилятор ? обычный we ? ну там ничто не исключено)
Старый 24.05.2010, 14:27
Rewenger
The culprit will not die
offline
Опыт: 35,873
Активность:
обычный we
Кстати да, ошибка возникала в обычном we. Но все уже давно перешли на jngp.
Старый 24.05.2010, 14:34
Just Fear
Loading --•••----
offline
Опыт: 2,062
Активность:
ScorpioT1001, омг все я уже решил в коде забыл указать 1 дополнительный болеан (true) из за этого вышла такая байда. JNPG у меня :D
Старый 24.05.2010, 14:39
ScorpioT1000
Работаем
offline
Опыт: отключен
нет там всё нормально было, а теперь лишние операции
Старый 24.05.2010, 15:16
Ответ

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

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

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

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



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