• 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.

Entire screen for player and limiting it to a unit's line of sight during a cinematic

Status
Not open for further replies.
Level 2
Joined
May 5, 2009
Messages
4
Im making a cinematic for a map, but i want the viewer to see everything as though they were playing it.

What i mean is
- whenever the cinematic mode comes on you can see everything on the screen.
- i want to make it so that you can only see whatever is in the unit's line of sight.

can someone help me?
 
Level 9
Joined
Apr 28, 2009
Messages
538
i do not understand.
"What i mean is:
- whenever the cinematic mode comes on you can see everything on the screen.
- i want to make it so that you can only see whatever is in the unit's line of sight."
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
Well, the line of sight issue would be simple enough with LoS Blockers, perhaps? I've never tried it, but perhaps creating the LOS blockers and then destroying them later. OR - if you mean, First Person view...I'm not sure on how to do that, but it would be with a well placed camera, and I know there is a tut for that: http://www.hiveworkshop.com/forums/...rials-279/creating-first-person-camera-93891/

But by "everything on the screen" do you mean without the letterbox look? Because, to my knowledge, that cannot be removed. It can be altered, though!

Also, Rui, your explanation confused me as well, sorry. o.o

The GUI action runs several JASS functions that do all this

Oxymorons and 3am do NOT mix very well. I'm sure I'll look at this tomorrow and "/facepalm" though.

Either way, I hope I was able to help, ^^
 

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
The action you use to do this runs many functions "behind the scenes". Meaning, for you it's only one action, but it actually does a tad of things like creating the black mask, disabling the mouse control for the player, and more.

I was hoping some script writer would read the thread and help you, but you didn't succeed in making the title look very appealing.

If you don't mind, I'll change it.
~Thread moderated (title changed to "Entire screen for player and limiting it to a unit's line of sight during a cinematic")
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
Yeah I just reread it Rui, and like I said, it would make sense to me when I wasn't so tired, lol.

But what you said is logical, therefore it makes sense to me, ^^

But unfortunately, since I don't know JASS, I cannot help this person any further, so I hope the help they need is found.

Good luck!
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Here's the fixed function: Use it instead of start/stop cinematic (cineMode = false if you are stopping, true if you are starting).

JASS:
function CinematicModeExBJ takes boolean cineMode, force forForce, real interfaceFadeTime returns nothing
    // If the game hasn't started yet, perform interface fades immediately
    if (not bj_gameStarted) then
        set interfaceFadeTime = 0
    endif

    if (cineMode) then
        // Save the UI state so that we can restore it later.
        if (not bj_cineModeAlreadyIn) then
            set bj_cineModeAlreadyIn = true
            set bj_cineModePriorSpeed = GetGameSpeed()
            set bj_cineModeSavedSeed = GetRandomInt(0, 1000000)
        endif

        // Perform local changes
        if (IsPlayerInForce(GetLocalPlayer(), forForce)) then
            // Use only local code (no net traffic) within this block to avoid desyncs.
            call ClearTextMessages()
            call ShowInterface(false, interfaceFadeTime)
            call EnableUserControl(false)
            call EnableOcclusion(false)
            call SetCineModeVolumeGroupsBJ()
        endif

        // Perform global changes
        call SetGameSpeed(bj_CINEMODE_GAMESPEED)
        call SetMapFlag(MAP_LOCK_SPEED, true)
        call EnableWorldFogBoundary(false)

        // Use a fixed random seed, so that cinematics play consistently.
        call SetRandomSeed(0)
    else
        set bj_cineModeAlreadyIn = false

        // Perform local changes
        if (IsPlayerInForce(GetLocalPlayer(), forForce)) then
            // Use only local code (no net traffic) within this block to avoid desyncs.
            call ShowInterface(true, interfaceFadeTime)
            call EnableUserControl(true)
            call EnableOcclusion(true)
            call VolumeGroupReset()
            call EndThematicMusic()
            call CameraResetSmoothingFactorBJ()
        endif

        // Perform global changes
        call SetMapFlag(MAP_LOCK_SPEED, false)
        call SetGameSpeed(bj_cineModePriorSpeed)
        call EnableWorldFogBoundary(true)
        call SetRandomSeed(bj_cineModeSavedSeed)
    endif
endfunction
 
Level 12
Joined
Aug 22, 2008
Messages
911
Well, I think there are some solutions for this:
1. If this needs to operate in a cinematic just enable letterbox mode and set the camera without touching the cinematic mode functions. Also, create there a visibility circle. I don't think more is needed in this case.
2. In case this needs to operate ingame you should play with the line of sight of the units, using Chaos or Ultravision or whatever.
You'll probably go for PurplePoot's solution... It's okay, I would have too.
 
Status
Not open for further replies.
Top