• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Custom Script or Skilled Trigger-er Needed!

Status
Not open for further replies.
Level 6
Joined
Apr 12, 2009
Messages
156
I've scoured the forums looking for FAQ on lighting and custom lighting pertaining to particular players or for particular areas (which ultimately can be the same thing). My findings have been successful to a point.

My task in my map as of now is to create a lighting effect triggered by this custom script: call SetDayNightModels("","") and trigger that effect for any player who moves their hero/units into a particular area; in context of my map, a crypt. Transversely, when the hero/units leave(s) this crypt, the game lighting would restore to it's normal preference.

It would appear that to do this fancy bit 'O' trigger-crafting, I would have to create a custom script of some sort. Sadly, I am incompetent in this field of admirable expertise, which leads me to this wonderful request forum.

Anyone who could provide such a solution in trigger form similar or exactly pertaining to my proposed concept and design would find rep bequeathed upon them like a celestial shower-time and a cozy nesting spot for that user's name would be promptly constructed in the map's credits.

Thank you.
 
Level 7
Joined
May 3, 2007
Messages
210
JASS:
function Trig_Do_Actions takes something returns nothing
    local unit u = GetTriggerUnit()
    local real r = 24
    if GetLocalPlayer() == GetOwningPlayer(u) then
        //call SetDayNightModels( , )
        call SetTimeOfDay( r )
        call SuspendTimeOfDay(true)
    endif
endfunction

//===========================================================================
function InitTrig_Stuff takes nothing returns nothing
    set gg_trg_Stuff = CreateTrigger(  )
    call TriggerRegisterEnterRegion( gg_trg_Stuff, LOLOLNEEDAREGION, null)
    call TriggerAddAction( gg_trg_Stuff, function Trig_Tifas_Do_Actions )
endfunction

That might be what you want idk, you're not gonna be able to interpret it without some knowledge of JASS anyway... LOLOLNEEDAREGION needs to be replaced with a global region, and I have no idea what your call SetDayNightModels() even does. . . Takes 2 strings, one of which is a terrain file (?) and the other a unit file (?). No clue.

Trigger prolly desyncs anyway, so I don't recommend using it.
 
Level 6
Joined
Apr 12, 2009
Messages
156
Well the attempt absolutely deserves some credit. Whether it works or not is a different story. Regardless, +rep

You're absolutely right in saying it's impossible for me to interpret this. But just to clarify: this script affects any player-unit individually (with the command I included) who enters a specific region, and then negates the command when the unit leaves that region?

Knowing what call SetDayNightModels("","") does in-game is certainly vital information for designing this script:

Crypt.jpg


Perhaps what I propose is impossible?
 
Level 8
Joined
Mar 18, 2005
Messages
168
Im quite sure it is impossible I'm afraid, else you would see it much more frequently used.
Too bad I'd be happier if I was wrong and you really can set a specific area to night and another to day.

It's easy to change day/night but impossible to effect just one player so far as I've seen or heard.
 
Level 6
Joined
Apr 12, 2009
Messages
156
Actually, it doesn't change the time of day (I don't believe); it changes the lighting of the game. And I don't want this to be present in only one area so much as to have it affect players who's units have entered a particular region.

If this is simply impossible, perhaps a custom script for a filter that replaces the effect of SetDayNightModels("","")? That said, a filter that individually effects a player who's units have entered a particular region, and then removed once another, different region is entered.
 
Level 7
Joined
May 3, 2007
Messages
210
I just test this with 2 other people:

JASS:
function Trig_Do_Actions takes nothing returns nothing   
    local unit u = GetTriggerUnit()
    if GetLocalPlayer() == GetOwningPlayer(u) then
      call SetTerrainFogEx( 0, 0.00, 4000, 100.00, 0, 0, 0)
    endif
endfunction

//===========================================================================
function InitTrig_Stuff takes nothing returns nothing    
  set gg_trg_Stuff = CreateTrigger(  )   
  call TriggerRegisterEnterRectSimple( gg_trg_Stuff, gg_rct_Down)    
  call TriggerAddAction( gg_trg_Stuff, function Trig_Do_Actions )
endfunction

It doesn't desync. This lets you change the fog for a given player, however you'll need to do some selection checks in order to make sure its only on when the player is selecting a given unit, even then its a big groggy when trying to localize the position in which the player sees it. However localizing it to a player is indeed possible.

You can make it black obviously by setting the RGB all to 0, and a fairly high density might replicate darkness well enough. The above code mimics it pretty darn well.

If you want to implement this trigger specifically to see what i mean, create a trigger called "Stuff" convert it to custom text, erase everything in it, and then past the above trigger in their, then make a new region, and name it "Down", then just have a unit walk over it. It can be applied in varied concepts, but there you go, I believe this solves your problem. Sorry for taking so long.
 
Status
Not open for further replies.
Top