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

Thread: Understanding the Reborn Intermission Event

  1. #1

    Default Understanding the Reborn Intermission Event

    Hey All,

    I'm trying to fix Arma's team swap script, but in order to do this, I need help understanding the different intermission types.

    The documentation mentions the following:

    Code:
             // Info
              local.type - type of server intermission
              0 = Player intermission screen
              1 = Map change (happens after using commands: map, gamemap , but also right after player intermission screen)
              2 = Map restart (happens after restart command)
    Player intermission screen: Does this happen after every round? It does show players their score, but it's brief. What about when the map fraglimit has been reached? The screen goes black, scores are shown for a while, and the server takes a long time loading next map or reloads current map depending on server.cfg settings.

    Map change: Does this happen when the fraglimit of the map is reached along with using rcon map command?

    Map restart: When admin uses the "rcon restart" command?

    Here's Arma's script (used to work, but doesn't work anymore):

    Code:
    main:
        if(int(getcvar(inscrim)) == 1){
            // If inscrim is not set DO NOTHING
            teamswitchdelay .2
        
            if(level.swapLoaded)
                end
        
            level.swapLoaded = 1
            
            //Check if players were swapped last round, if so, reset the cvars
            if(getcvar swapped == "1") {
                setcvar swap "0"
                setcvar swapped "0"
            }
                
            // Register events
            if(level.elgboton != 1){
              
              // Unregister events just to be on the safe side:
              
              // local.unreg2 = unregisterev "intermission"
              // local.unreg3 = unregisterev "connected"
              
              // println local.unreg2
              // println local.unreg3
              
              wait 5
              local.connectme = registerev "connected" teamswap/swap.scr::connected
              local.intermission = registerev "intermission" teamswap/swap.scr::intermission
            }
        }
    
        
    end
    
    connected local.player:
    
        if(getcvar swap == "1" && int(getcvar(inscrim)) == 1) {    
            if(local.player.dmteam == "axis") {
                setcvar swapped "1"  //set a cvar so that we don't swap again next round.
                local.player join_team allies
            }
            else {
                if(local.player.dmteam == "allies") {
                    setcvar swapped "1" //set a cvar so that we don't swap again next round.
                    local.player join_team axis    
                }
            }
        }    
        
    end
    
    intermission local.type:
    
        if(local.type == 0)
        {
            setcvar swap "1"
        }
        else
        {
            setcvar swap "0"
        }
            
    end
    The above script is pretty simple to follow. So, should the intermission type be 1 (the map fraglimit has been reached) when the swap cvar is set to 1? Or is the player intermission screen occur when the map fraglimit is reached?
    Browse MOHAA Servers Post GameSpy Era

    VISIT MOHREBORN.COM FOR LATEST INFORMATION



    Medal of Honor: Game Server Browser Fixer - Patches your MOHAA, MOHSH, and MOHBT game binaries to allow you to retrieve a list of game servers within the multi-player menu in-game even after GameSpy ceases operation!

    Medal of Honor: Query Launcher - Find, browse, organize, join, get your ping, and get more information regarding all Medal of Honor (AA, SH, & BT) servers from your PC at any time!
    Medal of Honor: Web Server Master List - Find and browse all Medal of Honor servers online using your browser!
    Add your Medal of Honor Server to the Master List
    YouTube Video for Medal of Honor: Query Launcher and MOHAASERVERS.TK!



    MOHAA Mods and Utilities
    OwN-3m-All's Mods
    Make Me Stock - A program that allows you to easily move-in and move-out non-stock mods and other files at the click of a button. Automates adding / removing mods without having to copy / move files manually.



    Quality Game Servers

    Rent dedicated Dallas Texas, Kansas City, Las Vegas Nevada, Chicago, Pennsylvania, and Sofia Bulgaria MOHAA and other game servers from We Be HostiN starting at $10 a month.


  2. #2
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,269

    Default

    Its always been a difficult event to understand for me as well .

    When ive used it, i hadn't needed to make the distinction , i didnt use the local.type

    But from testing it , i thought that the

    player intermission screen (1) occurs after every round ( for objective game ) AND at the end of the map ( after fraglimit reached)
    map change (2) occurs after the fraglimit is reached ( or time runs out) but AFTER the player intermission screen

    Im guessing that you want it to change teams at map change ( because player intermission screen is not long enough) , and probably load the same map after it but teams are changed

    So i think that the intermission event is run TWICE at map change , once for the player intermission screen(0) and again for the map change(1)

    So upon changing maps ( or loading the same one )
    It would go like this
    Player intermission screen (0) where it sets swap 1
    THEN
    Map Change intermission (1) where it would set to back to 0
    THEN
    Then Player connection , where it wouldn't swap because swap = 0

    So at every round end , cvar swap gets set to 1 , but then when the change comes it gets set to 0 again by the map change intermission.

    So i think that

    Code:
    intermission local.type:
    
        if(local.type == 1)
        {
            setcvar swap "1"
        }
        else
        {
            setcvar swap "0"
        }
            
    end
    Should work, that it sets cvar swap 1 at map change (1) which is after player intermission screen(0)

    Or if you wanted to test it via rcon restart

    Code:
    intermission local.type:
    
        if(local.type == 0)
        {
            setcvar swap "0"
        }
        else
        {
            setcvar swap "1"
        }
            
    end


    Also another problem i might of noticed , if a player connects during the first round of a map , he is neither axis or allies, he would still be spectate , so wouldnt that cause an error in the connection part . maybe just a if(
    local.player.dmteam == spectator) end would fix it , i dont no if it would cause an error tho
    Last edited by Purple Elephant1au; April 20th, 2013 at 11:28 PM.

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  3. #3

    Default

    Quote Originally Posted by Purple Elephant1au View Post
    Its always been a difficult event to understand for me as well .

    Code:
    intermission local.type:
    
        if(local.type == 0)
        {
            setcvar swap "0"
        }
        else
        {
            setcvar swap "1"
        }
            
    end
    This is what I'm thinking... that's the way I originally coded it.

    Quote Originally Posted by Purple Elephant1au View Post
    Also another problem i might of noticed , if a player connects during the first round of a map , he is neither axis or allies, he would still be spectate , so wouldnt that cause an error in the connection part . maybe just a if([/SIZE][/SIZE][/SIZE]local.player.dmteam == spectator) end would fix it , i dont no if it would cause an error tho
    [/quote]

    It doesn't matter if they're in spectate since it runs at the beginning of every round. We only want to switch players that have been in the server longer than a round. If they're in spec, they can pick their team.
    Browse MOHAA Servers Post GameSpy Era

    VISIT MOHREBORN.COM FOR LATEST INFORMATION



    Medal of Honor: Game Server Browser Fixer - Patches your MOHAA, MOHSH, and MOHBT game binaries to allow you to retrieve a list of game servers within the multi-player menu in-game even after GameSpy ceases operation!

    Medal of Honor: Query Launcher - Find, browse, organize, join, get your ping, and get more information regarding all Medal of Honor (AA, SH, & BT) servers from your PC at any time!
    Medal of Honor: Web Server Master List - Find and browse all Medal of Honor servers online using your browser!
    Add your Medal of Honor Server to the Master List
    YouTube Video for Medal of Honor: Query Launcher and MOHAASERVERS.TK!



    MOHAA Mods and Utilities
    OwN-3m-All's Mods
    Make Me Stock - A program that allows you to easily move-in and move-out non-stock mods and other files at the click of a button. Automates adding / removing mods without having to copy / move files manually.



    Quality Game Servers

    Rent dedicated Dallas Texas, Kansas City, Las Vegas Nevada, Chicago, Pennsylvania, and Sofia Bulgaria MOHAA and other game servers from We Be HostiN starting at $10 a month.


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

    Default

    Restart event happens on every map restart with "restart" command.
    Map change happens every time map changes, doesn't matter if it was admin who changed it in the middle of the match (when fraglimit was not reached yet), or if it changed automatically because of map rotation.

    Intermission happens every round when player scores are shown, and just before map change when screen goes black.

    When map changes due to fraglimit being reached, intermission event is fired, and just after that a map change event.


    There was a bug with restart event, which only fired once, (after it was triggered, engine didn't keep track of it being registered) so I fixed it to fire each time a restart is made.

  5. #5

    Default

    Razo, do you see anything wrong in Arma's script? Are we using the intermission event improperly? We want to trigger the event when the fraglimit has been reached. When the fraglimit has been reached, the swap cvar should be set. Now, what's weird is that I can't even debug this script.

    When my server first loads, I get output from the swap.cfg script (it's running), but the inscrim cvar is not set to 1, so nothing happens. When I exec the scrim config which turns the inscrim cvar to 1, nothing happens (and there is no output in the console suggesting this script is not running). It's as if the dmprecache is not calling it on every map load... but I have the line in the dmprecache to exec it. It only execs the swap script when the server loads for the very first time!

    Anyone have a clue what's wrong?
    Browse MOHAA Servers Post GameSpy Era

    VISIT MOHREBORN.COM FOR LATEST INFORMATION



    Medal of Honor: Game Server Browser Fixer - Patches your MOHAA, MOHSH, and MOHBT game binaries to allow you to retrieve a list of game servers within the multi-player menu in-game even after GameSpy ceases operation!

    Medal of Honor: Query Launcher - Find, browse, organize, join, get your ping, and get more information regarding all Medal of Honor (AA, SH, & BT) servers from your PC at any time!
    Medal of Honor: Web Server Master List - Find and browse all Medal of Honor servers online using your browser!
    Add your Medal of Honor Server to the Master List
    YouTube Video for Medal of Honor: Query Launcher and MOHAASERVERS.TK!



    MOHAA Mods and Utilities
    OwN-3m-All's Mods
    Make Me Stock - A program that allows you to easily move-in and move-out non-stock mods and other files at the click of a button. Automates adding / removing mods without having to copy / move files manually.



    Quality Game Servers

    Rent dedicated Dallas Texas, Kansas City, Las Vegas Nevada, Chicago, Pennsylvania, and Sofia Bulgaria MOHAA and other game servers from We Be HostiN starting at $10 a month.


  6. #6
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,269

    Default

    I seem to of hit a problem with the intermission event ,
    i thought i would have a crack at the promod mod , but at map change i need it to set a cvar respawn back to 0 , but it seems to do it every round even if i had the intermission event set up like above ,
    that only sets it if(local.type != 0) ,
    which i thought ment not at every round but at each map change and/or restart .

    Code:
    intermission local.type:
    
        if(local.type != 0)
        {
            setcvar "respawned" "1"
        }
        
              
    end
    But it sets to to 1 every round end , at the player intermission screen , when i want it only at map change ( like for the teamswap )
    so i think we must be doing something wrong lol

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  7. #7
    Developer Sor's Avatar
    Join Date
    Aug 2010
    Location
    The Medieval City of Bruges
    Posts
    747

    Default

    I was under the impression that the server restarts after each round (except the last). It's been quite a while and when I tested it,
    I used DM_Manager to end rounds (I'm impatient that way) so I'm not sure what happens if the round changes because of time- or fraglimit.

    @Purple Elephant1au: If you only want it to happen when a map changes, try explicitly checking for type == 1.
    Morpheus Script (MoH) => You try to shoot yourself in the foot only to discover that MorpheusScript already shot your foot for you.

  8. #8
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,269

    Default

    Well for testing it i did that so i could restart it to test and not wait for map to end

    So it would only change it for local.type 1 or 2 and not 0

    I also had tried

    if(local.type == 1 || local.type == 2)

    aswell , and tried just local.type == 1 and changed maps both by rcon and fraglimit reached , but both ways seem to not work , still goes through player intermission on each one

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  9. #9

    Default

    In my case, I can't even get the script to run more than once per server session.

    I have no idea why this is. Again, the call for the script is the dmprecache and it works when the server is first started. Map change, and it no longer execs. I'm baffled. Anyone know why this might be?

    I even removed this from the code:

    Code:
    if(level.swapLoaded)
                end
        
    level.swapLoaded = 1
    Would this even matter? Aren't level variables reset once the map changes?
    Browse MOHAA Servers Post GameSpy Era

    VISIT MOHREBORN.COM FOR LATEST INFORMATION



    Medal of Honor: Game Server Browser Fixer - Patches your MOHAA, MOHSH, and MOHBT game binaries to allow you to retrieve a list of game servers within the multi-player menu in-game even after GameSpy ceases operation!

    Medal of Honor: Query Launcher - Find, browse, organize, join, get your ping, and get more information regarding all Medal of Honor (AA, SH, & BT) servers from your PC at any time!
    Medal of Honor: Web Server Master List - Find and browse all Medal of Honor servers online using your browser!
    Add your Medal of Honor Server to the Master List
    YouTube Video for Medal of Honor: Query Launcher and MOHAASERVERS.TK!



    MOHAA Mods and Utilities
    OwN-3m-All's Mods
    Make Me Stock - A program that allows you to easily move-in and move-out non-stock mods and other files at the click of a button. Automates adding / removing mods without having to copy / move files manually.



    Quality Game Servers

    Rent dedicated Dallas Texas, Kansas City, Las Vegas Nevada, Chicago, Pennsylvania, and Sofia Bulgaria MOHAA and other game servers from We Be HostiN starting at $10 a month.


  10. #10

    Default

    Putting that code after waittill spawn may could fix?

Posting Permissions

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