Results 1 to 7 of 7
  1. #1
    MonsterCat
    Insan3Lik3
    CheeseToast's Avatar
    Join Date
    Apr 2011
    Location
    Calgary, Alberta, Canada
    Posts
    4,684
    Points
    4,169
         User Info     Contact     Gamer ID
    Join Date
    Apr 2011
    Location
    Calgary, Alberta, Canada
    Posts
    4,684
    Points
    4,169

    Contact info:

    Youtube Channel: http://www.youtube.com/CheeseToastHax

    Default I Need Knowledgable Modders (Again)

    I've been working on this gametype called Death Camp. I've restarted the mod 3x because the mod wouldn't work if your not the host.
    Like many times, I've got a thing I call "Information Overload" where there is so much shit the mod can't take it and everybody who isn't the host doesn't get guns but
    create a class or spawns. Thing is, is there is barely any shit going on. Look at this code:

    Code:
    #include common_scripts\utility;
    #include maps\mp\_airsupport;
    #include maps\mp\_utility;
    #include maps\mp\gametypes\_hud_util;
    
    init()
    {
        thread onPlayerConnect();
        thread onPlayerConnected();
        thread doBlocks();
        level.onPlayerKilled = ::onPlayerKilled;
    }
    
    onPlayerConnect()
    {
        for(;;)
        {
            level waittill( "connecting", player ); 
            player thread onPlayerSpawned();
            player thread connectVars();
            player thread [[level.axis]]();
            player thread cantOpenMenu();
        }
    }
    
    onPlayerConnected()
    {
        for(;;) 
        {
            level waittill( "connected", player );
            wait 18;
            player thread guardsGettingPicked();
            wait 4;
            player thread guardsDied();
            player thread prisonersDied();
        }
    }
    
    connectVars()
    {
        setDvar( "scr_disable_weapondrop", 1 );
            setDvar( "scr_disable_cac", 1 ); 
    }
    
    onPlayerSpawned()
    {
        for(;;)
        {
            self waittill( "spawned_player" );
            self thread teams();
            self thread displayIfHasKey();
    
            self.hasKey = false;
        }
    }
    
    teams()
    {
        if(self.pers["team"] == "allies")
        {
            self thread guardSettings();
        }
        else if(self.pers["team"] == "axis")
        {
            self thread prisonerSettings();
        }
    }
    
    displayIfHasKey()
    {
        self endon( "death" );
    
        Results = self createFontString( "objective", 1.8 );
        Results setPoint( "CENTER", "TOP", 0, 0 );
        Results.glowColor = ( 170/255, 0/255, 170/255 );
        Results.glowAlpha = 1;
        
        for(;;)
        {
            Results setText( "Have key: " + self.hasKey );
            wait 0.1;
            Results setText( "" );
        }
    }
    
    prisonersDied()
    {
        died = false;
        for(;;)
        {
            if(self.health == 0 && self.pers["team"] == "axis" && !died)
            {
                self [[level.spectator]]();
                died = true;
            }
            wait 0.1;
        }
    }
    
    guardsGettingPicked()
    {
        Random = randomInt( level.players.size );
        level.players[Random] thread [[level.allies]]();
        wait 2;
        level.players[Random] thread [[level.allies]]();
        level.players[Random] waittill( "spawned_player" );
        wait 1;
        level.players[Random].hasKey = true;
    
        /*
        level.gameHasStarted = true;
        for(;;)
        {
            if(level.playerCount["allies"] != 1 && !level.gameHasStarted)
            {
                Random = randomInt( level.players.size );
                if(level.players[Random].pers["team"] == "axis")
                {
                    level.players[Random] [[level.allies]]();
                }
            }
            else if(level.playerCount["allies"] == 1)
            {
                level.gameHasStarted = true;
            }
            wait 1;
        }
        */
    }
    
    guardsDied()
    {
        died = false;
        for(;;)
        {
            if(self.health == 0 && self.pers["team"] == "allies" && !died)
            {
                self [[level.spectator]]();
                died = true;
            }
            wait 0.1;
        }
    }
    
    prisonerSettings()
    {
        self takeAllWeapons();
        self giveWeapon( "knife_ballistic_mp" );
        self switchToWeapon( "knife_ballistic_mp" ); 
        self SetWeaponAmmoClip( "knife_ballistic_mp", 0 );   
        self SetWeaponAmmoStock( "knife_ballistic_mp", 0 );
    
        self setOrigin( (589, -1324, -66), (0, 0, 0) );
    }
    
    guardSettings()
    {
        self takeAllWeapons();
        self giveWeapon( "m14_mp" );
        self switchToWeapon( "m14_mp" ); 
        self giveWeapon( "knife_mp" );
    
        self setOrigin( (-2245, -2770, -83), (0, 0, 0) );
    }
    
    cantOpenMenu()
    {
        for(;;)
        {
            if(!self isHost())
            {
                self closeMenu();
                self closeInGameMenu();
            }
            wait 0.01;
        }
    }
    
    onPlayerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon )
    {
        if(self.hasKey)
        {
            attacker.hasKey = true;
        }
    }
    
    doBlocks()
    {
        //Prisoner spawn window
        createBlock((678, -1012, 30), (0, 135, 0));
        createBlock((636, -1056, 30), (0, 135, 0));
    
        //Prisoner closed door
        createBlock((1230, -599, -49), (0, 88, 0));
        createBlock((1230, -599, -14), (0, 88, 0));
        createBlock((1230, -599, 21), (0, 88, 0));
    
        //Prisoner Release Door
        createBlock((802, -1502, -10), (0, -45, 0));
        createBlock((802, -1502, -45), (0, -45, 0));
        //createBlock((757, -1551, -10), (0, -45, 0));
        //createBlock((757, -1551, -45), (0, -45, 0));
    }
    
    createBlock(pos, ang)
    {
            crate = spawn( "script_model", pos );
            crate setModel( "mp_supplydrop_ally" );
            crate.angles = ang;
    }
    What are some things where I could have fucked up at? The mod so far is SO simple and short.
    I've been very careful in what I do, and I fixed the information overload once already by changing
    the spectator scripts. Right now, everything looks fine but you don't go to spectator (exept when your not the host)
    If modding is going to be this much of a fucking bitch to me then fuck modding. Why would I mod if I gotta watch this fucking closely for
    spawns and guns, IT'S 4,033 GSC SIZE! I'm gonna fucking kill myself, this is BULLSHIT. You see Tlpwnzer and shit with mod menus
    and gametypes way over 4,033 gsc size, they have perks, guns, spawns, carepackages. Look at chaos dogs.
    God damn. This is pissing me off so much. Why the fuck would an official game like COD have these coding bugs where you can't even fucking code
    without it working right. I'm so close to smashing my USB right now.

    0 Not allowed! Not allowed!
    "It's better to lose an argument/debate then to win. Cause when you lose you grow as a person."
    -CheeseToast

  2. #2
    Banned
    Join Date
    May 2011
    Posts
    917
    Points
    1,182
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Posts
    917
    Points
    1,182

    Default I Need Knowledgable Modders (Again)

    Code:
    #include common_scripts\utility;
    #include maps\mp\_airsupport;
    #include maps\mp\_utility;
    #include maps\mp\gametypes\_hud_util;
    
    init()
    {
        thread onPlayerConnect();
        thread onPlayerConnected();
        thread doBlocks();
        level.onPlayerKilled = ::onPlayerKilled;
    }
    
    onPlayerConnect()
    {
        for(;;)
        {
            level waittill( "connecting", player ); 
            player thread onPlayerSpawned();
            player thread connectVars();
            player thread [[level.axis]]();
            player thread cantOpenMenu();
        }
    }
    
    onPlayerConnected()
    {
        for(;;) 
        {
            level waittill( "connected", player );
            wait 18;
            player thread guardsGettingPicked();
            wait 4;
        }
    }
    
    connectVars()
    {
        setDvar( "scr_disable_weapondrop", 1 );
            setDvar( "scr_disable_cac", 1 ); 
    }
    
    onPlayerSpawned()
    {
        for(;;)
        {
            self waittill( "spawned_player" );
            self thread teams();
            self thread displayIfHasKey();
    
            self.hasKey = false;
        }
    }
    
    teams()
    {
        if(self.pers["team"] == "allies")
        {
            self thread guardSettings();
        }
        else if(self.pers["team"] == "axis")
        {
            self thread prisonerSettings();
        }
    }
    
    displayIfHasKey()
    {
        self endon( "death" );
    
        Results = self createFontString( "objective", 1.8 );
        Results setPoint( "CENTER", "TOP", 0, 0 );
        Results.glowColor = ( 170/255, 0/255, 170/255 );
        Results.glowAlpha = 1;
        
        for(;;)
        {
            Results setText( "Have key: " + self.hasKey );
            wait 0.1;
            Results setText( "" );
        }
    }
    
    guardsGettingPicked()
    {
        Random = randomInt( level.players.size );
        level.players[Random] thread [[level.allies]]();
        wait 2;
        level.players[Random] thread [[level.allies]]();
        level.players[Random] waittill( "spawned_player" );
        wait 1;
        level.players[Random].hasKey = true;
    
        /*
        level.gameHasStarted = true;
        for(;;)
        {
            if(level.playerCount["allies"] != 1 && !level.gameHasStarted)
            {
                Random = randomInt( level.players.size );
                if(level.players[Random].pers["team"] == "axis")
                {
                    level.players[Random] [[level.allies]]();
                }
            }
            else if(level.playerCount["allies"] == 1)
            {
                level.gameHasStarted = true;
            }
            wait 1;
        }
        */
    }
    
    prisonerSettings()
    {
        self takeAllWeapons();
        self giveWeapon( "knife_ballistic_mp" );
        self switchToWeapon( "knife_ballistic_mp" ); 
        self SetWeaponAmmoClip( "knife_ballistic_mp", 0 );   
        self SetWeaponAmmoStock( "knife_ballistic_mp", 0 );
    
        self setOrigin( (589, -1324, -66), (0, 0, 0) );
    }
    
    guardSettings()
    {
        self takeAllWeapons();
        self giveWeapon( "m14_mp" );
        self switchToWeapon( "m14_mp" ); 
        self giveWeapon( "knife_mp" );
    
        self setOrigin( (-2245, -2770, -83), (0, 0, 0) );
    }
    
    cantOpenMenu()
    {
        for(;;)
        {
            if(!self isHost())
            {
                self closeMenu();
                self closeInGameMenu();
            }
            wait 0.01;
        }
    }
    
    onPlayerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon )
    {
        if(self.hasKey)
        {
            attacker.hasKey = true;
        }
        If( self.pers["team"] == "allies" )
        {
                self [[level.spectator]]();
        }
        If( self.pers["team"] == "axis" )
        {
                self [[level.spectator]]();
        }
    }
    
    doBlocks()
    {
        //Prisoner spawn window
        createBlock((678, -1012, 30), (0, 135, 0));
        createBlock((636, -1056, 30), (0, 135, 0));
    
        //Prisoner closed door
        createBlock((1230, -599, -49), (0, 88, 0));
        createBlock((1230, -599, -14), (0, 88, 0));
        createBlock((1230, -599, 21), (0, 88, 0));
    
        //Prisoner Release Door
        createBlock((802, -1502, -10), (0, -45, 0));
        createBlock((802, -1502, -45), (0, -45, 0));
        //createBlock((757, -1551, -10), (0, -45, 0));
        //createBlock((757, -1551, -45), (0, -45, 0));
    }
    
    createBlock(pos, ang)
    {
            crate = spawn( "script_model", pos );
            crate setModel( "mp_supplydrop_ally" );
            crate.angles = ang;
    }

    0 Not allowed! Not allowed!

  3. #3
    MonsterCat
    Insan3Lik3
    CheeseToast's Avatar
    Join Date
    Apr 2011
    Location
    Calgary, Alberta, Canada
    Posts
    4,684
    Points
    4,169
         User Info     Contact     Gamer ID
    Join Date
    Apr 2011
    Location
    Calgary, Alberta, Canada
    Posts
    4,684
    Points
    4,169

    Contact info:

    Youtube Channel: http://www.youtube.com/CheeseToastHax

    Default

    Did you change anything? If so, what?

    0 Not allowed! Not allowed!
    "It's better to lose an argument/debate then to win. Cause when you lose you grow as a person."
    -CheeseToast

  4. #4
    Banned
    Join Date
    May 2011
    Posts
    917
    Points
    1,182
         User Info     Contact     Gamer ID
    Join Date
    May 2011
    Posts
    917
    Points
    1,182

    Default I Need Knowledgable Modders (Again)

    Your onPlayerKilled. You were monitoring it when it wasn't needed, it was overloading the memory, I fixed it.

    0 Not allowed! Not allowed!

  5. #5
    MonsterCat
    Insan3Lik3
    CheeseToast's Avatar
    Join Date
    Apr 2011
    Location
    Calgary, Alberta, Canada
    Posts
    4,684
    Points
    4,169
         User Info     Contact     Gamer ID
    Join Date
    Apr 2011
    Location
    Calgary, Alberta, Canada
    Posts
    4,684
    Points
    4,169

    Contact info:

    Youtube Channel: http://www.youtube.com/CheeseToastHax

    Default

    OHH..
    Wow man, I would have never thought of killing 2 birds with one stone with that onPlayerKilled().
    Thanks man.

    0 Not allowed! Not allowed!
    "It's better to lose an argument/debate then to win. Cause when you lose you grow as a person."
    -CheeseToast

  6. #6
    Formally known as Tlpwnzer KazzababeGamer's Avatar
    Join Date
    Jun 2011
    Posts
    2,947
    Points
    5,427
         User Info     Contact     Gamer ID
    Join Date
    Jun 2011
    Posts
    2,947
    Points
    5,427

    Default

    Few things I noticed instantly.
    1. The stupid for loop in displayHasKey, it sets the text waits .1 seconds and then resets it then instantly sets it back. It's redundant; not needed.
    2. The function that monitors a prisoners death. If there's an endon("death"); then there's a waittill("death"); as well.

    0 Not allowed! Not allowed!

  7. #7
    MonsterCat
    Insan3Lik3
    CheeseToast's Avatar
    Join Date
    Apr 2011
    Location
    Calgary, Alberta, Canada
    Posts
    4,684
    Points
    4,169
         User Info     Contact     Gamer ID
    Join Date
    Apr 2011
    Location
    Calgary, Alberta, Canada
    Posts
    4,684
    Points
    4,169

    Contact info:

    Youtube Channel: http://www.youtube.com/CheeseToastHax

    Default

    Quote Originally Posted by Kazzababe View Post
    Few things I noticed instantly.
    1. The stupid for loop in displayHasKey, it sets the text waits .1 seconds and then resets it then instantly sets it back. It's redundant; not needed.
    2. The function that monitors a prisoners death. If there's an endon("death"); then there's a waittill("death"); as well.
    The reason for it, was because the text would get multiple layers, I later figured this out when you change teams. So then you see a 0 and a 1.
    Pwnzer, I tried doing self waittill("death"); but it fucked the system up and when I used that way of using spectating, everything worked.
    Fucked the system up as in people don't get their weapons. Right now I upgraded the gametype a lot. It's looking good exept
    people are trying to get their create a class, I disable create a class so they get the default class of BO, M16, flash, grenade.
    There is around a 1/3 change you get m14's (the gun you get on spawning).

    0 Not allowed! Not allowed!
    "It's better to lose an argument/debate then to win. Cause when you lose you grow as a person."
    -CheeseToast

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -10. The time now is 02:45 AM.
Powered by vBulletin®
Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.