Results 1 to 4 of 4
  1. #1
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,802
    Reputation
    3165
    Thanks
    73,317
    My Mood
    Breezy

    Modding changes from MW2 to Black Ops

    As some of you may have already known, there have been some slight alterations to modding and coding in GSCs. Some functions and some have been removed. Here are some significant changes in Black Ops.

    notifyOnPlayerCommand is no longer supported. In MW2 this was a good way to open custom menus and do custom functions but this was removed in Black Ops possibly because it served no pupose. Now, you have to use a while statement with an if statement saying if the button was pressed or not. This can be inconvenient if a somethingbuttonPressed() wasn't created for the thing you wanted. Like if I wanted to use weapnext, there's no such thing as weapnextButtonPressed().

    Example:
    Code:
    Modern Warfare 2:
    self notifyOnPlayerCommand("frag", "+frag");
    while(1) {
        self waittill("frag");
        //Do functions here
    }
    
    Black Ops:
    while(1) {
        if(self fragButtonPressed()) {
            //Whatever functions here
        }
        wait 0.01;
    }
    Here a list of buttonPressed functions you can use:
    Code:
    AdsButtonPressed()
    AttackButtonPressed()
    MeleeButtonPressed()
    UseButtonPressed()
    ActionSlotOneButtonPressed() //X
    ActionSlotTwoButtonPressed() //not sure do they exist (7)
    ActionSlotThreeButtonPressed() // not sure do they exist (5)
    actionSlotFourButtonPressed() //6
    ThrowButtonPressed() //uhhhhh, +speed_throw? That would be MOUSE2 then.
    changeSeatButtonPressed() //wut?
    jumpButtonPressed() //space
    fragButtonPressed() //G/MOUSE3
    secondaryOffhandButtonPressed() //4
    Thanks Deathmax!

    foreach has also been removed in Black Ops. This was useful in MW2 if you wanted to do something like foreach(player in level.players) but this function doesn't exist any longer, possibly because it is a 'lazy' way or shortcut to using a for statement.

    Example:
    Code:
    Modern Warfare 2:
    foreach(player in level.players) {
        player suicide();
    }
    
    //===============
    
    weaponsList = self getWeaponsListAll();
    foreach(weapon in weaponsList) {
        self setWeaponAmmoStock(weapon, 99999);
        self setWeaponAmmoClip(weapon, 99999);
    }
    
    Black Ops:
    for(i = 0; i < level.players.size; i++) {
        level.players[i] suicide();
    }
    
    //===============
    
    weaponsList = self getWeaponsList();
    for(i = 0; i < weaponsList.size; i++) {
        self setWeaponAmmoStock(weaponsList[i], 99999);
        self setWeaponAmmoClip(weaponsList[i], 99999);
    }
    Using a function on a variable that hasn't been declared (even if it has self.whatever) now generates syntax errors, in MW2 this was useful in creating or 'refreshing' font strings over and over again.

    Example:
    Code:
    Modern Warfare 2:
    self.someText destroy();
    self.someText = self createFontString("default", 2);
    self.someText setPoint("CENTER", "CENTER", "CENTER", "CENTER");
    self.someText setText("This is a test!");
    
    Black Ops:
    if(isDefined(self.someText)) {
        self.someText destroy();
    }
    self.someText = self createFontString("default", 2);
    self.someText setPoint("CENTER", "CENTER", "CENTER", "CENTER");
    self.someText setText("This is a test!");
    Just a mini-note, setPoint seems to be a little buggy on Black Ops so you can use the following instead:
    Code:
    Using codes only:
    self.someText.alignX = "CENTER"; //X position
    self.someText.alignY = "CENTER"; //Y position
    self.someText.X = 0; //X offset
    self.someText.Y = 0; //Y offset
    
    Using a function:
    setPosition(alignX, alignY, X, Y)
    {
        if(!isDefined(X)) {
            X = 0;
        }
        if(!isDefined(Y)) {
            Y = 0;
        }
        self.alignX = alignX;
        self.alignY = alignY;
        self.X = X;
        self.Y = Y;
    }
    
    //How to use:
    //self.someText setPosition("CENTER", "CENTER");
    //or
    //self.someText setPosition("CENTER", "CENTER", -20, 10);
    Any more changes? Let me know here, kinda got this all from the top of my head since I'm not at home.
    Last edited by master131; 12-03-2010 at 07:08 PM.
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.6.1 *NEW* Windows 10 compatible!
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  2. The Following 3 Users Say Thank You to master131 For This Useful Post:

    AZUMIKKEL (12-03-2010),cgallagher21 (12-05-2010),Skyline. (12-03-2010)

  3. #2
    AZUMIKKEL's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    My moms house... what's so funny about that?
    Posts
    790
    Reputation
    19
    Thanks
    462
    My Mood
    Sneaky
    self _setPerk("perk_name");
    self _unsetPerk("perk_name");
    no longer works.

    self _clearPerks();
    doesn't either, you can use self clearPerks(); but i can't confirm if it works.


    If anyone figures this out, PLEASE tell me!

    Edit: Found out. Silly me


    Line 910: self setPerk( perk );
    Line 914: self unsetPerk( perk );
    Last edited by AZUMIKKEL; 12-03-2010 at 07:09 PM.
    www.YouTube.com/MpKiller100

  4. #3
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,802
    Reputation
    3165
    Thanks
    73,317
    My Mood
    Breezy
    Quote Originally Posted by AZUMIKKEL View Post
    self _setPerk("perk_name");
    self _unsetPerk("perk_name");
    no longer works.

    self _clearPerks();
    doesn't either, you can use self clearPerks(); but i can't confirm if it works.


    If anyone figures this out, PLEASE tell me!
    I thought they did work, just remove the underscore from _setPerk and _unsetPerk.
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.6.1 *NEW* Windows 10 compatible!
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  5. #4
    Skyline.'s Avatar
    Join Date
    Dec 2009
    Gender
    male
    Posts
    10,160
    Reputation
    403
    Thanks
    1,613
    cool thanks for the info champ!


  6. The Following User Says Thank You to Skyline. For This Useful Post:

    [MPGH]master131 (12-03-2010)