xplicitjohn
X
xplicitjohn
In Zombie survival games, how do i make night vision effect?
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 90689
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)
Then probably you didn't import the model first?
Try using only "NiteVisionModel.mdx" as path in the import editor.
There is also a tutorial for this purpose:
http://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=114715
If you have problems with lights disappearing check out my thread:
http://www.hiveworkshop.com/forums/world-editor-help-zone-98/omni-lights-disappear-180187/
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 90735
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 90735
3. Now to make it so only one player has nightvision:call SetDayNightModels("...","...")
This is how you turn it on. If you want to turn it off you have to useset player = .....
Custom script: if GetLocalPlayer() == udg_player then
Custom script: call SetDayNightModels("...","...")
Custom script: endif
where instead of Lordaeron you use your tileset.call SetDayNightModels("Environment\\DNC\\DNCLordaeron\\DNCLordaeronTerrain\\DNCLordaeronTerrain.mdl" , "Environment\\DNC\\DNCLordaeron\\DNCLordaeronUnit\\DNCLordaeronUnit.mdl")
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.
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.
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