• Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse

Plutonium

[Support] More than one custom GSC script?

Scheduled Pinned Locked Moved BO2 Modding Support & Discussion
11 Posts 6 Posters 859 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Trizzundefined Offline
    Trizzundefined Offline
    Trizz
    wrote on last edited by Mr. Android
    #1

    I already have the unlimited perks gsc but I have been trying to figure out how to add a second one (using gsc studio) I can't add another file called _clientids.gsc to the folder because obviously it will overwrite and if i try to add the script beneath the original it doesn't work I've also tried adding a new script file next to the main but that doesn't work either. any help would be much appreciated

    Cahzundefined 1 Reply Last reply
    0
  • JezuzLizardundefined Offline
    JezuzLizardundefined Offline
    JezuzLizard Plutonium Staff
    wrote on last edited by
    #2

    If zombies use _zm_bot.gsc place it in maps/mp/zombies. If you don't have a copy of it the contents are very limited anyway:

    #include maps/mp/zombies/_zm_utility;
    #include maps/mp/_utility;
    #include common_scripts/utility;
    
    init()
    {
    /#
    	println( "ZM >> Zombiemode Server Scripts Init (_zm_bot.gsc)" );
    #/
    }
    

    For multiplayer I would use _shellshock.gsc since its fairly small and its contents look like this:

    #include common_scripts/utility;
    #include maps/mp/_utility;
    
    init()
    {
    	precacheshellshock( "frag_grenade_mp" );
    	precacheshellshock( "damage_mp" );
    	precacherumble( "artillery_rumble" );
    	precacherumble( "grenade_rumble" );
    }
    
    shellshockondamage( cause, damage )
    {
    	if ( self maps/mp/_utility::isflashbanged() )
    	{
    		return;
    	}
    	if ( cause != "MOD_EXPLOSIVE" && cause != "MOD_GRENADE" && cause != "MOD_GRENADE_SPLASH" || cause == "MOD_PROJECTILE" && cause == "MOD_PROJECTILE_SPLASH" )
    	{
    		time = 0;
    		if ( damage >= 90 )
    		{
    			time = 4;
    		}
    		else if ( damage >= 50 )
    		{
    			time = 3;
    		}
    		else if ( damage >= 25 )
    		{
    			time = 2;
    		}
    		else
    		{
    			if ( damage > 10 )
    			{
    				time = 2;
    			}
    		}
    		if ( time )
    		{
    			if ( self mayapplyscreeneffect() )
    			{
    				self shellshock( "frag_grenade_mp", 0.5 );
    			}
    		}
    	}
    }
    
    endondeath()
    {
    	self waittill( "death" );
    	waittillframeend;
    	self notify( "end_explode" );
    }
    
    endontimer( timer )
    {
    	self endon( "disconnect" );
    	wait timer;
    	self notify( "end_on_timer" );
    }
    
    rcbomb_earthquake( position )
    {
    	playrumbleonposition( "grenade_rumble", position );
    	earthquake( 0.5, 0.5, self.origin, 512 );
    }
    

    Alternatively, if you have access to the source of the scripts you can attempt to merge them into one mod.

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

    Trizz if you are adding a new script, make sure you call the new script under OnPlayerSpawned.

    self waittill("spawned_player");
    self thread <scriptname>;
    

    Note that this works for MOST scripts and not all. I would highly recommend researching gsc. There are tons of resources out there. Even with only basic knowledge of gsc , you should be able to handle these things on your own.

    really good gsc tutorial: https://www.nextgenupdate.com/forums/black-ops-2-gsc-mods-scripts/764127-tutorial-basic-gsc-scripting.html

    1 Reply Last reply
    1
  • Trizzundefined Offline
    Trizzundefined Offline
    Trizz
    replied to JezuzLizard on last edited by
    #4

    Cahz I'm trying to add a script to this would it go at the bottom and if so how would i put it? I'm not trying to be spoonfed I'm just sort of struggling tbh 70577d43-afec-46bb-b75e-7bbdee0bbc76-image.png

    1 Reply Last reply
    0
  • tedundefined Offline
    tedundefined Offline
    ted
    wrote on last edited by
    #5

    Can you explain what you are trying to add so we can better assist? Are you trying to spawn with perks/a gun, etc?

    Trizzundefined 1 Reply Last reply
    0
  • Ox_undefined Offline
    Ox_undefined Offline
    Ox_
    wrote on last edited by
    #6

    In that perk limit script, there is only one significant line, the rest don't mean anything.
    So maybe just transfer that one significant line (level.perk_purchase_limit = 9;) into that other script you're trying to use.

    1 Reply Last reply
    0
  • Ducxyundefined Offline
    Ducxyundefined Offline
    Ducxy
    wrote on last edited by
    #7

    why are you trying to add multiple GSC files? you can put basically an infinity amount of code into a single GSC file. you dont need multiple just to add a new script

    1 Reply Last reply
    0
  • Trizzundefined Offline
    Trizzundefined Offline
    Trizz
    wrote on last edited by
    #8

    Ducxy how would i start the second script though? like just start on the line after or something. ted I'm trying to add jugg at round one just for the example for myself so i can see how it's done. then after that works i'm gonna see if there is anything i can do about adding a max ammo refills clip script.

    1 Reply Last reply
    0
  • Trizzundefined Offline
    Trizzundefined Offline
    Trizz
    replied to ted on last edited by Trizz
    #9

    ted The top works but the bottom don't basically dddddd.PNG

    tedundefined 1 Reply Last reply
    0
  • tedundefined Offline
    tedundefined Offline
    ted
    replied to Trizz on last edited by
    #10

    Trizz It's not going to work because you've just copy and paste'd both into one file. You're calling functions with the same name but to do different things.
    f245c207-136b-4abb-ac2d-b1b18572f427-image.png

    I don't know how to explain it without confusing you more so just use this instead:

    #include maps\mp\_utility;
    #include common_scripts\utility;
    #include maps\mp\zombies\_zm;
    #include maps\mp\zombies\_zm_utility;
    
    init()
    {
    	level.clientid = 0;
    	level.perk_purchase_limit = 9;
    	level thread onplayerconnect();
    }
    
    onplayerconnect()
    {
    	for ( ;; )
    	{
    		level waittill( "connecting", player );
    		player.clientid = level.clientid;
    		player thread onplayerspawned();
    		level.clientid++;
    	}
    }
    
    onplayerspawned()
    {
    	level endon( "game_ended" );
            self endon( "disconnect" );
    	
    	for(;;)
    	{
    		self welcome();
    	}
    }
    
    welcome()
    {
        self waittill( "spawned_player" );
        self maps/mp/zombies/_zm_perks::give_perk( "specialty_armorvest" );
        wait 7;
        self iprintln("^2" +self.name + "^7 , your perk limit has been removed");
    }
    
    Trizzundefined 1 Reply Last reply
    0
  • Trizzundefined Offline
    Trizzundefined Offline
    Trizz
    replied to ted on last edited by
    #11

    ted said in More than one custom GSC script?:

    #include maps\mp_utility;
    #include common_scripts\utility;
    #include maps\mp\zombies_zm;
    #include maps\mp\zombies_zm_utility;

    init()
    {
    level.clientid = 0;
    level.perk_purchase_limit = 9;
    level thread onplayerconnect();
    }

    onplayerconnect()
    {
    for ( ;; )
    {
    level waittill( "connecting", player );
    player.clientid = level.clientid;
    player thread onplayerspawned();
    level.clientid++;
    }
    }

    onplayerspawned()
    {
    level endon( "game_ended" );
    self endon( "disconnect" );

    for(;;)
    {
    self welcome();
    }
    }

    welcome()
    {
    self waittill( "spawned_player" );
    self maps/mp/zombies/_zm_perks::give_perk( "specialty_armorvest" );
    wait 7;
    self iprintln("^2" +self.name + "^7 , your perk limit has been removed");
    }

    Thanks for the script. I will try to practice some more, i appreciate it

    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
  • Login

  • Don't have an account? Register

  • Login or register to search.