[Resource] BO2 GSC Animated Welcome Messages

Topic created · 7 Posts · 262 Views
  • 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("");
    }
    
  • @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.

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

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

  • @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("");
    }
    
  • Yes, i fixied the code after your question, was my bad, and in meanwhile i add custom position version, thanks

Log in to reply