Skip to content
  • 0 Unread 0
  • Recent
  • Popular
  • Users
  • Donate
Collapse
Home Docs Stats Discord Donate
Download
TheHiddenHour

TheHiddenHour

@TheHiddenHour
Contributor
Unfollow Follow
About
Posts
55
Topics
1
Shares
0
Groups
1
Followers
7
Following
4

Posts

Recent Best Controversial

  • How to turn off wall density/make all walls "bangable"
    TheHiddenHour TheHiddenHour
    BO2 Modding Support & Discussion

    w00dy I don't remember which ones in particular, I think perk_bulletPenetrationMultiplier?


  • How to turn off wall density/make all walls "bangable"
    TheHiddenHour TheHiddenHour
    BO2 Modding Support & Discussion

    You need to increase the max values of the penetration DVARs with a plugin.


  • Any Help With Ping?
    TheHiddenHour TheHiddenHour
    BO2 Modding Support & Discussion black ops 2 gsc ping question

    Deicide I doubt it's accessible through GSC but you could probably do it using a plugin. SV_GetClientPing comes to mind.

    EDIT: Address for SV_GetClientPing is 0x4F1160 if you're interested.


  • Hi, i need help to learn
    TheHiddenHour TheHiddenHour
    BO2 Modding Support & Discussion

    There's no definitive guide or tutorial but there's a few floating around.

    This is a good starter: Call of Duty 5: Scripting Syntax And Grammar

    Here's a video if it's more your style: CoD 5/CoD BO3 Custom Scripting: #1 - Introduction to GSC Game Script

    Google "call of duty gsc" and you'll find a few resources.


  • GSC Waitill score / points increases
    TheHiddenHour TheHiddenHour
    BO2 Modding Support & Discussion

    Lewis5441 There's a couple ways of checking for score changes but I'm unaware of a notify for it. Here's a simple method though.

    scoreMonitor() {
    	self endon("disconnect");
    	self endon("game_ended");
    	
    	// Setup variables required for monitoring score 
    	currentScore = self.pers["score"];
    	previousScore = currentScore;
    	
    	for(;;) {
    		// Check for score change 
    		currentScore = self.pers["score"];
    		if(currentScore != previousScore) {
    			// Update previous score 
    			previousScore = currentScore;
    			// Insert your code here 
    			self iprintln(self.name + "'s score has changed!");
    		}
    		
    		wait 0.05;
    	}
    }
    

  • Using r_xxxx dvars through a GSC file?
    TheHiddenHour TheHiddenHour
    BO2 Modding Support & Discussion

    @Dev-Ultimateman Can you show the code you've already tried? You'd generally do something like setDvar("r_skyTransition", "1"); in init().


  • Seeking A Developer
    TheHiddenHour TheHiddenHour
    BO2 Modding Support & Discussion

    An open source prop hunt gamemode already exists but I can develop another if commissioned.


  • How can I find out the number of players on a team?
    TheHiddenHour TheHiddenHour
    BO2 Modding Support & Discussion

    There's probably a built in function to do it but you can write a simple one like this.

    getTeamCount(team) {
    	count = 0;
    	foreach(player in level.players) {
    		if(player.team == team) {
    			count++;
    		}
    	}
    	
    	return count;
    }
    

  • i need help with this code
    TheHiddenHour TheHiddenHour
    BO2 Modding Support & Discussion

    Duui YT

    wait 17;
    self iprintlnbold("^2Crouch and Press [{+actionslot 2}] To Save"); 
    wait 5;
    self iprintlnbold("^6Crouch and Press [{+actionslot 3}] To spawn slide");
    

  • Respawn on Saved Position Code?
    TheHiddenHour TheHiddenHour
    BO2 Modding Support & Discussion

    Duui YT I mean, what you've got already looks like it should work.


  • Respawn on Saved Position Code?
    TheHiddenHour TheHiddenHour
    BO2 Modding Support & Discussion

    Duui YT

    it says it is bad

    Elaborate.


  • Respawn on Saved Position Code?
    TheHiddenHour TheHiddenHour
    BO2 Modding Support & Discussion

    Duui YT

    if(isDefined(self.savedOrigin) && isDefined(self.savedAngles))
    		   self setPerk("specialty_fallheight");
    

    🤔

    if( self.status == "Host" || self.status == "Co-Host" || self.status == "Admin" || self.status == "VIP" || self.status == "Verified")
    		{
    			if (!self.MenuInit)
    			{
    		        self moveToSavedLocation();
    			}
    		}
    

    🤔 🤔 🤔

    Give this a try

    onplayerspawned()
    {
        self endon( "disconnect" );
        level endon( "game_ended" );
    	
        self freezecontrols(false);
        self.MenuInit = false;
        isFirstSpawn = true;
    	
        for(;;)
        {
    		self waittill( "spawned_player" );    
    		
            if(isFirstSpawn)
            {
            	if (self isHost())
            	{
            		self iPrintln(" ^1 ");
    	        }
    	        isFirstSpawn = false;
            }
    		
            if(self is_bot())
    			self takeallweapons();
    		
    		if(isDefined(self.savedOrigin) && isDefined(self.savedAngles))
    		   self moveToSavedLocation();
    	   
    		if( self.status == "Host" || self.status == "Co-Host" || self.status == "Admin" || self.status == "VIP" || self.status == "Verified")
    		{
    			if (!self.MenuInit)
    			{
    		        // self moveToSavedLocation();
    			}
    		}
        }
    } 
    

  • can i set a timed messages
    TheHiddenHour TheHiddenHour
    BO2 Modding Support & Discussion

    You can thread a function containing a for(;;) loop and a wait statement.

    timedMessage() {
    	level endon("game_ended");
    	
    	for(;;) {
    		allClientsPrint("This is a message printed to all players.");
    		
    		wait 45;
    	}
    }
    

    Call the function like level thread timedMessage(); in init().


  • Respawn on Saved Position Code?
    TheHiddenHour TheHiddenHour
    BO2 Modding Support & Discussion

    Duui YT Did you add the rest to onPlayerSpawned()?


  • Respawn on Saved Position Code?
    TheHiddenHour TheHiddenHour
    BO2 Modding Support & Discussion

    Duui YT Show me what you've got so far.


  • [Resource] Stat Modification, Checks, Other Structures..
    TheHiddenHour TheHiddenHour
    BO2 Modding Releases & Resources

    Nice thread, I wasn't aware of some of these structs.


  • Respawn on Saved Position Code?
    TheHiddenHour TheHiddenHour
    BO2 Modding Support & Discussion

    Duui YT If you commission me to write it, test it, and ensure that you incorporate it into your project properly then yeah lmao.

    Here's a simple example that should get you started if you know how to script

    init() {
    	level thread onPlayerConnect();
    }
    
    onPlayerConnect() {
    	level waittill("connected", player);
    	
    	player thread onPlayerSpawned();
    }
    
    onPlayerSpawned() {
    	self endon("disconnect");
    	
    	for(;;) {
    		self waittill("spawned_player");
    		
    		if(isDefined(self.savedOrigin) && isDefined(self.savedAngles)) {
    			self moveToSavedLocation();
    		}
    	}
    }
    
    // Set saved location 
    saveLocation() {
    	self.savedOrigin = self.origin;
    	self.savedAngles = self.angles;
    	
    	self iprintln("^1Saved location");
    }
    
    // Move entity to saved location 
    moveToSavedLocation() {
    	self setOrigin(self.savedOrigin);
    	self.angles = self.savedAngles; // Can't remember if there's a function to set an entity's angles 
    	
    	self iprintln("^1Moved to saved location");
    }
    
    // Erase saved location to prevent spawning on it 
    eraseSavedLocation() {
    	self.savedOrigin = undefined;
    	self.savedAngles = undefined;
    	
    	self iprintln("^1Saved location erased");
    }
    

  • Respawn on Saved Position Code?
    TheHiddenHour TheHiddenHour
    BO2 Modding Support & Discussion

    Duui YT Wouldn't doubt it, I write most of this when I'm sleep deprived lmao.


  • Respawn on Saved Position Code?
    TheHiddenHour TheHiddenHour
    BO2 Modding Support & Discussion

    Vulgar Put this in onPlayerSpawned() after the waittill

    if(isDefined(self.savedOrigin) && isDefined(self.savedAngles)) {
    	self setPlayerAngles(self.savedAngles);
    	self setOrigin(self.savedOrigin);
    }
    

  • Removing MMS & Target Finder Attachments [Bo2]
    TheHiddenHour TheHiddenHour
    BO2 Server Hosting Support

    @Vexbane
    Put level.givecustomloadout = ::givecustomloadout; in your init() function.

    Then paste this function somewhere in your script:

    givecustomloadout() {
    	weap = self getCurrentWeapon(); // Get the player's current weapon 
    	if(weaponHasAttachment(weap, "mms") || weaponHasAttachment(weap, "rangefinder")) { // Weapon has mms or target finder 
    		repl_weap = ""; // Ready a replacement weapon string 
    		tokens = strTok(weap, "+"); // Tokenize the current weapon string 
    		for(i = 0; i < tokens.size; i++) { // Iterate over every token 
    			token = tokens[i];
    
    			if(i == 0) { // The first token should always be the weapon name 
    				repl_weap += token; // Add weapon name to replacement string 
    			}
    			else { // Current token is not the weapon name 
    				if(token != "mms" && token != "rangefinder") { // Token is not the mms or rangefinder attachment 
    					repl_weap += "+" + token; // Add attachment to replacement string 
    				}
    			}
    		}
    
    		self takeWeapon(weap); // Take weapon with restricted attachment 
    		self giveWeapon(repl_weap); // Give replacement weapon 
    		if(weap == self.primaryLoadoutWeapon) { // If the weapon taken was the player's primary 
    			self switchToWeapon(repl_weap); // Switch to the replacement weapon 
    		}
    	}
    }
    

    I tested it very quickly and it seemed to work well. Let me know if you have any issues with it.

  • Login

  • Don't have an account? Register

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