• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Dawn and Dusk Broken, what gives?

Status
Not open for further replies.
Level 13
Joined
May 11, 2008
Messages
1,198
I don't understand what's going on here.

I changed the dawn and dusk to be 0 and 12 but they're still stuck on 6 and 18. some triggers i was working on are just a whole heck of a lot simpler if dawn and dusk are 0 and 12 rather than 6 and 18 and they work great, but the problem is that the game's clock still runs normally...even though the triggers are registering the proper times 0 and 12 and whatever...i guess if i were to ask them to register dawn and dusk they would register 6 and 18...right? i haven't checked but i'd imagine that's the case. anyway...what do i need to do to fix dawn and dusk to where i want it to? I mean i already changed it in gameplay constants, where else would i need to change it at?
 
Level 13
Joined
May 11, 2008
Messages
1,198
because there are a lot of problems with some triggers i was making for abilities that had to detect night and day. then i turned them over to another guy for just general refining after i had thought i had it all figured out with the bugs cleared out of the problems with the triggers and all of a sudden i am finding that at midnight my ability triggers think it's day time! it's such a big hassle because it's doing that because an ability is going off because the time is becoming less than 18, but adding a condition to check for the time is equal to or greater than 6 won't work! i don't understand why...and it's way too much of a hassle anymore, so i wanted to just simply change the dawn to 0 and the dusk to 12 to make these triggers much much easier. see there was dota hero that did like this for night abilities, but doing it for day time and night time is rather hard...anyway the day time thing can get more than a little glitchy if you don't set the events/conditions JUST right, and it has to be a lot different from the night ones... it's really a pain....but anyway i always thought you could change the time of dawn and dusk in the gameplay constants because that information is there for you to edit...but after i finally decide i will go ahead and edit that, it does NOTHING!!

maybe it's simply that i forgot that editing it does nothing but subconsciously i knew and that was why i was refusing to edit it, well i did edit it and it does indeed do nothing.
 
Level 13
Joined
May 11, 2008
Messages
1,198
ok, well, i guess i've decided to go ahead and screw this whole idea since it doesn't seem possible...instead what i'm doing is...

making my own custom day and night system.

meh...i guess i want people to tell the difference between night and day...so...i was hoping maybe i could adjust the night time settings to be displayable during the daytime...i'm not sure i fully understand that tutorial about changing the day and night models....seems like it is VERY insufficient tutorial. doesn't even explain how to properly change the colors :/

anyway...i can change the weather around using the unleash your weather tutorial's tips...i kindof had to figure out on my own how to actually implement weather in a map via triggers though.

so i tested it and it seems to work out ok...

so you can see i decided to make night and day discernable by what sort of weather is going on at the time. ultimately though i'll want to figure out how to adjust the day and night models better, but for now i just can't do it. maybe if the guy improved his tutorial...i guess i should post a comment in that thread. anyway...what do you think of what i got so far? here it is.

JASS:
function Trig_initialweatherday_Actions takes nothing returns nothing
    call SetTimeOfDay( 7.00 )
    set udg_daywe = AddWeatherEffect(bj_mapInitialPlayableArea, 'LRaa' )
    call EnableWeatherEffect(udg_daywe, true)
endfunction

//===========================================================================
function InitTrig_initialweatherday takes nothing returns nothing
    set gg_trg_initialweatherday = CreateTrigger(  )
    call TriggerAddAction( gg_trg_initialweatherday, function Trig_initialweatherday_Actions )
endfunction



function Trig_clockadjustment_Actions takes nothing returns nothing
    call SetTimeOfDay( 7.00 )
endfunction

//===========================================================================
function InitTrig_clockadjustment takes nothing returns nothing
    set gg_trg_clockadjustment = CreateTrigger(  )
    call TriggerRegisterGameStateEventTimeOfDay( gg_trg_clockadjustment, GREATER_THAN_OR_EQUAL, 17.00 )
    call TriggerAddAction( gg_trg_clockadjustment, function Trig_clockadjustment_Actions )
endfunction



function Trig_timefornight_Actions takes nothing returns nothing
call EnableWeatherEffect(udg_daywe, false)
set udg_daywe = null
call RemoveWeatherEffect(udg_daywe)
set udg_nightwe = AddWeatherEffect(bj_mapInitialPlayableArea, 'LRma' )
call EnableWeatherEffect(udg_nightwe, true)
endfunction

//===========================================================================
function InitTrig_timefornight takes nothing returns nothing
    set gg_trg_timefornight = CreateTrigger(  )
    call TriggerRegisterGameStateEventTimeOfDay( gg_trg_timefornight, GREATER_THAN_OR_EQUAL, 12.00 )
    call TriggerAddAction( gg_trg_timefornight, function Trig_timefornight_Actions )
endfunction



function Trig_timeforday_Actions takes nothing returns nothing
call EnableWeatherEffect(udg_nightwe, false)
set udg_nightwe = null
call RemoveWeatherEffect(udg_nightwe)
set udg_daywe = AddWeatherEffect(bj_mapInitialPlayableArea, 'LRaa' )
call EnableWeatherEffect(udg_daywe, true)
endfunction

//===========================================================================
function InitTrig_timeforday takes nothing returns nothing
    set gg_trg_timeforday = CreateTrigger(  )
    call TriggerRegisterGameStateEventTimeOfDay( gg_trg_timeforday, LESS_THAN, 12.00 )
    call TriggerAddAction( gg_trg_timeforday, function Trig_timeforday_Actions )
endfunction

in response to the above post, detecting night is much simpler than detecting day and anyway if you want to share your triggers feel free but i doubt what you're coming up with is (if it's as good) as complicated as my stuff is.

as your ability description that you gave implies, it only checks for the sake of your night time ability. i have many night time abilities of various types and DAY TIME abilities to match.

back to what i came up with though...i guess i'm just curious if you know how to squish that all into like one trigger. if not, that's cool, it doesn't matter that much i guess.
 
Level 13
Joined
May 11, 2008
Messages
1,198
well i don't think you understand just how complex it is...but...yeah man it wouldn't hurt to let you have a look at it. i can't show you what i had before since i didn't make a backup but i'll show you what i have up now. oh yeah i can show you random notes of what i had up before.

ok here's the triggers that i have now.


JASS:
scope slowandfast initializer I

private function A takes nothing returns nothing
    local real ux = GetUnitX(GetSpellAbilityUnit())
    local real uy = GetUnitY(GetSpellAbilityUnit())
    local unit u = null

    if GetSpellAbilityId() == 'A00M' then
    if GetTimeOfDay() < 12.00 then
    set u = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'e000', ux, uy, 270.00)
    call UnitAddAbility(u, 'A00Z')
    call SetUnitAbilityLevel(u, 'A00Z', GetUnitAbilityLevel(GetSpellAbilityUnit(),'A00M'))
    call UnitApplyTimedLife(u, 'BTLF', 5.0)
    endif
    else
    if GetSpellAbilityId() == 'A00K' then
    if GetTimeOfDay() >= 12.00 then
    set u = CreateUnit(GetOwningPlayer(GetSpellAbilityUnit()), 'e000', ux, uy, 270.00)
    call UnitAddAbility(u, 'A00Y')
    call SetUnitAbilityLevel(u, 'A00Y', GetUnitAbilityLevel(GetSpellAbilityUnit(),'A00K'))
    call UnitApplyTimedLife(u, 'BTLF', 5.0)
    endif
    endif
    endif
    set u = null
endfunction

//===========================================================================
private function I takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddAction( t, function A )
endfunction

endscope


scope Day initializer I

private function agilnfilter takes nothing returns boolean
    return ( GetUnitAbilityLevel(GetFilterUnit(),'A00E') > 0 )
endfunction

private function agilnact takes nothing returns nothing
    call UnitRemoveAbility(GetEnumUnit(), 'A002' )
    call UnitAddAbility(GetEnumUnit(), 'A005' )
    call SetUnitAbilityLevel(GetEnumUnit(), 'A005', GetUnitAbilityLevel(GetEnumUnit(),'A00E') )
    call UnitRemoveAbility(GetEnumUnit(), 'A00I' )
endfunction

private function nsfilter takes nothing returns boolean
    return ( GetUnitAbilityLevel(GetFilterUnit(),'A00B') > 0 )
endfunction

private function nsact takes nothing returns nothing
    call UnitRemoveAbility(GetEnumUnit(), 'A008' )
    call UnitAddAbility(GetEnumUnit(), 'A007' )
    call SetUnitAbilityLevel(GetEnumUnit(), 'A007', GetUnitAbilityLevel(GetEnumUnit(),'A00B') )
endfunction

private function dsfilter takes nothing returns boolean
    return ( GetUnitAbilityLevel(GetFilterUnit(),'A00F') > 0 )
endfunction

private function dsact takes nothing returns nothing
    call UnitRemoveAbility(GetEnumUnit(), 'A009' )
    call UnitAddAbility(GetEnumUnit(), 'A00A' )
    call SetUnitAbilityLevel(GetEnumUnit(), 'A00A', GetUnitAbilityLevel(GetEnumUnit(),'A00F') )
endfunction

private function agildfilter takes nothing returns boolean
    return ( GetUnitAbilityLevel(GetFilterUnit(),'A00D') > 0 )
endfunction

private function agildact takes nothing returns nothing
    call UnitRemoveAbility(GetEnumUnit(), 'A006' )
    call UnitAddAbility(GetEnumUnit(), 'A004' )
    call SetUnitAbilityLevel(GetEnumUnit(), 'A004', GetUnitAbilityLevel(GetEnumUnit(),'A00D') )
    call UnitAddAbility(GetEnumUnit(), 'A00I' )
    call SetUnitAbilityLevel(GetEnumUnit(), 'A00I', GetUnitAbilityLevel(GetEnumUnit(),'A00D') )
endfunction

private function dmfilter takes nothing returns boolean
    return ( GetUnitAbilityLevel(GetFilterUnit(),'A00P') > 0 )
endfunction

private function dmact takes nothing returns nothing
    call UnitRemoveAbility(GetEnumUnit(), 'A00O' )
    call UnitAddAbility(GetEnumUnit(), 'A00N' )
    call SetUnitAbilityLevel(GetEnumUnit(), 'A00N', GetUnitAbilityLevel(GetEnumUnit(),'A00P') )
endfunction

private function defilter takes nothing returns boolean
    return ( GetUnitAbilityLevel(GetFilterUnit(),'A00Q') > 0 )
endfunction

private function deact takes nothing returns nothing
    call UnitRemoveAbility(GetEnumUnit(), 'A00S' )
    call UnitAddAbility(GetEnumUnit(), 'A00O' )
    call SetUnitAbilityLevel(GetEnumUnit(), 'A00O', GetUnitAbilityLevel(GetEnumUnit(),'A00Q') )
endfunction

private function A takes nothing returns nothing
    local group g = CreateGroup()
    local unit PickedUnit = null
    
    call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea,Condition(function agilnfilter))
    call ForGroup(g, function agilnact )
    //! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
    call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea,Condition(function agildfilter))
    call ForGroup(g, function agildact)
    //! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
    call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea,Condition(function nsfilter))
    call ForGroup(g, function nsact )
    //! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
    call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea,Condition(function dsfilter))
    call ForGroup(g, function dsact )
    //! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
    call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea,Condition(function dmfilter))
    call ForGroup(g, function dmact )
    //! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
    call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea,Condition(function defilter))
    call ForGroup(g, function deact )
    //! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
    set g = null
endfunction

//===========================================================================
private function I takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    call TriggerRegisterGameStateEventTimeOfDay( t, LESS_THAN, 12.00 )
    call TriggerAddAction( t, function A )
endfunction

endscope


scope Day2 initializer I

private function A takes nothing returns nothing
    local unit u = GetTriggerUnit()
    if GetLearnedSkill() == 'A00B' then
    if GetTimeOfDay() >= 12.00 then
    call UnitRemoveAbility(u, 'A007')
    call UnitAddAbility(u, 'A008')
    call SetUnitAbilityLevel(u, 'A008', GetUnitAbilityLevel(u,'A00B') )
    else
    call UnitRemoveAbility(u, 'A008')
    call UnitAddAbility(u, 'A007')
    call SetUnitAbilityLevel( u, 'A007', GetUnitAbilityLevel(u,'A00B') )
    call SetUnitAbilityLevel( u, 'A007', GetUnitAbilityLevel(u,'A00B') )
    endif
    else
    if GetLearnedSkill() == 'A00E' then
    if GetTimeOfDay() >= 12.00 then
    call UnitRemoveAbility(u, 'A005')
    call UnitAddAbility(u, 'A002')
    call SetUnitAbilityLevel( u,'A002',  GetUnitAbilityLevel(u,'A00E') )
    call UnitAddAbility(u, 'A00I')
    call SetUnitAbilityLevel( u,'A00I',  GetUnitAbilityLevel(u,'A00E') )
    else
    call UnitRemoveAbility(u, 'A00I')
    call UnitRemoveAbility(u, 'A002')
    call UnitAddAbility(u, 'A005')
    call SetUnitAbilityLevel(u, 'A005', GetUnitAbilityLevel(u,'A00E') )
    endif
    else
    if GetLearnedSkill() == 'A00Q' then
    if GetTimeOfDay() >= 12.00 then
    call UnitRemoveAbility(u, 'A00O')
    call UnitAddAbility(u, 'A00S')
    call SetUnitAbilityLevel(u, 'A00S', GetUnitAbilityLevel(u,'A00Q') )
    else
    call UnitRemoveAbility(u, 'A00S')
    call UnitAddAbility(u, 'A00O')
    call SetUnitAbilityLevel(u, 'A00O', GetUnitAbilityLevel(u,'A00Q') )
    endif
    else
    if GetLearnedSkill() == 'A00F' then
    if GetTimeOfDay() < 12.00 then
    call UnitRemoveAbility(u, 'A009')
    call UnitAddAbility(u, 'A00A')
    call SetUnitAbilityLevel(u, 'A00A', GetUnitAbilityLevel(u,'A00F') )
    else
    call UnitRemoveAbility(u, 'A00A')
    call UnitAddAbility(u, 'A009')
    call SetUnitAbilityLevel( u, 'A009', GetUnitAbilityLevel(u,'A00F') )
    endif
    else
    if GetLearnedSkill() == 'A00D' then
    if GetTimeOfDay() < 12.00 then
    call UnitRemoveAbility(u, 'A006')
    call UnitAddAbility(u, 'A004')
    call SetUnitAbilityLevel( u,'A004',  GetUnitAbilityLevel(u,'A00D') )
    call UnitAddAbility(u, 'A00I')
    call SetUnitAbilityLevel( u,'A00I',  GetUnitAbilityLevel(u,'A00D') )
    else
    call UnitRemoveAbility(u, 'A00I')
    call UnitRemoveAbility(u, 'A004')
    call UnitAddAbility(u, 'A006')
    call SetUnitAbilityLevel(u, 'A006', GetUnitAbilityLevel(u,'A00D') )
    endif
    else
    if GetLearnedSkill() == 'A00P' then
    if GetTimeOfDay() < 12.00 then
    call UnitRemoveAbility(u, 'A00O')
    call UnitAddAbility(u, 'A00N')
    call SetUnitAbilityLevel(u, 'A00N', GetUnitAbilityLevel(u,'A00P') )
    else
    call UnitRemoveAbility(u, 'A00N')
    call UnitAddAbility(u, 'A00O')
    call SetUnitAbilityLevel(u, 'A00O', GetUnitAbilityLevel(u,'A00P') )
    endif
    else
    if GetLearnedSkill() == 'A011' then
    call UnitAddAbility(u, 'A010')
    call SetUnitAbilityLevel(u, 'A010', GetUnitAbilityLevel(u,'A011') )
    endif
    if GetLearnedSkill() == 'A01H' then
    call SetUnitAbilityLevel(u, 'A01I', (GetUnitAbilityLevel(u,'A01H')+1) )
    endif
    endif
    endif
    endif
    endif
    endif
    endif
    set u = null
endfunction

//===========================================================================
private function I takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_HERO_SKILL )
    call TriggerAddAction( t, function A )
endfunction

endscope


//this next one is a testing trigger, it's sweet!
Speed
    Events
        Player - Player 3 (Teal) types a chat message containing -speed  as A substring
    Conditions
        (Substring((Entered chat string), 1, 7)) Equal to (==) -speed 
    Actions
        Game - Set time of day speed to (Real((Integer((Substring((Entered chat string), 8, (Length of (Entered chat string))))))))% of the default speed


//this next one has some textmacro which i don't really understand, another map maker made that stuff up for me
scope Night initializer I
//! textmacro RemoveUnitsFromGroup takes UNIT, GROUP
    loop
        set $UNIT$ = FirstOfGroup($GROUP$)
        exitwhen $UNIT$ == null
        call GroupRemoveUnit($GROUP$, PickedUnit)
    endloop
//! endtextmacro


private function agilnfilter takes nothing returns boolean
    return ( GetUnitAbilityLevel( GetFilterUnit(), 'A00E') > 0 )
endfunction

private function agilnact takes nothing returns nothing
    call UnitRemoveAbility(GetEnumUnit(), 'A005')
    call UnitAddAbility(GetEnumUnit(), 'A002')
    call SetUnitAbilityLevel(GetEnumUnit(), 'A002', GetUnitAbilityLevel(GetEnumUnit(),'A00E') )
    call UnitAddAbility(GetEnumUnit(), 'A00I')
    call SetUnitAbilityLevel(GetEnumUnit(), 'A00I', GetUnitAbilityLevel(GetEnumUnit(),'A00E') )
endfunction

private function nsfilter takes nothing returns boolean
    return ( GetUnitAbilityLevel(GetFilterUnit(),'A00B') > 0 )
endfunction

private function nsact takes nothing returns nothing
    call UnitRemoveAbility(GetEnumUnit(), 'A007' )
    call UnitAddAbility(GetEnumUnit(), 'A008' )
    call SetUnitAbilityLevel(GetEnumUnit(), 'A008', GetUnitAbilityLevel(GetEnumUnit(),'A00B') )
endfunction

private function agildfilter takes nothing returns boolean
    return ( GetUnitAbilityLevel(GetFilterUnit(),'A00D') > 0 )
endfunction

private function agildact takes nothing returns nothing
    call UnitRemoveAbility(GetEnumUnit(), 'A004' )
    call UnitAddAbility(GetEnumUnit(), 'A006' )
    call SetUnitAbilityLevel(GetEnumUnit(), 'A006', GetUnitAbilityLevel(GetEnumUnit(),'A00D') )
    call UnitRemoveAbility(GetEnumUnit(), 'A00I' )
endfunction

private function dsfilter takes nothing returns boolean
    return ( GetUnitAbilityLevel(GetFilterUnit(),'A00F') > 0 )
endfunction

private function dsact takes nothing returns nothing
    call UnitRemoveAbility(GetEnumUnit(), 'A00A' )
    call UnitAddAbility(GetEnumUnit(), 'A009' )
    call SetUnitAbilityLevel(GetEnumUnit(), 'A009', GetUnitAbilityLevel(GetEnumUnit(),'A00F') )
endfunction

private function dmfilter takes nothing returns boolean
    return ( GetUnitAbilityLevel(GetFilterUnit(),'A00P') > 0 )
endfunction

private function dmact takes nothing returns nothing
    call UnitRemoveAbility(GetEnumUnit(), 'A00N' )
    call UnitAddAbility(GetEnumUnit(), 'A00O' )
    call SetUnitAbilityLevel(GetEnumUnit(), 'A00O', GetUnitAbilityLevel(GetEnumUnit(),'A00P') )
endfunction

private function defilter takes nothing returns boolean
    return ( GetUnitAbilityLevel(GetFilterUnit(),'A00Q') > 0 )
endfunction

private function deact takes nothing returns nothing
    call UnitRemoveAbility(GetEnumUnit(), 'A00O' )
    call UnitAddAbility(GetEnumUnit(), 'A00S' )
    call SetUnitAbilityLevel(GetEnumUnit(), 'A00S', GetUnitAbilityLevel(GetEnumUnit(),'A00Q') )
endfunction

private function A takes nothing returns nothing
    local group g = CreateGroup()
    local unit PickedUnit = null
    
    call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea,Condition(function agilnfilter))
    call ForGroup(g, function agilnact )
    //! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
    call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea,Condition(function agildfilter))
    call ForGroup(g, function agildact)
    //! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
    call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea,Condition(function nsfilter))
    call ForGroup(g, function nsact )
    //! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
    call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea,Condition(function dsfilter))
    call ForGroup(g, function dsact )
    //! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
    call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea,Condition(function dmfilter))
    call ForGroup(g, function dmact )
    //! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
    call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea,Condition(function defilter))
    call ForGroup(g, function deact )
    //! runtextmacro RemoveUnitsFromGroup("PickedUnit", "g")
    set g = null
endfunction

//===========================================================================
private function I takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    call TriggerRegisterGameStateEventTimeOfDay( t, GREATER_THAN_OR_EQUAL, 12.00 )
    call TriggerAddAction( t, function A )
endfunction

endscope


function Trig_strike_Actions takes nothing returns nothing
    if UnitHasBuffBJ(GetAttacker(), 'B000') then
        call UnitDamageTargetBJ( GetAttacker(), GetAttackedUnitBJ(), ( ( GetUnitMoveSpeed(GetAttacker()) - GetUnitMoveSpeed(GetAttackedUnitBJ()) ) * I2R(GetUnitAbilityLevel(GetAttacker(),'A00B')) ), ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL )
    else
    if UnitHasBuffBJ(GetAttacker(), 'B001') then
        call UnitDamageTargetBJ( GetAttacker(), GetAttackedUnitBJ(), ( ( GetUnitMoveSpeed(GetAttacker()) - GetUnitMoveSpeed(GetAttackedUnitBJ()) ) * I2R(GetUnitAbilityLevel(GetAttacker(),'A00F')) ), ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL )
    endif
    endif
endfunction

//===========================================================================
function InitTrig_strike takes nothing returns nothing
    set gg_trg_strike = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_strike, EVENT_PLAYER_UNIT_ATTACKED )
    call TriggerAddAction( gg_trg_strike, function Trig_strike_Actions )
endfunction

also, just so you know, although one says day2 it combined day2 and night2 so maybe i oughta rename it....
and here's the zip file of random notes on what i had before:
oh one final note though...there is a testing trigger in there i recommend you use. you might find a bug in your triggers if you use it, the speed trigger. battleshipper made that trigger. very useful.
 

Attachments

  • wc3notes.zip
    2.9 KB · Views: 32
Last edited:
Level 13
Joined
May 11, 2008
Messages
1,198
well, like i said, that one trigger in there isn't jass...you should probably use it to confirm that your map isn't doing something like what mine was...when battletrigger first gave me the tip on how to do day and night abilities the moonstone when used would mess things up so i had to add extra conditions/events to keep that from bugging.

later on i realized that if i were to learn a spell at a certain time of day the abilities would bug out then also. so i also had to fix that. at any rate my system was working pretty good except for the part where it would lag quite a bit because it would run so many functions whenever night came for the first time. well i mean like a second maybe of processes, but obviously the code could be optimized much better.

so my msn contact was helping me out with that and even a lot of the converted gui he hated and wouldn't help me with it until i made it better, more jassy, you might say. at any rate he definitely did help keep the lag out but afterward i noticed a bug, and i'm not sure if he made it come about, or if i myself screwed up while applying his method of picking units and so on...or if it was just there all along and i hadn't noticed for whatever reason. that's why i decided, you know what? it's too complicated. i'm going to change day to 0 and night to 12. but for some inexplicable reason that seems to be impossible, lol. so now i'm doing the next best thing...making my own day and night system. it's just going to be a pain in the rear trying to change the day and night models for when night comes along because although there was a tutorial on it it didn't explain the process suffienctly. in the meantime i am going to be using different weather patterns to simulate day and night. it's crap, but it's better than nothing. pretty soon though i'll probably add the dog and chicken howling sounds once i get around to figuring out where those sounds are in the sound editor. haven't really hit F5 lately...

anyway the sort of thing my system was changing would be like the evasion skills for 2 heroes, one day version and a night version, and the non-attuned time would yield a version that was weaker than the attuned time version. so it wasn't just an enable and disable system. further there was also an ultimate which was simpler and was enable and disable, and then even another spell which had a slow effect for night for the one hero and a speed effect for day for the other hero. then finally i had a non-attuned version of dispel magic for both heros, and a night and a day version of an attuned version of dispel magic...i think one maybe the day one drained mana and the night one stunned (like purge)...something like that. of course that's all open to editing in the future but i just wanted to get the concept down at least. oh yeah on top of all that the evasion skills also gave the heroes skills that made them move and attack faster at their preferred time of day. oh also on top of the ultimate ability it was set to do a special backstab damage ammount according to movespeed which as it might sound, is pretty wild. now that i mention it, i left that trigger out on accident. better put it in there.

so that should give you a rough idea of what all that jass does.

mostly it's just changing abilities around a lot.

but yeah even now i'm getting better and better at using jass like before when i was trying to figure out what functions did i would only look them up in the function lookup in the editor but now i copy them straight onto the triggers and i can actually seem them since they're soooooo big i can't read them properly in the function lookup box plus the colors are lame in the box so they look much better in the trigger.

but yeah jass will be much easier to read if you use JNGP and then edit the tesh options. in fact now when i see tutorials or systems online most of the time i still can't read it, i have to put the whole thing in my editor so i can read it.
 
Last edited:
Level 13
Joined
May 11, 2008
Messages
1,198
really? wow i got much farther than you did, lol.

i'm sure if you let me look at your code i could improve it, but yeah i guess i wouldn't be able to make it perfect and non-laggy anyway so it probably isn't worth it.

anyway right now the main thing i'm working on is i finally am able to change the day and night models at the time i want to but i get a short bit of lag when i do that.

i get the feeling like i might be doing something totally wrong, but i'm not sure, the dayandnight model changing tutorial was so bad, it didn't really explain anything.

i'm going to go check if anyone responded to my post about it yet.
 
Level 13
Joined
May 11, 2008
Messages
1,198
i did some research, and this is what i was able to come up with.

bj_TOD_DAWN
bj_TOD_DUSK
both are global constants that are automatically configured with all warcraft maps.
so since they are global constants they are unchangeable. this would seem to be why i can't change the dusk and dawn times even though it's displayed in game constants as an editable option.
quoting blizzard.j:
// Ideally these would be looked up from Units/MiscData.txt,
// but there is currently no script functionality exposed to do that
constant real bj_TOD_DAWN = 6.00
constant real bj_TOD_DUSK = 18.00

if anyone knows how to possibly add script functionality to do that with vjass or whatever, please let me know!

honestly i'm not sure why they didn't make them bj_MELEE_TOD_DAWN and bj_MELEE_TOD_DUSK ...
maybe they just forgot about it but that's a pretty lame excuse when you can see an option for it in gameplay constants which does nothing.
 
i did some research, and this is what i was able to come up with.

bj_TOD_DAWN
bj_TOD_DUSK
both are global constants that are automatically configured with all warcraft maps.
so since they are global constants they are unchangeable. this would seem to be why i can't change the dusk and dawn times even though it's displayed in game constants as an editable option.
quoting blizzard.j:
// Ideally these would be looked up from Units/MiscData.txt,
// but there is currently no script functionality exposed to do that
constant real bj_TOD_DAWN = 6.00
constant real bj_TOD_DUSK = 18.00

if anyone knows how to possibly add script functionality to do that with vjass or whatever, please let me know!

honestly i'm not sure why they didn't make them bj_MELEE_TOD_DAWN and bj_MELEE_TOD_DUSK ...
maybe they just forgot about it but that's a pretty lame excuse when you can see an option for it in gameplay constants which does nothing.

Doesnt
constant real bj_TOD_DAWN = 6.00
constant real bj_TOD_DUSK = 18.00
change when you change it under "gameplay constants"?
 
Level 13
Joined
May 11, 2008
Messages
1,198
nah, it doesn't.
i already said that.

anyway...i solved the problem of not having a day and night by using time from 13-23.

when i hit 18 it automatically goes to night like normal. when going to day it'll go to day but won't go to dawn. i don't care much about that anyway as long as it automatically goes to day, that's fine by me. i changed the dawn and dusk sounds...and so the dusk sound is dreadlord and dawn sound is uther. dawn sound isn't automatic i just made a trigger that both puts the clock at 13 when it hits 23 and it makes the dawn sound go off.

now for my triggers i only need to check for the time less or greater than 18 rather than 12... i could probably change it from 13-23 to 1-11 if i wanted to but whatever. that would mean i'd use the 6 time for the triggers. anyway it's a lot better to have the time change at beginning and middle than a fourth of the way through and then three fourths of the way through...much simpler and less bugs to deal with.

anyway i guess a bj_ALLCAPS constant variable like that CANNOT be changed. i guess that kindof constant is different from the gameplay constants, and someone accidently didn't make those variables changeable... maybe that person was confused about gameplay constants being called constants and in jass there are constants which cannot be changed...beats me.

seems a little funny that i can change the sound at dawn or dusk and the time of dusk or dawn i can't change.
 
Status
Not open for further replies.
Top