Author Topic: Gobble Gum Machine Prefab + Script! lad420 Edition  (Read 5812 times)

0 Members and 1 Guest are viewing this topic.

Offline codwadlad420

  • - Original Poster (OP) -
  • Legless Crawler
  • Posts: 6
  • Country: us
  • Respect: 3
  • I love developing cod maps
    • xuan_dev' Twitter Feed
    • View Profile
  • WaW: lad420

Gobble Gum Machine Prefab + Script! lad420 Edition

« on: February 03, 2016, 05:44:57 pm »
I have a shitty version of the gobble gum machine that I made but a good script ready for use! This is an initial release so don't expect the machine to pick a random gobble gum and have the images for every gobble gum. There are only 5 working gobble gums, and others have not been made yet! I don't have time to script all the gobble gums so I'm releasing my work to this amazing community! I hope you see this as a reward in a way! You're getting to script the rest of the gobble gums and even make your own!!!! Think about all the possibilites!!! Zero gravity gobble gum for 30 seconds, 5 gun slots instead of 3 like mule kick, health boost and more that you can make on your own!! I hope you will use this in a awesome matter and help me build off of this! I still need the bo3 gobble gum prefab but I didn't find anyone that could share it with me :/ . Anyways enjoy and happy scripting!

 :rainbow:

Prefab Download link:
[You are not allowed to view external links. Register or Login to see them] !sYRX2JiL!71pEFDputnUMUCp65sDNIGazmJVV-2RePVCzq95fEwA

Script link:
[You are not allowed to view external links. Register or Login to see them]

Offline daedra descent

  • ☭ Soviet Commander ☭
  • King of the Zombies
  • Community Daedra
  • Banned!
  • Posts: 2,796
  • Country: us
  • Respect: 322
    • BlueSoviet
    • View Profile

Re: Gobble Gum Machine Prefab + Script! lad420 Edition

« Reply #1 on: February 03, 2016, 06:53:13 pm »
Code: [Select]
gobble_gum_machine()
{
    //image of gobble gum
    PrecacheShader( "specialty_gobble_gum_zombies");
    PrecacheShader( "specialty_nuke");
    //cost of gobble gum buy
    cost = 500;
   
    //activate the following script code when player buys perk
    trigger = getEnt("gobble_gum_trigger", "targetname");
 
   
    bought_round_number = undefined;
    //level.round_number = 0;
    last_round = 0;
   
    trigger setHintString ("Hold &&1 to dispense Gobble Gum [500]");
                   
        //hold code till trigger is activated
        trigger waittill("trigger", player);
           
        using_player = player;
           
        //random gumball script here
            //--------------------------------------
        gobble_gums_index = 0;
           
        gobble_gums = [];
               
        add_to_array("gobble_gums","insta_kill");
        add_to_array("gobble_gums","double_points");
        add_to_array("gobble_gums","nuke");
        add_to_array("gobble_gums","plain_sight");
        add_to_array("gobble_gums","pack_a_punch");
               
        //gobble_gum = gobble_gums[RandomInt(gobble_gums.size)];
               
        //gobble_gum = array_randomize(gobble_gums);
               
        //if( gobble_gums_index >= gobble_gums.size )
        //{
        //  gobble_gums_index = 0;
        //  randomize_gobble_gums(gobble_gums);
        //}
               
        //gobble_gums_index++;
               
        //--------------------------------------
        //final gumball selected from script
        //this pack a punch gobble gum packs my current gun for 30 seconds and then returns the old one after the time has ran out!
        gumball = "pack_a_punch";
        //this gumball code will give me the gumball without picking a random one
        //--------------------------------------
           
           
        if ( player.score < cost )
        {
            //player iprintln( "Not enough points to buy Perk: " + perk );
            self playsound("deny");
            player thread play_no_money_perk_dialog();
            //continue;
        }
        else
        {
            //blur players view for effect
            player setblur( 4, 0.1 );
            wait(0.6);
            player setblur(0, 0.1);
               
            //add the image of the shader to the hud
            player thread gumball_hud_create(gumball);
                   
            //subtract players points for the cost of the gobble gum machine
            player maps\_zombiemode_score::minus_to_player_score(cost);
               
            player thread gobble_gum_activate(using_player, gumball);
           
            //bought_round_number = level.round_number;
        }
       
        //rerun the gobble gum machine script so it keeps running
        thread gobble_gum_machine();
   
}

Everytime this function is called again it attempts to precache the two shaders(which shouldn't be there anyway since its after _load.gsc) over again.  That is not "good". You should be using a while loop to loop the function, not calling the function again.

Everything else is mostly just duplicated code from _zombiemode_perks with waits and prints thrown in besides the gumbal == <whatever> which should else if structure not just a bunch of individual if statements.

Also, this:

Code: [Select]
        doggie = getent("start_zone_spawners_dog", "targetname");
        using_player setOrigin(doggie.origin);

1. Not everyone uses dogs or use "start_zone" at the first zone name, so adding an isDefined() check is needed:

Code: [Select]
        doggie = getent("start_zone_spawners_dog", "targetname");
if(isDefined(doggie))
        using_player setOrigin(doggie.origin);

(adding a else/else if to catch other possible scenarios would be even better!)

2. using setOrigin will literally teleport the player through the map to that origin.
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds

Offline death_reaper0

  • *
  • Perk Hacker
  • Posts: 488
  • Country: au
  • Respect: 364
    • F3ARxReaper666
    • F3ARxReaper666's Twitch Channel
    • F3ARxReaper666' Twitter Feed
    • aaronnorris0's YouTube Channel
    • View Profile
    • Project Random Generator
  • WaW: xReaper666

Re: Gobble Gum Machine Prefab + Script! lad420 Edition

« Reply #2 on: February 03, 2016, 07:07:11 pm »
im pretty sure i could make a better version of this, no offence  ::)
respect the dead

donates greatly appreciated :) [You are not allowed to view external links. Register or Login to see them]

Offline daedra descent

  • ☭ Soviet Commander ☭
  • King of the Zombies
  • Community Daedra
  • Banned!
  • Posts: 2,796
  • Country: us
  • Respect: 322
    • BlueSoviet
    • View Profile

Re: Gobble Gum Machine Prefab + Script! lad420 Edition

« Reply #3 on: February 03, 2016, 07:29:36 pm »
im pretty sure i could make a better version of this, no offence  ::)

Don't even. Not only have you made the same mistakes with scripts you've released, you can't even indent your code. Atleast his is readable.

Offline death_reaper0

  • *
  • Perk Hacker
  • Posts: 488
  • Country: au
  • Respect: 364
    • F3ARxReaper666
    • F3ARxReaper666's Twitch Channel
    • F3ARxReaper666' Twitter Feed
    • aaronnorris0's YouTube Channel
    • View Profile
    • Project Random Generator
  • WaW: xReaper666

Re: Gobble Gum Machine Prefab + Script! lad420 Edition

« Reply #4 on: February 03, 2016, 07:43:40 pm »
Don't even. Not only have you made the same mistakes with scripts you've released, you can't even indent your code. Atleast his is readable.
i never said i was going to, just that i could, and my scripting has become better

Offline Sidzzz

  • *
  • Pragmatist
  • Perk Hacker
  • Posts: 386
  • Country: in
  • Respect: 57
  • Fish. That is all
    • sidzzzzzz
    • S1dzzz's Twitch Channel
    • S1dzzz' Twitter Feed
    • SidTheGamer126's YouTube Channel
    • View Profile
  • WaW: Sidzzz

Re: Gobble Gum Machine Prefab + Script! lad420 Edition

« Reply #5 on: February 04, 2016, 01:47:40 am »
im pretty sure i could make a better version of this, no offence  ::)

There is literally no point to this statement whatsoever. All you're doing is provoking the OP, laying out the foundation for potential arguments and making yourself out to be a braggadocious person. :poker:

Offline death_reaper0

  • *
  • Perk Hacker
  • Posts: 488
  • Country: au
  • Respect: 364
    • F3ARxReaper666
    • F3ARxReaper666's Twitch Channel
    • F3ARxReaper666' Twitter Feed
    • aaronnorris0's YouTube Channel
    • View Profile
    • Project Random Generator
  • WaW: xReaper666

Re: Gobble Gum Machine Prefab + Script! lad420 Edition

« Reply #6 on: February 04, 2016, 02:08:32 am »
i realize now i was being kind of a d*ck, sorry codwadlad420, this is actually pretty cool

Offline HyperFirez

  • Pack-a-Puncher
  • Posts: 114
  • Country: us
  • Respect: 9
    • HyperFirez
    • HyperFirez's Twitch Channel
    • HyperFirez' Twitter Feed
    • HyperFirez's Uplay Profile
    • HyperFirez's YouTube Channel
    • View Profile
  • Skype: HyperFirez
  • WaW: HyperFirez

Re: Gobble Gum Machine Prefab + Script! lad420 Edition

« Reply #7 on: February 04, 2016, 02:38:17 pm »
I get a bad syntax error when I try to play. I put the script in my mapname.gsc file right?
Maps:
Standoff Zombies [WIP]
Der Blitzdrache [WIP] (Maybe Canceled)
FNAF 1-4 [WIP] (Maybe Canceled)

Offline alaurenc9

  • *
  • Zombie Enslaver
  • Banned!
  • Posts: 562
  • Country: us
  • Respect: 133
    • xSanchez78
    • alaurenc9's YouTube Channel
    • View Profile
  • Skype: alaurenc9
  • WaW: xSanchez78

Re: Gobble Gum Machine Prefab + Script! lad420 Edition

« Reply #8 on: February 06, 2016, 08:06:47 pm »
Dude this script.... I mean it doesn't even save over games or have anything but I re-done perk script. I mean, the amount of anything that is even in here can be easily replicated by those who even know how to add their own gobble gum's. I personally think that this should have been kept to yourself until it had more to release, like images that come with it and not using the perk bottles and other re-used or even missing assets in this script as I guess what you probably called "place holders" in your "finished" release. None of the images you even did reference correctly are even included in the tutorial. I would think releases are more of something that people can use fully without any work at all other than the install, but when you just put out a blank script that is just a hardly modified version of a treyarch script and tell people to "make their own":
You're getting to script the rest of the gobble gums and even make your own!!!!
I don't think many people who even have the skill to make their own will want to use this sorry script. I think they would most likely make their own base script for it to, which apparently is really easy as you have demonstrated here, it isn't any more than just copying and pasting the perk scripts. These gobble gum's don't even save over games, let alone being selectable in an outside menu like they are in Black Ops 3. Sorry if this at all sounded harsh  :-\
« Last Edit: February 06, 2016, 08:13:53 pm by alaurenc9 »
My preferred name is "xSanchez78".
Check me out here: [You are not allowed to view external links. Register or Login to see them]

Offline death_reaper0

  • *
  • Perk Hacker
  • Posts: 488
  • Country: au
  • Respect: 364
    • F3ARxReaper666
    • F3ARxReaper666's Twitch Channel
    • F3ARxReaper666' Twitter Feed
    • aaronnorris0's YouTube Channel
    • View Profile
    • Project Random Generator
  • WaW: xReaper666

Re: Gobble Gum Machine Prefab + Script! lad420 Edition

« Reply #9 on: February 06, 2016, 09:09:10 pm »
Dude this script.... I mean it doesn't even save over games or have anything but I re-done perk script. I mean, the amount of anything that is even in here can be easily replicated by those who even know how to add their own gobble gum's. I personally think that this should have been kept to yourself until it had more to release, like images that come with it and not using the perk bottles and other re-used or even missing assets in this script as I guess what you probably called "place holders" in your "finished" release. None of the images you even did reference correctly are even included in the tutorial. I would think releases are more of something that people can use fully without any work at all other than the install, but when you just put out a blank script that is just a hardly modified version of a treyarch script and tell people to "make their own":I don't think many people who even have the skill to make their own will want to use this sorry script. I think they would most likely make their own base script for it to, which apparently is really easy as you have demonstrated here, it isn't any more than just copying and pasting the perk scripts. These gobble gum's don't even save over games, let alone being selectable in an outside menu like they are in Black Ops 3. Sorry if this at all sounded harsh  :-\
I might be wrong but im not sure if you can have a menu outside the map that'll work alongside stuff like this. Ive only been scripting for about a year now so I dony know all funtions and could easily be wrong. The way I had liquid divinium in my cracked map is probably to closest to gobblegum so far and im not the best scripter when it comes to cod so someone could make a better one
« Last Edit: February 06, 2016, 09:10:56 pm by death_reaper0 »

Offline HyperFirez

  • Pack-a-Puncher
  • Posts: 114
  • Country: us
  • Respect: 9
    • HyperFirez
    • HyperFirez's Twitch Channel
    • HyperFirez' Twitter Feed
    • HyperFirez's Uplay Profile
    • HyperFirez's YouTube Channel
    • View Profile
  • Skype: HyperFirez
  • WaW: HyperFirez

Re: Gobble Gum Machine Prefab + Script! lad420 Edition

« Reply #10 on: February 06, 2016, 09:22:07 pm »
Yeah Fear. I was working on a scrpit for gobblegums as well and I think a menu will work better with this.

Offline deperVSzombis

  • Legless Crawler
  • Posts: 5
  • Country: es
  • Respect: 0
    • deperVSzombis's YouTube Channel
    • View Profile
  • WaW: deper

Re: Gobble Gum Machine Prefab + Script! lad420 Edition

« Reply #11 on: March 10, 2016, 07:10:56 pm »
this is great, but I have a problem with who is who, when they kill me, the dead player stays and nothing happens, any idea how to fix it?

Offline HyperFirez

  • Pack-a-Puncher
  • Posts: 114
  • Country: us
  • Respect: 9
    • HyperFirez
    • HyperFirez's Twitch Channel
    • HyperFirez' Twitter Feed
    • HyperFirez's Uplay Profile
    • HyperFirez's YouTube Channel
    • View Profile
  • Skype: HyperFirez
  • WaW: HyperFirez

Re: Gobble Gum Machine Prefab + Script! lad420 Edition

« Reply #12 on: March 12, 2016, 08:22:12 pm »
This has nothing to do with gobblegums

Offline RayGuNNXXX123

  • Legless Crawler
  • Posts: 49
  • Country: us
  • Respect: 10
  • Press F to Pay Respects ^
    • .
    • Look Who's Back
    • .'s Twitch Channel
    • .' Twitter Feed
    • .'s Uplay Profile
    • .'s Xfire Profile
    • .'s YouTube Channel
    • View Profile
  • Skype: .
  • WaW: DanisBoss123

Re: Gobble Gum Machine Prefab + Script! lad420 Edition

« Reply #13 on: August 06, 2017, 06:41:27 am »
I get a bad syntax error when I try to play. I put the script in my mapname.gsc file right?
yea

Double Post Merge: August 07, 2017, 02:59:16 am
I don't know if you still reply to these comments but when I followed every step I go ingame and it just shows a hand and I can't buy the gobblegums.
« Last Edit: August 07, 2017, 02:59:16 am by RayGuNNXXX123 »
Thank you. :)