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

Plutonium

bhfffundefined

bhfff

@bhfff
About
Posts
27
Topics
12
Shares
0
Groups
0
Followers
12
Following
8

Posts

Recent Best Controversial

  • Question about having a secondary account on Plutonium
    bhfffundefined bhfff

    Hello, I'm developing a gsc mod for BO1 zombies and sometimes I just wish I could quickly test its features on multiple clients.

    Since we don't have a spawn client / bot function for zombies, this could be an alternative solution.

    But I'm worried I will trigger some soft of ban. Would it be possible to have a secondary account for developing purposes? ( I would name it bhfff2 )

    General Discussion

  • Unable to #include custom .gsc and maps/ scripts
    bhfffundefined bhfff

    Hello, I'm pretty lost right now as I have no idea what I'm doing wrong.

    I want to test my gsc code for zombies, but it seems like my files aren't getting loaded.

    Here's a screenshot of my current setup:
    alt text

    and here's my console output.

    +                                                                                                                       maps/so_narrative2_frontend_anim                                                                                        Loading script "scripts/zm_dragitz_init"...                                                                             scripts/zm_dragitz_init                                                                                                 Error:                                                                                                                  ******* Server script compile error *******                                                                             Error: Could not find script 'dragitz_lib/zm_dragitz_custom_functions'                                                  ************************************                                                                                                                                                                                                            ====================================================                                                                    Com_ERROR: ^U Server script compile error                                                                               Could not find script 'dragitz_lib/zm_dragitz_custom_functions'                                                                                                                                                                                 (see console for details)                                                                                                                                                                                                                       ====================================================                                                                                                                                                                                            Plutonium r3178> 
    

    Edit: for some reason, the above console output is badly formatted

    I think I have looked pretty much everywhere, but I can not find any code example to including custom files. The best examples are here but, unfortunately, no example code is shown.
    https://plutonium.pw/docs/modding/gsc/how-to-gsc/#including-other-gsc
    https://plutonium.pw/docs/modding/gsc/new-scripting-features/#custom-named-scripts-specifics

    The other solution would be putting all files in \scripts\ , but then another problem arises.

    Some of the .gsc scripts in map, can not be loaded.

    I'll give an example:

    The following string:

    monkey_zombie = self maps\_zombiemode_net::network_safe_stalingrad_spawn( "monkey_zombie_spawn", 1 );
    

    throws: Could not find script 'maps/_zombiemode_net' in the console

    I fully understand that custom_scripts::main() is called before anything else, but the string is in its own function.
    Also#include maps\_utility; loads without problems, so I don't understand why maps/_zombiemode_net can't be found.

    Unfortunately I can not attach .zip / .7z files, so below you can find the minimal code for reproduction of this behaviour.

    #include maps\_utility;
    #include common_scripts\utility;
    
    /*
    
    _zombiemode_ai_monkey.gsc
    The following function has been taken from _zombiemode_ai_monkey.gsc for a different purpose, so the original code wouldn't be affected.
    		
    */
    
    BRUDDA_monkey_zombie_spawn( OWNER ){	
    	
    	pack = OWNER;
    	
    	self.script_moveoverride = true; 
    	
    	if( !isDefined( level.num_monkey_zombies ) )
    	{
    		level.num_monkey_zombies = 0;
    	}
    	level.num_monkey_zombies++;
    	
    	monkey_zombie = self maps\_zombiemode_net::network_safe_stalingrad_spawn( "monkey_zombie_spawn", 1 );
    	
    	monkey_zombie.team = "allies";
    	
    	monkey_zombie.owner = OWNER;
    	
    	self.count = 666;
    
    	self.last_spawn_time = GetTime();
    
    	if( !spawn_failed( monkey_zombie ) ) 
    	{ 
    		monkey_zombie.script_noteworthy = self.script_noteworthy;
    		monkey_zombie.targetname = self.targetname;
    		monkey_zombie.target = self.target;
    		monkey_zombie.deathFunction = maps\_zombiemode_ai_monkey::monkey_zombie_die;
    		monkey_zombie.animname = "monkey_zombie";
    
    		monkey_zombie.pack = OWNER;
    		monkey_zombie.ground_hit_time = pack.ground_hit_time;
    
    		monkey_zombie.spawn_origin = self.origin;
    		monkey_zombie.spawn_angles = self.angles;
    
    		monkey_zombie.team = "allies";
    		
    		monkey_zombie thread monkey_zombie_think();
    	}
    
    
    	return monkey_zombie;
    }
    
    BO1 Modding Support & Discussion

  • [ZM] Function to check if the current held gun is a shotgun
    bhfffundefined bhfff

    Hello, bo1 doesn't seem to have a function specifically made to check for held shotguns (only semi-automatic weapons).

    Hopefully it will help your developent a little 🙂

    weaponIsShotGun(CurrentWeapon)
    {
    
    if(CurrentWeapon == "ithaca_zm" || CurrentWeapon == "spas_zm" || 
       CurrentWeapon == "rottweil72_zm" || CurrentWeapon == "hs10_zm")
       {
    	return true;
       }
    
    if(CurrentWeapon == "ithaca_upgraded_zm" || CurrentWeapon == "spas_upgraded_zm" || 
       CurrentWeapon == "rottweil72_upgraded_zm" || CurrentWeapon == "hs10_upgraded_zm")
       {
    	return true;
       }
    
    return false;
    }
    
    BO1 Modding Releases & Resources

  • Max_Gamestate_Chars_Exceeded
    bhfffundefined bhfff

    Quote from another forum:

    Gamestate is all the information needed to initially transmit game state
    information from the server to the client. There is a fixed maximum
    size to this data of around 30,000 bytes instituted by IW/GMI. When you
    exceed this limit you get a "Max_Gamestate_Chars_Exceeded" error.
    Gamestate includes ALL scripts for the map, EFX, Vehicles, and ALL models.
    Mods and other 'enhancements' contribute to this load. Each player
    joining contributes. Many custom maps and projects are running into
    this limit. The only suggestion is too remove some or all mods that may
    add data size.
    

    is there a way to debug the current data size being sent?

    BO2 Modding Support & Discussion

  • Using ammo in stock instead of clip
    bhfffundefined bhfff

    Solved, here's the code! Remember to run this in a loop 🙂

    // We need to make sure the player shot and is holding the shooting button
    if(self isFiring() && self attackButtonPressed()){
    
    	// Use stock instead of clip
    	if( self GetWeaponAmmoStock( self getCurrentWeapon() ) > 0)
    	{
    			
    		ClipSize = WeaponClipSize( self getCurrentWeapon() );
    		CurrentClip = self GetWeaponAmmoClip( self getCurrentWeapon() );
    		CurrentClipDiff = ClipSize - CurrentClip;
    		
    		CurrentStock = self GetWeaponAmmoStock( self getCurrentWeapon() );
    		
    		self setWeaponAmmoClip(self getCurrentWeapon(), ClipSize);
    		self setWeaponAmmoStock(self getCurrentWeapon(), CurrentStock - CurrentClipDiff);
    	
    	}
    }
    

    I'm unsure how this would work for dual wield weapons, the following might work for World at War but unsure about other games

    Add this to any if statement:

    && !maps\_zombiemode_weapons::weapon_is_dual_wield( CurrentWeapon ) 
    
    BO2 Modding Support & Discussion

  • Using ammo in stock instead of clip
    bhfffundefined bhfff

    I wanted to add that the first part of the code, works if your weapon is automatic.

    Otherwise there's a delay that must be calculated.

    BO2 Modding Support & Discussion

  • Using ammo in stock instead of clip
    bhfffundefined bhfff

    Hi I'm relatively new to modding but I know my way around. I can read an understand what the code is doing.

    I'm trying to recreate the Ring of Fire specifically its tier 3 effect, where the player uses its ammo in stock instead of the clip.

    The basic concept is to put the following code into a loop (hopefully it's properly formatted)

    if(self isFiring() && self attackButtonPressed())
    {
    
    	if( self GetWeaponAmmoStock( self getCurrentWeapon() ) > 0 )
    	{
    		self setWeaponAmmoClip(self getCurrentWeapon(), self GetWeaponAmmoClip( self getCurrentWeapon() )+1);
    		self setWeaponAmmoStock(self getCurrentWeapon(), self GetWeaponAmmoStock( self getCurrentWeapon() )-1);
    	}
    }
    					
    

    The problem it's not smooth and the bullets in the clip can still decrease. I thought about using this, but it doesn't help.

    // Use ammo from stock
    if( self GetWeaponAmmoStock( self getCurrentWeapon() ) != 0 )
    {	
       self setClientDvar("sf_use_ignoreammo", "1");
    	
    } else {
    
       self setClientDvar("sf_use_ignoreammo", "0");
    }
    

    I also can't use dvars such as player_sustainAmmo 1 because it's globally applied.

    Here's a function that calculates the time between shots:
    ( I thought about using it as a delay, but it came out it's a bad idea )

    self.timeBetweenShots = gettime() - self.lastShotTime;
    self iprintln(self.timeBetweenShots / 1000);
    
    if(self isFiring() && self attackButtonPressed())
    {
       self.lastShotTime = gettime();
    }
    

    I couldn't find any function related to when a player is shooting or more specifically a function that detects change in ammunition.

    So right now I'm kinda lost, as I really want to make it smooth (aka the ammo in the clip has to stay still) but I also want a code that works for every weapon (considering their rate of fire).

    Also, this one is too slow 😞
    self waittill("weapon_fired");

    Any tips?

    BO2 Modding Support & Discussion
  • 1
  • 2
  • 2 / 2
  • Login

  • Don't have an account? Register

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