Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. BO2 Modding Releases & Resources
  3. [Resource] BO2 GSC Animated Welcome Messages

[Resource] BO2 GSC Animated Welcome Messages

Scheduled Pinned Locked Moved BO2 Modding Releases & Resources
9 Posts 4 Posters 2.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Sorexundefined Offline
    Sorexundefined Offline
    Sorex Contributor
    wrote on last edited by Mr. Android
    #1

    BO2 All kind of welcome messages
    Developer DoktorSAS

    I made a few functions to make animated welcome messages, all information about the code are inside the code, for any problems write a post under this.

    onPlayerSpawned(){
    	self endon("disconnect");
    	level endon("game_ended");
    	self waittill("spawned_player");
    	self iprintln("Welcome To *ServerName*\nSecond Line\nThird Line");
    	self iprintlnbold("Welcome To *ServerName*\nSecond Line\nThird Line");
    	WelcomeMessage("Welcome To *ServerName*\n Second Line");
            self thread AnimatedTextCUSTOMPOS("Welcome To *ServerName*", <insertXpos>, <insertYpos>);
    	self thread AnimatedTextTOP("Welcome To *ServerName*");
    	self thread AnimatedTextCENTER("Welcome To *ServerName*");
    	self thread AnimatedTextBOTTOM("Welcome To *ServerName*");
            self thread AnimatedTextCUSTOMPOSScrolling("Welcome To *ServerName*", <insertYpos>);
    	self thread AnimatedTextTOPScrolling("Welcome To *ServerName*");
    	self thread AnimatedTextCENTERScrolling("Welcome To *ServerName*");
    	self thread AnimatedTextBOTTOMScrolling("Welcome To *ServerName*");
    	for(;;){
    		self waittill("spawned_player");
    		/*Put There if u need something there*/
    	}
    }
    WelcomeMessage(line1, line2, icon, glow){
    	hmb=spawnstruct();
    	hmb.titleText=line1;
    	hmb.notifyText=line2;
    	hmb.iconName=icon;
    	hmb.glowColor=glow;
    	hmb.hideWhenInMenu=true;
    	hmb.archived=false;
    	self thread maps\mp\gametypes\_hud_message::notifyMessage(hmb);
    }
    AnimatedTextCUSTOMPOS(text, x, y){ //Made by DoktorSAS
    	textSubStr = getSubStr(text,0,text.size);
    	result = "";
    	self.welcome = self createFontString("objective",2);
    	self.welcome setPoint("CENTER","CENTER",x, y);
    	self.welcome setText("");	
    	for(i=0;i<textSubStr.size;i++){
    		result = result + textSubStr[i];
    		self.welcome setText(result);
    		wait 0.5;
    	}
    	self.welcome setText("");
    }
    AnimatedTextTOP(text){ //Made by DoktorSAS
    	textSubStr = getSubStr(text,0,text.size);
    	result = "";
    	self.welcome = self createFontString("objective",2);
    	self.welcome setPoint("CENTER","CENTER",0,-200);
    	self.welcome setText("");	
    	for(i=0;i<textSubStr.size;i++){
    		result = result + textSubStr[i];
    		self.welcome setText(result);
    		wait 0.5;
    	}
    	self.welcome setText("");
    }
    AnimatedTextCENTER(text){ //Made by DoktorSAS
    	textSubStr = getSubStr(text,0,text.size);
    	result = "";
    	self.welcome = self createFontString("objective",2);
    	self.welcome setPoint("CENTER","CENTER",0,0);
    	self.welcome setText("");	
    	for(i=0;i<textSubStr.size;i++){
    		result = result + textSubStr[i];
    		self.welcome setText(result);
    		wait 0.5;
    	}
    	self.welcome setText("");
    }
    AnimatedTextBOTTOM(text){ //Made by DoktorSAS
    	textSubStr = getSubStr(text,0,text.size);
    	result = "";
    	self.welcome = self createFontString("objective",2);
    	self.welcome setPoint("CENTER","CENTER",0,200);
    	self.welcome setText("");	
    	for(i=0;i<textSubStr.size;i++){
    		result = result + textSubStr[i];
    		self.welcome setText(result);
    		wait 0.5;
    	}
    	self.welcome setText("");
    }
    AnimatedTextCUSTOMPOSScrolling(text, y){ //Made by DoktorSAS
    	self.welcome = self createFontString("objective",2);
    	self.welcome setPoint("CENTER","CENTER",-600,y);
    	self.welcome setText("");	
    	for(pos=-600;pos<=600;pos = pos + 3){
    		self.welcome setPoint("CENTER","CENTER",pos,y);
    		self.welcome setText(text);
    		wait 0.02;
    	}
    	self.welcome setText("");
    }
    AnimatedTextTOPScrolling(text){ //Made by DoktorSAS
    	self.welcome = self createFontString("objective",2);
    	self.welcome setPoint("CENTER","CENTER",-600,-200);
    	self.welcome setText("");	
    	for(pos=-600;pos<=600;pos = pos + 3){
    		self.welcome setPoint("CENTER","CENTER",pos,-200);
    		self.welcome setText(text);
    		wait 0.02;
    	}
    	self.welcome setText("");
    }
    AnimatedTextCENTERScrolling(text){ //Made by DoktorSAS
    	self.welcome = self createFontString("objective",2);
    	self.welcome setPoint("CENTER","CENTER",-600,0);
    	self.welcome setText("");	
    	for(pos=-600;pos<=600;pos = pos + 3){
    		self.welcome setPoint("CENTER","CENTER",pos,0);
    		self.welcome setText(text);
    		wait 0.02;
    	}
    	self.welcome setText("");
    }
    AnimatedTextBOTTOMScrolling(text){ //Made by DoktorSAS
    	self.welcome = self createFontString("objective",2);
    	self.welcome setPoint("CENTER","CENTER",-600,200);
    	self.welcome setText("");	
    	for(pos=-600;pos<=600;pos = pos + 3){
    		self.welcome setPoint("CENTER","CENTER",pos,0);
    		self.welcome setText(text);
    		wait 0.02;
    	}
    	self.welcome setText("");
    }
    
    Kalitosundefined 2 Replies Last reply
    1
    • Kalitosundefined Offline
      Kalitosundefined Offline
      Kalitos
      replied to Sorex on last edited by
      #2

      Sorex Good contribution, just needed something like this for what I try to develop.
      But I have a problem. The message from the bottom position works fine, but not the messages from the top and middle positions.
      I leave you an image to understand better:
      https://gyazo.com/c6ba525465368e0022cfbd02e6d25874

      The letter "W" remains permanent and the animation does not develop, it does not even disappear.

      Cahzundefined 1 Reply Last reply
      0
      • Cahzundefined Offline
        Cahzundefined Offline
        Cahz VIP
        replied to Kalitos on last edited by
        #3

        Kalitos I think this is because you're testing all of them at once, and they all seem to use

        self.welcome
        

        so im pretty sure if you change them up to be different, it would work.

        self.welcome1
        self.welcome2, ect.
        
        1 Reply Last reply
        0
        • Sorexundefined Offline
          Sorexundefined Offline
          Sorex Contributor
          wrote on last edited by Sorex
          #4

          Yes Cahz is right, mine code is a simple base.
          Kalitos if u want use all code at same time u need to change self.welcome with another name, mine code are a base, u can use one of them or all.
          The problem depends form variable with same name
          If u want use all do this:

          onPlayerSpawned(){
          	self endon("disconnect");
          	level endon("game_ended");
          	self waittill("spawned_player");
          	self iprintln("Welcome To *ServerName*\nSecond Line\nThird Line");
          	self iprintlnbold("Welcome To *ServerName*\nSecond Line\nThird Line");
          	WelcomeMessage("Welcome To *ServerName*\n Second Line");
          	for(;;){
          		self waittill("spawned_player");
          		/*Put There if u need something there*/
          	}
          }
          AnimatedTextTOP(text){ //Made by DoktorSAS
          	textSubStr = getSubStr(text,0,text.size);
          	result = "";
          	self.welcomeTOP = self createFontString("objective",2);
          	self.welcomeTOP setPoint("CENTER","CENTER",0,-200);
          	self.welcomeTOP setText("");	
          	for(i=0;i<textSubStr.size;i++){
          		result = result + textSubStr[i];
          		self.welcomeTOP setText(result);
          		wait 0.5;
          	}
          	self.welcomeTOP setText("");
          }
          AnimatedTextCENTER(text){ //Made by DoktorSAS
          	textSubStr = getSubStr(text,0,text.size);
          	result = "";
          	self.welcomeCENTER = self createFontString("objective",2);
          	self.welcomeCENTER setPoint("CENTER","CENTER",0,0);
          	self.welcomeCENTER setText("");	
          	for(i=0;i<textSubStr.size;i++){
          		result = result + textSubStr[i];
          		self.welcomeCENTER setText(result);
          		wait 0.5;
          	}
          	self.welcomeCENTER setText("");
          }
          AnimatedTextBOTTOM(text){ //Made by DoktorSAS
          	textSubStr = getSubStr(text,0,text.size);
          	result = "";
          	self.welcomeBOTTOM = self createFontString("objective",2);
          	self.welcomeBOTTOM setPoint("CENTER","CENTER",0,200);
          	self.welcomeBOTTOM setText("");	
          	for(i=0;i<textSubStr.size;i++){
          		result = result + textSubStr[i];
          		self.welcomeBOTTOM setText(result);
          		wait 0.5;
          	}
          	self.welcomeBOTTOM setText("");
          }
          

          If there any question i'll respond

          Kalitosundefined 1 Reply Last reply
          0
          • Kalitosundefined Offline
            Kalitosundefined Offline
            Kalitos
            replied to Sorex on last edited by
            #5

            Cahz Sorex It seems to make sense, I didn't think about it. Thank you. I will prove it.

            1 Reply Last reply
            0
            • Kalitosundefined Offline
              Kalitosundefined Offline
              Kalitos
              replied to Sorex on last edited by Kalitos
              #6

              Sorex Here you have to make a slight change.

              AnimatedTextBOTTOMScrolling(text){ //Made by DoktorSAS
              	self.welcome = self createFontString("objective",2);
              	self.welcome setPoint("CENTER","CENTER",-600,200);
              	self.welcome setText("");	
              	for(pos=-600;pos<=600;pos = pos + 3){
              		self.welcome setPoint("CENTER","CENTER",pos,200); // **Change "0" to "200" in BOTTOMScrolling.**
              		self.welcome setText(text);
              		wait 0.02;
              	}
              	self.welcome setText("");
              }
              
              1 Reply Last reply
              0
              • Sorexundefined Offline
                Sorexundefined Offline
                Sorex Contributor
                wrote on last edited by
                #7

                Yes, i fixied the code after your question, was my bad, and in meanwhile i add custom position version, thanks

                1 Reply Last reply
                0
                • Munnopolyundefined Offline
                  Munnopolyundefined Offline
                  Munnopoly
                  wrote on last edited by
                  #8

                  DoktorSAS You should add these to your Github and make them more comprehensive if you think its worth.

                  1 Reply Last reply
                  0
                  • Sorexundefined Offline
                    Sorexundefined Offline
                    Sorex Contributor
                    wrote on last edited by
                    #9

                    Munnopoly The code in this page is garbage. At the time i was learning code but there is a better way to do this animated text by using the moveovertime and fadeovertime.
                    This is the generic function i use for all the new mods i develop:

                    affectElement(type, time, value)
                    {
                    	if (type == "x" || type == "y")
                    		self moveOverTime(time);
                    	else
                    		self fadeOverTime(time);
                    	if (type == "x")
                    		self.x = value;
                    	if (type == "y")
                    		self.y = value;
                    	if (type == "alpha")
                    		self.alpha = value;
                    	if (type == "color")
                    		self.color = value;
                    }
                    
                    1 Reply Last reply
                    0

                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Donate