1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Nightvision

Discussion in 'World Editor Help Zone' started by xplicitjohn, Oct 9, 2010.

  1. In Zombie survival games, how do i make night vision effect?
     
  2. Superz_Ze_Man

    Superz_Ze_Man

    Joined:
    Aug 21, 2009
    Messages:
    397
    Resources:
    0
    Resources:
    0
    if you want you could change the fog to a light green showing a greenish glow to everything and brightening up stuff, but this would effect everyone (im pretty sure anyways). A flishlight might work..there might be a tutorial on how to make one on thw?
     
  3. Gilded Touch

    Gilded Touch

    Joined:
    Jun 26, 2010
    Messages:
    73
    Resources:
    0
    Resources:
    0
    not the hive, and the last place i've used for the tutorial is gone.
    Theres two ways to do it, one with a fade filter, (easiest and doesnt really helps during the night) ammd the other with a day and night model. (the real night vision)
    anyway, i can give u a walkthrough on the DNC model editing if u needit

    import this into your map
    View attachment NiteVisionModel.mdx

    add the function:
    call SetDayNightModels("NiteVisionModel.mdx","NiteVisionModel.mdx")
    and now everyperson in the game has night vision. (and it actually helps them see in the dark)
     
  4. I tried, and in game everything goes dark?
     
  5. kleinerhauck

    kleinerhauck

    Joined:
    Jun 1, 2008
    Messages:
    298
    Resources:
    8
    Maps:
    8
    Resources:
    8
  6. Gilded Touch

    Gilded Touch

    Joined:
    Jun 26, 2010
    Messages:
    73
    Resources:
    0
    Resources:
    0
    the model i gave you was one i made on the spot, and i really didnt explain how to use it, i can hand you a map with a nightvision ability in it.
    take a look at it, if you still dont get it i'll explain it to you
    View attachment The Alien Hunt 2.0.w3x
     
  7. Superz_Ze_Man

    Superz_Ze_Man

    Joined:
    Aug 21, 2009
    Messages:
    397
    Resources:
    0
    Resources:
    0
    thats a big ass map!
     
  8. I dont get it sorry.
     
  9. kleinerhauck

    kleinerhauck

    Joined:
    Jun 1, 2008
    Messages:
    298
    Resources:
    8
    Maps:
    8
    Resources:
    8
    Ok.
    1. Import a nightvision model. (like the one of Glided Touch)
    2. This trigger specifies how the map will be illuminated. (Put the path of the light source in the quotations)
    The light you hand the function will always be in the center of the screen.
    3. Now to make it so only one player has nightvision:
    This is how you turn it on. If you want to turn it off you have to use
    where instead of Lordaeron you use your tileset.
     
  10. -Peper-

    -Peper-

    Joined:
    Jun 28, 2010
    Messages:
    3,005
    Resources:
    13
    Models:
    10
    Icons:
    1
    Packs:
    1
    Tutorials:
    1
    Resources:
    13
    Phew..... The tutorial is so useful to me....
     
  11. Still wont work?
     
  12. jk2pach

    jk2pach

    Joined:
    Mar 19, 2009
    Messages:
    350
    Resources:
    50
    Models:
    43
    Packs:
    1
    Maps:
    4
    Tutorials:
    2
    Resources:
    50
    Personally, in Restricted Complex 601, nightivision is a simple spell which creates a cinematic filter and change terrain fog (make fog to a low height) for a local player .

    On spell turn off, it just removes the cinematic filter and set the fog to a greater height.
     
  13. RaidonGod

    RaidonGod

    Joined:
    Oct 7, 2008
    Messages:
    285
    Resources:
    5
    Models:
    3
    Icons:
    2
    Resources:
    5
    If you could make a tutorial map with the triggers needed and upload here, the asking user would be very happy. believe me. :p
     
  14. jk2pach

    jk2pach

    Joined:
    Mar 19, 2009
    Messages:
    350
    Resources:
    50
    Models:
    43
    Packs:
    1
    Maps:
    4
    Tutorials:
    2
    Resources:
    50
    A tutorial, no , sorry, I'm a bit busy, but there is the trigger;

    for my one, you need the Jass New Gen Pack (its a basic VJass trigger)

    Code (vJASS):
    scope NightVision initializer init // Needs SpellEvent, AbilityPreload, both available on wc3.net

    globals
        private constant integer SPELL = 'A02X' //spell to turn nightvision on / off (it's not a spell u really can turn off, I simulate it)
        private constant integer BUFF = 'B02V' //Buff added with the spellbook containing the bonus
        private constant integer SPELLBOOK = 'A08J'
        private constant string FX = "ReplaceableTextures\\CameraMasks\\White_mask.blp"
        private boolean array Nightvision [10] //You are not obliged to do this, I needed it
        private constant integer NV_RED = 50 //settings for the fade fileter
        private constant integer NV_BLUE = 50
        private constant integer NV_GREEN = 100
        private constant real NV_TRANS = 0.
        private constant integer NORMALRED = 100
        private constant integer NORMALBLUE = 100
        private constant integer NORMALGREEN = 100
        private constant real NORMALTRANS = 100.
    endglobals
       
        private function Actions takes nothing returns nothing
            local integer i = 0
            local player owner = GetOwningPlayer(SpellEvent.CastingUnit)//SpellEvent.CastingUnit is GetTriggerUnit() through SpellEvent library
            local integer ownerId = GetPlayerId(owner)
                if Nightvision[ownerId] == false then //If the player does not already use the nv
                    if GetUnitAbilityLevel(SpellEvent.CastingUnit,SPELLBOOK)<=1 then
                        call UnitAddAbility(SpellEvent.CastingUnit,SPELLBOOK) //if the unit has not the bonus, we add it
                    endif
                    set Nightvision[ownerId] = true//now the player uses nv
                    if owner == GetLocalPlayer() then //local player = thing done only on the computer of this player
                        //There, I add a cinematic filter (blue/green for me) and a terrain fog (to make the terrain more visible)
                        call CinematicFilterGenericBJ(2.,BLEND_MODE_MODULATE,FX,100,100,100,100.,NV_RED,NV_GREEN,NV_BLUE,NV_TRANS)
                        call SetTerrainFogEx(0,2300.,4500.,0.25,0.,0.,0.)
                    endif
                else //otherwise, if the player is using the nightvision, the trigger removes bonus, filters etc.
                    if GetUnitAbilityLevel(SpellEvent.CastingUnit,SPELLBOOK)>=1 then
                        call UnitRemoveAbility(SpellEvent.CastingUnit,SPELLBOOK)
                    endif
                    if GetUnitAbilityLevel(SpellEvent.CastingUnit,BUFF)>=1 then
                        call UnitRemoveAbility(SpellEvent.CastingUnit,BUFF)
                    endif
                    set Nightvision[ownerId] = false
                    if owner == GetLocalPlayer() then
                        call CinematicFilterGenericBJ(0,BLEND_MODE_MODULATE,FX,NV_RED,NV_GREEN,NV_BLUE,NV_TRANS,100,100,100,100.)
                        call SetTerrainFogEx(0,1000.,2000.,0.5,0.,0.,0.)
                    endif
                endif
                set owner = null
        endfunction
       
        public function init takes nothing returns nothing
            local integer i = 0
                call AbilityPreload(SPELLBOOK) //Because I add a hidden spellbook, I preload it to avoid freeze time the first time it is added
                loop
                    exitwhen i > MAXPLAYER
                    call SetPlayerAbilityAvailable(Player(i),SPELLBOOK,false) //To make the spellbook containing bonus hidden
                    set i = i + 1
                endloop
                call RegisterSpellCastResponse(SPELL, Actions) //Through the library SpellEvent, it creates a trigger detecting the cast of this spell
        endfunction

    endscope