how can i do this?

Status
Not open for further replies.
Level 19
Joined
May 1, 2008
Messages
1,129
i have a playable outdoors terrain and cave
i want so that outdoors i will have day/night cycle but in the cave i want it to be night always
can it be done?
 
This is the only thing I can think of.

Detect when somebody enters the cave, or when a player looks into it and do:

  • Custom script: if ( GetLocalPlayer() == Player(NUMBER OF THE TRIGGERING PLAYER) ) then
  • Game - Set the time of day to 24.00
  • Custom script: endif
Player 1 = 0, Player 2 = 1 etc..

This will make it night only for the picked player.

However, I'm not sure if this will cause disconnect in multiplayer. You gotta try it.
 
  • Dungeon
    • Events
      • A unit enters Region (Over the dungeon)
    • Conditions
      • Unit type equal to YOURUNIT/PLAYER
    • Actions
      • Turn on Dungeon Nigth
  • Dungeon Nigth
    • Events
      • Every 0.1 seconds of the day
    • Conditions
    • Actions
      • Set Day Time 24:00
  • Dungeon Off
    • Events
      • A unit leaves YourRegion
    • Conditions
      • Unit Type Equal to URUNIT/PLAYER
    • Actions
      • Turn off Dungeon Nigths
 
RDZ leaves all his maps open source, does he not? Pretty sure he does.
Custom light sources are the only answer I can think of for multiplayer. RDZ probably just used triggers to change the cycle since it's single player.

  • Dungeon
    • Events
      • A unit enters Region (Over the dungeon)
    • Conditions
      • Unit type equal to YOURUNIT/PLAYER
    • Actions
      • Turn on Dungeon Nigth
  • Dungeon Nigth
    • Events
      • Every 0.1 seconds of the day
    • Conditions
    • Actions
      • Set Day Time 24:00
  • Dungeon Off
    • Events
      • A unit leaves YourRegion
    • Conditions
      • Unit Type Equal to URUNIT/PLAYER
    • Actions
      • Turn off Dungeon Nigths
This is a terrible method. What if a unit enters while another one is in there? Once one leaves, it screws it up.
 
This is the only thing I can think of.
  • Custom script: if ( GetLocalPlayer() == Player(NUMBER OF THE TRIGGERING PLAYER) ) then
  • Game - Set the time of day to 24.00
  • Custom script: endif

This will desync in multiplayer since there is a trigger to check the ingame times. And think about that night elf got an ability that increase the sight range at the night. What if its day for player1 and night for player2?

Hower I dont think this will desync:

Event: Something
JASS:
if GetLocalPlayer() == Player(0) then
call SetDayNightModels("something","something")
endif
 
I'm pretty sure changing time of day causes desynch. DayNight models probably doesn't.

If you have only one unit, just check if the unit is inside the cave or not (if that's the case, change darkness). If you have multiple units, do a periodic check if your camera target point is inside the cave and change the darkness accordingly.
 
Status
Not open for further replies.
Back
Top