UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Script Help ;)

HOT
broken avatar :(
Created 11 years ago
by GerardS0406
0 Members and 1 Guest are viewing this topic.
5,593 views
broken avatar :(
×
broken avatar :(
Location: usMissouri
Date Registered: 6 August 2013
Last active: 10 months ago
Posts
513
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
My Contact & Social Links
More
Signature
Projects:
Unnamed Project: 5%
Mutliple Downloadable Items for Mappers: (Released after map releases)
×
GerardS0406's Groups
GerardS0406's Contact & Social LinksGerardS0406GerardS0406Gerard0406MrGerard0406
Hey, I'm trying to make something like the wunderfizz but I keep getting the error "script compile error: bad token '.'" Any help? Thx ;)

I created a new gsc (_gerard_wunderfizz.gsc) and put this code in.

Code Snippet
Plaintext
#include maps\_utility; 
#include common_scripts\utility;
#include maps\_zombiemode_utility;

init()
{
trigger_wait( "wunderfizz_trigger","targetname" );
thread letrigger_func();


letrigger_func()
{
cost = 1500;
while(true)
{
self waittill("trigger", player);
if(player.score < cost)
return;

player.score -= cost;
player thread maps\_zombiemode_powerups::zombie_perk_powerup();
}
}
}

then in _zombiemode.gsc

Code Snippet
Plaintext
maps\_gerard_wunderfizz

then in _zombiemode_powerups I added DUKIP's Random Perk Powerup function to work with the wunderfizz, I added it at the bottom of _zombiemode_powerups.gsc:

Code Snippet
Plaintext
zombie_perk_powerup()
{
self endon("disconnect");

player = self;
perk = getRandomPerk(player);
//DUKIP - Make sure player doesn't have the perk and perk is defined.
if(player HasPerk(perk) || !IsDefined(perk))
{
//DUKIP - 50/50 chance of playing the sound.
if(cointoss())
player PlayLocalSound("sam_nospawn");
return;
}

//DUKIP - Moved this var to above the perk bottle give as there was a chance of getting "dual" perks.
player.is_drinking = 1;

// do the drink animation
gun = player maps\_zombiemode_perks::perk_give_bottle_begin( perk );

player waittill_any( "fake_death", "death", "player_downed", "weapon_change_complete" );

// restore player controls and movement
player maps\_zombiemode_perks::perk_give_bottle_end( gun, perk );
player.is_drinking = undefined;
// TODO: race condition?
if ( player maps\_laststand::player_is_in_laststand() )
return;

player SetPerk( perk );
player thread maps\_zombiemode_perks::perk_vo(perk);
player setblur( 4, 0.1 );
wait(0.1);
player setblur(0, 0.1);

if(perk == "specialty_armorvest")
{
player.maxhealth = level.zombie_vars["zombie_perk_juggernaut_health"];
player.health = level.zombie_vars["zombie_perk_juggernaut_health"];
}

player maps\_zombiemode_perks::perk_hud_create( perk );

//stat tracking
player.stats["perks"]++;

bbPrint( "zombie_uses: playername %s playerscore %d round %d cost %d name %s x %f y %f z %f type perk",
player.playername, player.score, level.round_number, 0, perk, self.origin );

player thread maps\_zombiemode_perks::perk_think( perk );
}

getRandomPerk(player)
{
//DUKIP - Make sure we're not drinking anything already.
if(IsSubStr(player getCurrentWeapon(), "bottle") || (IsDefined(player.is_drinking) && player.is_drinking))
return;

all_perks = [];
all_perks[0] = "specialty_armorvest";
all_perks[1] = "specialty_quickrevive";
all_perks[2] = "specialty_fastreload";
all_perks[3] = "specialty_rof";
//all_perks[NUM] = "specialty_XXXX";

all_perks = array_randomize(all_perks);

thePerk = random(all_perks);

return thePerk;
}
Last Edit: March 14, 2015, 06:15:57 pm by GerardS0406
This topic contains a post which is marked as the Best Answer. Click here to view it.
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 3 years ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
Signature
Do not take life too seriously. You will never get out of it alive.
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
You know you have a function inside of a function?
broken avatar :(
×
broken avatar :(
Location: usMissouri
Date Registered: 6 August 2013
Last active: 10 months ago
Posts
513
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
My Contact & Social Links
More
×
GerardS0406's Groups
GerardS0406's Contact & Social LinksGerardS0406GerardS0406Gerard0406MrGerard0406
You know you have a function inside of a function?
oh oops haha That's probably it, thx
Last Edit: March 14, 2015, 07:06:35 pm by GerardS0406
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social LinksHarryBo000[email protected]HarryBo21
Quote
maps\_gerard_wunderfizz

I assume theres more to this too
broken avatar :(
×
broken avatar :(
Location: usMissouri
Date Registered: 6 August 2013
Last active: 10 months ago
Posts
513
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
My Contact & Social Links
More
×
GerardS0406's Groups
GerardS0406's Contact & Social LinksGerardS0406GerardS0406Gerard0406MrGerard0406
I assume theres more to this too
Yea, the script isn't working at all so I'm just gonna stop scripting because I obviously don't know anything about it xD
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 6 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Signature
Donate to me if you enjoy my work. https://www.paypal.me/thezombiekilla6
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social Linksdust103194MrZ0mbiesFanaticMrZ0mbiesFanatic
If you havent already, you need to put ::init after this in zombiemode so it can start the script,  it will need to be

Code Snippet
Plaintext
maps\_gerard_wunderfizz::init();

That may explain why it wont work
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social LinksHarryBo000[email protected]HarryBo21
yea, currently your calling the script, but not directing what to do with it after that

your main function is called init(), so you need to call it

broken avatar :(
×
broken avatar :(
Location: usMissouri
Date Registered: 6 August 2013
Last active: 10 months ago
Posts
513
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
My Contact & Social Links
More
×
GerardS0406's Groups
GerardS0406's Contact & Social LinksGerardS0406GerardS0406Gerard0406MrGerard0406
Bye
Last Edit: March 15, 2015, 03:54:10 am by GerardS0406
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social LinksHarryBo000[email protected]HarryBo21
no its not dude... its 90% other peoples work

Will you stop trying to claim credit for stuff you havent done? All you did was assemble this as per instructions from the ACTUAL scripters

Ive been ignoring til now, but dude, please stop. Just say this is a script by "XXX", and this is how to use it...
broken avatar :(
×
broken avatar :(
Location: usMissouri
Date Registered: 6 August 2013
Last active: 10 months ago
Posts
513
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
My Contact & Social Links
More
×
GerardS0406's Groups
GerardS0406's Contact & Social LinksGerardS0406GerardS0406Gerard0406MrGerard0406
no its not dude... its 90% other peoples work

Will you stop trying to claim credit for stuff you havent done? All you did was assemble this as per instructions from the ACTUAL scripters

Ive been ignoring til now, but dude, please stop. Just say this is a script by "XXX", and this is how to use it...
Tell me a scripting tutorial at least please...

Double Post Merge: March 15, 2015, 03:58:29 am
yea, currently your calling the script, but not directing what to do with it after that

your main function is called init(), so you need to call it
I added that and didn't work, like zombiemode wouldn't start until I hit the trigger and then I would start with 0 points... I know I'm doing something wrong and I've been working on scripts this whole day and just don't understand...
Last Edit: March 15, 2015, 03:59:33 am by GerardS0406
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social LinksHarryBo000[email protected]HarryBo21
there are not really specific tutorials out there

I never learned GSC scripting, it just happens to be near identical to Javascript or C++ which I am already familiar with. Id suggest just reading up on basic usage and syntax

There are some short tutorials around on this site, otherwise take a look at Treyarchs GSCs, if you read through them, before long youll start to work out what is doing what

First thing you should look at of Treyarchs is _zombiemode_perks.gsc. Its pretty basic and has most of what you want in there already.
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social LinksHarryBo000[email protected]HarryBo21
AND stop editing your posts to remove stuff you just wrote!

That code was DidUKnowIPwns, I called you out, you deleted it!

We will help you if you stop this behaviour, keep it up and we will not. simple...
Last Edit: March 15, 2015, 04:05:16 am by Harry Bo21
broken avatar :(
×
broken avatar :(
Location: usMissouri
Date Registered: 6 August 2013
Last active: 10 months ago
Posts
513
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
My Contact & Social Links
More
×
GerardS0406's Groups
GerardS0406's Contact & Social LinksGerardS0406GerardS0406Gerard0406MrGerard0406
AND stop editing your posts to remove stuff you just wrote!

That code was DidUKnowIPwns, I called you out, you deleted it!

We will help you if you stop this behaviour, keep it up and we will not. simple...
Huh... You Confuse me... The only script that Was DUKIP's was the zombie_perk_powerup and I gave credit...
I deleted it because it didn't work after testing
Last Edit: March 15, 2015, 04:07:59 am by GerardS0406
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social LinksHarryBo000[email protected]HarryBo21
Quote
level.wunderfizz = getEntArray("wunderfizz_trigger","targetname");

for(i=0;i<level.wunderfizz.size;i++)
level.wunderfizz thread zombie_perk_powerup();

// REST OF DUKIP RANDOM PERK CODE HERE

from : http://ugx-mods.com/forum/index.php?topic=5962.msg65446#msg65446

this :

Code Snippet
Plaintext
zombie_perk_powerup()
{
self endon("disconnect");

player = self;
perk = getRandomPerk(player);
//DUKIP - Make sure player doesn't have the perk and perk is defined.
if(player HasPerk(perk) || !IsDefined(perk))
{
//DUKIP - 50/50 chance of playing the sound.
if(cointoss())
player PlayLocalSound("sam_nospawn");
return;
}

//DUKIP - Moved this var to above the perk bottle give as there was a chance of getting "dual" perks.
player.is_drinking = 1;

// do the drink animation
gun = player maps\_zombiemode_perks::perk_give_bottle_begin( perk );

player waittill_any( "fake_death", "death", "player_downed", "weapon_change_complete" );

// restore player controls and movement
player maps\_zombiemode_perks::perk_give_bottle_end( gun, perk );
player.is_drinking = undefined;
// TODO: race condition?
if ( player maps\_laststand::player_is_in_laststand() )
return;

player SetPerk( perk );
player thread maps\_zombiemode_perks::perk_vo(perk);
player setblur( 4, 0.1 );
wait(0.1);
player setblur(0, 0.1);

if(perk == "specialty_armorvest")
{
player.maxhealth = level.zombie_vars["zombie_perk_juggernaut_health"];
player.health = level.zombie_vars["zombie_perk_juggernaut_health"];
}

player maps\_zombiemode_perks::perk_hud_create( perk );

//stat tracking
player.stats["perks"]++;

bbPrint( "zombie_uses: playername %s playerscore %d round %d cost %d name %s x %f y %f z %f type perk",
player.playername, player.score, level.round_number, 0, perk, self.origin );

player thread maps\_zombiemode_perks::perk_think( perk );
}

getRandomPerk(player)
{
//DUKIP - Make sure we're not drinking anything already.
if(IsSubStr(player getCurrentWeapon(), "bottle") || (IsDefined(player.is_drinking) && player.is_drinking))
return;

all_perks = [];
all_perks[0] = "specialty_armorvest";
all_perks[1] = "specialty_quickrevive";
all_perks[2] = "specialty_fastreload";
all_perks[3] = "specialty_rof";
//all_perks[NUM] = "specialty_XXXX";

all_perks = array_randomize(all_perks);

thePerk = random(all_perks);

return thePerk;
}

Is also ALL DidUKnowIPwns so please tell me what YOU have done?

I already know, hence why you posted your "tutorial" quoting this as "your first script", which you have now deleted
broken avatar :(
×
broken avatar :(
Location: usMissouri
Date Registered: 6 August 2013
Last active: 10 months ago
Posts
513
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
My Contact & Social Links
More
×
GerardS0406's Groups
GerardS0406's Contact & Social LinksGerardS0406GerardS0406Gerard0406MrGerard0406
from : http://ugx-mods.com/forum/index.php?topic=5962.msg65446#msg65446

this :

Code Snippet
Plaintext
zombie_perk_powerup()
{
self endon("disconnect");

player = self;
perk = getRandomPerk(player);
//DUKIP - Make sure player doesn't have the perk and perk is defined.
if(player HasPerk(perk) || !IsDefined(perk))
{
//DUKIP - 50/50 chance of playing the sound.
if(cointoss())
player PlayLocalSound("sam_nospawn");
return;
}

//DUKIP - Moved this var to above the perk bottle give as there was a chance of getting "dual" perks.
player.is_drinking = 1;

// do the drink animation
gun = player maps\_zombiemode_perks::perk_give_bottle_begin( perk );

player waittill_any( "fake_death", "death", "player_downed", "weapon_change_complete" );

// restore player controls and movement
player maps\_zombiemode_perks::perk_give_bottle_end( gun, perk );
player.is_drinking = undefined;
// TODO: race condition?
if ( player maps\_laststand::player_is_in_laststand() )
return;

player SetPerk( perk );
player thread maps\_zombiemode_perks::perk_vo(perk);
player setblur( 4, 0.1 );
wait(0.1);
player setblur(0, 0.1);

if(perk == "specialty_armorvest")
{
player.maxhealth = level.zombie_vars["zombie_perk_juggernaut_health"];
player.health = level.zombie_vars["zombie_perk_juggernaut_health"];
}

player maps\_zombiemode_perks::perk_hud_create( perk );

//stat tracking
player.stats["perks"]++;

bbPrint( "zombie_uses: playername %s playerscore %d round %d cost %d name %s x %f y %f z %f type perk",
player.playername, player.score, level.round_number, 0, perk, self.origin );

player thread maps\_zombiemode_perks::perk_think( perk );
}

getRandomPerk(player)
{
//DUKIP - Make sure we're not drinking anything already.
if(IsSubStr(player getCurrentWeapon(), "bottle") || (IsDefined(player.is_drinking) && player.is_drinking))
return;

all_perks = [];
all_perks[0] = "specialty_armorvest";
all_perks[1] = "specialty_quickrevive";
all_perks[2] = "specialty_fastreload";
all_perks[3] = "specialty_rof";
//all_perks[NUM] = "specialty_XXXX";

all_perks = array_randomize(all_perks);

thePerk = random(all_perks);

return thePerk;
}

Is also ALL DidUKnowIPwns so please tell me what YOU have done?

I already know, hence why you posted your "tutorial" quoting this as "your first script", which you have now deleted

Yes I gave credit for zombie_perk_powerup() script and the other one on http://ugx-mods.com/forum/index.php?topic=5962.msg65446#msg65446 I wasn't referring to that script because that one doesn't work (probably because I don't understand it) and I was referring to the one I posted and deleted because it didn't work
Last Edit: March 15, 2015, 04:20:03 am by GerardS0406

 
Loading ...