Page 1 of 4 123 ... LastLast
Results 1 to 10 of 33

Thread: Spectate player

  1. #1

    Default Spectate player

    This can be put on the far back burner, but I thought if it weren't too hard, would it be possible to make a command or cvar that allows you to spectate 1 person, so when they die, you can continue watching them? I've made my own mod that works, but it has to cycle through players until it finds the player again. Just an idea.

  2. #2
    Banned
    Join Date
    May 2010
    Location
    fuck off?
    Posts
    1,145

    Default

    I'm sure this could be done via script (mod) quite easily.

    just improve your script.

    ie...how is it working, what does it do, what does it not do you want it to do...

  3. #3

    Default

    Right now i have a admin menu button activate a keypress event. example keyp 7 for client #7. Then in keypress handler I make sure local.player is an admin. If so, then I basically exec this:

    local.admin is the admin who wants to watch a player
    local.player is the player being watched

    PHP Code:
    while(blah blah blah)  //checking for spectate & other things
    {
            
    local.inradius vector_within local.admin.origin local.player.origin 130
        waitframe
        
    while(!local.inradius)
        {
                   
    //blah blah blah....do some more checks to exit loop.

            
    local.admin stufftext "+use;-use"  // pressing use will go to next player in spectate.
            
    wait .3  // seems if I wait less, then sometimes the player can be skipped over cause it cycles thru too fast
            
    local.inradius vector_within local.admin.origin local.player.origin 130
          
    }


    Basically what I wish it would do, is stay with that player the whole time.

    I've tried going this route too to follow a player...
    PHP Code:
                local.origin local.admin.origin
                local
    .viewangles local.admin.viewangles
                local
    .admin nodamage
                local
    .admin hide
                local
    .admin notsolid
                local
    .admin noclip
            
    while(blah blah)
    {
                    
    local.admin.origin local.player.origin local.player.forwardvector 56 //distance back
                    
    local.admin.origin +=  ( 0 0 24 //dist up

    Problem with that is, that it is jumpy, and very annoying.
    Last edited by armageddon; February 12th, 2012 at 07:09 AM.

  4. #4

    Default

    PHP Code:
        local.camera spawn Camera
        local
    .camera follow local.player
        local
    .camera targetname ("cam" local.player.entnum)
        
    local.camerause spawn trigger_camerause target ("cam" local.player.entnum)
        
    local.camerause doUse local.admin
        local
    .camerause delete 

  5. #5

    Default

    Oh yeah, I've tried that before too. That is jumpy and annoying as well.

    I actually like the first mod because it's not jumpy, but the other ways are. The only thing I don't like about the first one, is you have to wait .3 while cycling thru the players again. I wish it didn't stop spectating a player when they die, then I wouldn't have to keep cycling thru the players.

  6. #6
    Über Prodigy & Developer Razo[R]apiD's Avatar
    Join Date
    May 2010
    Location
    Poland, Lublin
    Posts
    3,257

    Default

    I'll see what I can do, but I want to release RC3 first. Then I can take care of new scripting commands.

  7. #7

    Default

    Definitely. Yes, don't make this a priority. I was just curious if it could be done easily.

    Thanks!

  8. #8
    Banned
    Join Date
    May 2010
    Location
    fuck off?
    Posts
    1,145

    Default

    youre doing wrong if it stutters...?

    local.camera follow local.player is not smooth?

  9. #9

    Default

    No. I've tried it before, and i just tried it again using the code he posted above, and it's not smooth. ?

  10. #10
    Banned
    Join Date
    May 2010
    Location
    fuck off?
    Posts
    1,145

    Default

    am I going to have to install mohaa :|..

    even if you were updating the origin every frame it would be smooth.

    ive used cams with planes and vehicles moving a lot faster than players and its been smooth.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •