Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: A little help or guidance for a newbie mohaa server moder

  1. #1

    Default A little help or guidance for a newbie mohaa server moder

    Hello, I have been reading post for a few weeks now here searching for answers on how to mod my mohaa server. I haven't found any of the answers I have been looking for so I thought I would ask. I am new to this so please forgive my ignorance.

    What I am trying to setup is a sniper only objective server on the v2 rocket map. (this is the only map that will be played for right now.) What I am looking to do is have it where first team win 7 rounds is the winner (team that kills all the opponents or completes the objective ) then the map restarts. Also if you die that player stays dead until next round and can only spec there team. Also looking for a way to do broadcast messages to both teams, for example "Friendly Fire is On" and "Welcome to Such and such server" few more in a loop. Any help would be greatly appreciated.

    Again I am completely new to this so please bear with me.

    Thank you.

  2. #2

    Default

    Hoi,

    Setting up server cvars such as round limit and map rotation:
    https://www.x-null.net/forums/thread...Config-Example - example of server.cfg configuration and file itself.
    http://www.piccoli.ind.br/farrapos/A...s/Comandos.txt - More detailed explanation of cvars in server.cfg and basic rcon usage.
    http://www.mohaaaa.co.uk/AAAAMOHAA/c...st-screenshots - at the end of site is list of names of multiplayer maps in MOHAA, SH and BT.

    Mod installation guide and database of mods for MOHAA:
    http://www.mohaaaa.co.uk/AAAAMOHAA/c...nstalling-mods - mod installation guide.
    http://www.mohaaaa.co.uk/AAAAMOHAA/c...a-mod-database - mods database.

    You would like to have reborn patch on server, explanation what's this in link, choose one version of patch according to OS on machine on which server will be running:
    https://x-null.net/MOH2/

    One of the best mods to control weapons on server:
    http://mohaaaa.co.uk/AAAAMOHAA/content/weapon-limiter

    And two pure sniper only mods:
    http://mohaaaa.co.uk/AAAAMOHAA/aaaa-...modname_value=

    Automated console messages("Welcome to such and such server"):
    https://www.x-null.net/forums/thread...nsole-messages

    Tutorials on scripting mainly:
    http://www.mohaaaa.co.uk/AAAAMOHAA/c...pting-tutorial - basic scripting tutorial.
    https://www.x-null.net/forums/thread...OHAA-TUTORIALS - Tutorial pack, includes one above and many other development tuts.
    http://homepage.tinet.ie/~abyrne/sdk/ - SDK in online version.

    After visiting all links you should be already done with making your server working how you would like to, if you won't understand something ask here. You would like to have also good text editor, some of people would say that only one good choice is npp, but I would say that properly configured Sublime Text is nicer for eye and less exhausting.

    Morpheus Script syntax highlightiing for Sublime:
    https://www.x-null.net/forums/thread...ghlight=syntax

    And I'm pretty full of admiration that you have found nothing, I got all these links from google/search option on right top side of forum.
    Last edited by Shadow; October 25th, 2018 at 12:14 AM.

  3. #3

    Default

    win 7 rounds is the winner
    add to server.cfg seta fraglimit 7 on objectives it shouldn't let players respawn
    pk3 has a message script just open it and change wait times and messages.
    Attached Files Attached Files

  4. #4

    Default

    Thank you for the replies. I have gotten most of what I want working now. Only issue im having is the announcements part of the sniper.pk3 easymeat attached. I only have 3 announcements but the like to double announce.

    Code:
    main:
    
    while (1)
    {
    wait 70
    iprintln "Welcome to the  Private Sniper Server"
    wait 130
    iprintln "Friendly Fire IS ON"
    wait 195
    iprintln "TeamSpeak: private.someserver.here  Password: publicpassword"
    wait 253
    iprintln "www.somewebsite.here"
    }
    end

  5. #5

    Default

    You can just add another iprintlns and waits to your comfort or substract them:

    Code:
    main:{
       while(1){
         wait 15                               // Tells script to wait given time in seconds.
         stuffsrv("say Welcome to the server") // console msg.
         iprintln("Welcome to the server")      // the yellow game message which below the compass.
         iprintlnbold("Welcome to the server")  // the white game message which below the compass.
         wait45
       }
    }end
    If you will make two iprintln commands without wait command between, then two messages will be printed at once.

    PS: You have to use square brackets "[][/]" to make code working <></> doesn't work here.
    Last edited by Criminal; October 27th, 2018 at 10:05 AM.

  6. #6

    Default

    thank you to those who helped. I just about have it how I want now. Still getting the double server announcements after a cycle or so of the msg script despite my changing wait times. But think I can live with it. Its only a private practice server anyway so not a huge deal.

  7. #7
    Developer RyBack's Avatar
    Join Date
    Apr 2014
    Location
    In Front of the screen
    Posts
    1,603

    Default

    Quote Originally Posted by firestorm View Post
    thank you to those who helped. I just about have it how I want now. Still getting the double server announcements after a cycle or so of the msg script despite my changing wait times. But think I can live with it. Its only a private practice server anyway so not a huge deal.
    It's probably because dmprecache.scr is executed 2 times every map.

    if(level.server_announc_glob!=true)
    level.server_announc_glob= true
    else
    end


    add this to the top of ur main func.
    problem solved

  8. #8

    Default

    Quote Originally Posted by RyBack View Post
    It's probably because dmprecache.scr is executed 2 times every map.

    if(level.server_announc_glob!=true)
    level.server_announc_glob= true
    else
    end


    add this to the top of ur main func.
    problem solved
    Sorry I am still fairly new to this, Can you explain what main func is please ?

  9. #9

    Default

    Code:
    main:{	// <=== This is function, it's name is "main".
    
    	if(level.server_announc_glob!=true){
    		level.server_announc_glob= true		// <=== This is code RyBack send you on the top of "main" func.
    	}else{
    		end
    	}
    
    	while(1){
    		wait 15                               	// Tells script to wait given time in seconds.
    		stuffsrv("say Welcome to the server") 	// console msg.
    		wait 10
    		iprintln("Welcome to the server")        // the yellow game message which shows below the compass.
    		wait 10
    		iprintlnbold("Welcome to the server")   // the white game message which shows below the compass.
    	        wait45
      	}
    }end
    In simple words, function in programming is named part of a program which have to perform specific actions. It's good if you keep your functions small and it's good if one function have only one task to perform. In morpheus(MOHAA scripting language) functions usually begin like that:

    Code:
    my_awesome_function:{
    }end
    
    but more often I see:
    
    my_awesome_function:
    end
    Functions usually end with "end" statement which tells, obviously, that this is end of function named my_awesome_function. It's worth mentioning that you can call function inside other function, it will help you later if you will take up modifying your own server and scripts or if you would like to understand what the hell someone is doing in his code.

    Code:
    main:{	// <=== This is function, it's name is "main".
    
    	if(level.server_announc_glob!=true){
    		level.server_announc_glob= true			// <=== This is code RyBack send you on the top of "main" func.
    	}else{
    		end
    	}
    
    	thread my_awesome_function //<====== Calling function my_awesome_function.
    }end
    
    my_awesome_function:{ 
    	while(1){
    		wait 15                               	// Tells script to wait given time in seconds.
    		stuffsrv("say Welcome to the server") 	// console msg.
    		wait 10
    		iprintln("Welcome to the server")      // the yellow game message which below the compass.
    		wait 10
    		iprintlnbold("Welcome to the server")  // the white game message which below the compass.
    		wait45
      	}
    }end
    Function named my_awesome_function contains now code which is responsible for generating MOTD messages as a console or text under compass, but it's not used anywhere, game doesn't know what to do with it, so we have just unused set of instructions. To start using it we can call this function inside "main" function, by typing: thread functionname. And now this code will do exact same thing like in first []code brackets. Sorry if I'm explaining it to you in a bit chaotic maneer, I'm still sleepy. :P

    With the same logic you can call functions even from other scripts:
    Code:
    exec folderwherefileis/filename.scr::functionname
    Last edited by Criminal; November 2nd, 2018 at 06:08 AM.

  10. #10

    Default

    Quote Originally Posted by Criminal View Post
    Code:
    main:{	// <=== This is function, it's name is "main".
    
    	if(level.server_announc_glob!=true){
    		level.server_announc_glob= true		// <=== This is code RyBack send you on the top of "main" func.
    	}else{
    		end
    	}
    
    	while(1){
    		wait 15                               	// Tells script to wait given time in seconds.
    		stuffsrv("say Welcome to the server") 	// console msg.
    		wait 10
    		iprintln("Welcome to the server")        // the yellow game message which shows below the compass.
    		wait 10
    		iprintlnbold("Welcome to the server")   // the white game message which shows below the compass.
    	        wait45
      	}
    }end
    In simple words, function in programming is named part of a program which have to perform specific actions. It's good if you keep your functions small and it's good if one function have only one task to perform. In morpheus(MOHAA scripting language) functions usually begin like that:

    Code:
    my_awesome_function:{
    }end
    
    but more often I see:
    
    my_awesome_function:
    end
    Functions usually end with "end" statement which tells, obviously, that this is end of function named my_awesome_function. It's worth mentioning that you can call function inside other function, it will help you later if you will take up modifying your own server and scripts or if you would like to understand what the hell someone is doing in his code.

    Code:
    main:{	// <=== This is function, it's name is "main".
    
    	if(level.server_announc_glob!=true){
    		level.server_announc_glob= true			// <=== This is code RyBack send you on the top of "main" func.
    	}else{
    		end
    	}
    
    	thread my_awesome_function //<====== Calling function my_awesome_function.
    }end
    
    my_awesome_function:{ 
    	while(1){
    		wait 15                               	// Tells script to wait given time in seconds.
    		stuffsrv("say Welcome to the server") 	// console msg.
    		wait 10
    		iprintln("Welcome to the server")      // the yellow game message which below the compass.
    		wait 10
    		iprintlnbold("Welcome to the server")  // the white game message which below the compass.
    		wait45
      	}
    }end
    Function named my_awesome_function contains now code which is responsible for generating MOTD messages as a console or text under compass, but it's not used anywhere, game doesn't know what to do with it, so we have just unused set of instructions. To start using it we can call this function inside "main" function, by typing: thread functionname. And now this code will do exact same thing like in first []code brackets. Sorry if I'm explaining it to you in a bit chaotic maneer, I'm still sleepy. :P

    With the same logic you can call functions even from other scripts:
    Code:
    exec folderwherefileis/filename.scr::functionname
    That is a very long description for "func" I bet the guy regret that he even asked xDxD

Posting Permissions

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