UGX-Mods

Call of Duty 5: World at War => Downloadable Items for Mappers => Custom Maps, Mods & Tools => Scripts => Topic started by: codwadlad420 on February 04, 2016, 02:44:57 am

Title: Gobble Gum Machine Prefab + Script! lad420 Edition
Post by: codwadlad420 on February 04, 2016, 02:44:57 am
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:
https://mega.nz/# (https://mega.nz/#)!sYRX2JiL!71pEFDputnUMUCp65sDNIGazmJVV-2RePVCzq95fEwA

Script link:
http://pastebin.com/RDbaqQDs (http://pastebin.com/RDbaqQDs)
Title: Re: Gobble Gum Machine Prefab + Script! lad420 Edition
Post by: daedra descent on February 04, 2016, 03:53:13 am
Code Snippet
Plaintext
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 Snippet
Plaintext
        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 Snippet
Plaintext
        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.
Title: Re: Gobble Gum Machine Prefab + Script! lad420 Edition
Post by: death_reaper0 on February 04, 2016, 04:07:11 am
im pretty sure i could make a better version of this, no offence  ::)
Title: Re: Gobble Gum Machine Prefab + Script! lad420 Edition
Post by: daedra descent on February 04, 2016, 04:29:36 am
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.
Title: Re: Gobble Gum Machine Prefab + Script! lad420 Edition
Post by: death_reaper0 on February 04, 2016, 04:43:40 am
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
Title: Re: Gobble Gum Machine Prefab + Script! lad420 Edition
Post by: Sidzzz on February 04, 2016, 10: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:
Title: Re: Gobble Gum Machine Prefab + Script! lad420 Edition
Post by: death_reaper0 on February 04, 2016, 11:08:32 am
i realize now i was being kind of a d*ck, sorry codwadlad420, this is actually pretty cool
Title: Re: Gobble Gum Machine Prefab + Script! lad420 Edition
Post by: HyperFirez on February 04, 2016, 11:38:17 pm
I get a bad syntax error when I try to play. I put the script in my mapname.gsc file right?
Title: Re: Gobble Gum Machine Prefab + Script! lad420 Edition
Post by: alaurenc9 on February 07, 2016, 05:06:47 am
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  :-\
Title: Re: Gobble Gum Machine Prefab + Script! lad420 Edition
Post by: death_reaper0 on February 07, 2016, 06:09:10 am
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
Title: Re: Gobble Gum Machine Prefab + Script! lad420 Edition
Post by: HyperFirez on February 07, 2016, 06:22:07 am
Yeah Fear. I was working on a scrpit for gobblegums as well and I think a menu will work better with this.
Title: Re: Gobble Gum Machine Prefab + Script! lad420 Edition
Post by: deperVSzombis on March 11, 2016, 04:10:56 am
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?
Title: Re: Gobble Gum Machine Prefab + Script! lad420 Edition
Post by: HyperFirez on March 13, 2016, 05:22:12 am
This has nothing to do with gobblegums
Title: Re: Gobble Gum Machine Prefab + Script! lad420 Edition
Post by: RayGuNNXXX123 on August 06, 2017, 03:41:27 pm
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, 11: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.
Title: Re: Gobble Gum Machine Prefab + Script! lad420 Edition
Post by: kitos on November 21, 2017, 02:17:57 pm
no problem with Scripting but i dont know why canĀ“t take goble gun when i go to take an image of a hand appears