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

buyable torrets

broken avatar :(
Created 12 years ago
by Deleted User
0 Members and 1 Guest are viewing this topic.
2,700 views
broken avatar :(
  • zombie madness
  • Deleted Member
×
broken avatar :(
zombie madness
This user is deleted :(
is there a tutorial on buy-able mg42 toretts? i carn't find 1 anywhere
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
is there a tutorial on buy-able mg42 toretts? i carn't find 1 anywhere

Do you mean auto-turrets? Or just a turret you have to pay for to use?

For auto-turrets, I think I used this tut: Adding Auto Turrets
broken avatar :(
  • zombie madness
  • Deleted Member
×
broken avatar :(
zombie madness
This user is deleted :(
Do you mean auto-turrets? Or just a turret you have to pay for to use?

For auto-turrets, I think I used this tut: Adding Auto Turrets
pay for
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
pay for

I haven't seen a tut, but with the following assumptions:
  • You have a working turret in your map now that doesn't cost anything
  • You want to buy any specific turret only once
  • You want at least one turret per trigger

Then this should work for you:
Radiant:
Make a trigger_use and set these kvps:
targetname: turrets
target: turret1
Select the trigger and then the turret (or turrets) you want to activate and press W. Or you can just set the turret (or turrets) kvp targetname to turret1. Same difference.

For each set of triggers and turrets, if you have more than one, name the target something else, but make sure you match the target of the trigger with the targetname of the turret that the trigger activates. Always name the targetname of the trigger turrets. Unless you change the script below.
             

Script:
Find FUNCTION CALLS - PRE _Load in your nazi_zombie_MAPNAME.gsc and paste this under it:
Code Snippet
Plaintext
    thread init_turrets();

to look something like this:
Code Snippet
Plaintext
        /*--------------------
FUNCTION CALLS - PRE _Load
----------------------*/
thread init_turrets();
Go to the end of your nazi_zombie__MAPNAME.gsc and paste this code:
Code Snippet
Plaintext
init_turrets(){
//Set the cost for the trigger
cost = 250;
turret_trigs = getentarray("turrets", "targetname");
for(trig=0;trig < turret_trigs.size; trig++){
turret_trigs[trig] setCursorHint("HINT_NOICON");
turret_trigs[trig] UseTriggerRequireLookAt();
turret_trigs[trig] SetHintString("Press &&1 to buy turret [Cost: " + cost + "]");
turret_trigs[trig] thread Buy_Turret(cost);
}
}
Buy_Turret(cost){
turrets = getentarray(self.target, "targetname");
//if you have multiple turrets activated from one trigger
for(turret=0;turret < turrets.size; turret++){
turrets[turret] MakeTurretUnusable(); //disable all of them
}
//Wait for the trigger
self waittill("trigger", player);
while(player.score<cost){
player playsound("no_cha_ching");
self waittill("trigger", player);
}
player playsound("cha_ching");
player maps\_zombiemode_score::minus_to_player_score( cost );
for (turret=0;turret < turrets.size; turret++){
turrets[turret] MakeTurretUsable(); //enable all of them
}
self delete();
}

This script is designed to handle sets that consist of one trigger and at least one turret but not limited to one turret. The cost is set to 250 by default. Change it in the init_turrets() function if you would like, or set up a zombie_cost kvp in each trigger if you want.
Last Edit: June 20, 2014, 03:15:19 am by MakeCents
broken avatar :(
  • zombie madness
  • Deleted Member
×
broken avatar :(
zombie madness
This user is deleted :(
I haven't seen a tut, but with the following assumptions:
  • You have a working turret in your map now that doesn't cost anything
  • You want to buy any specific turret only once
  • You want at least one turret per trigger

Then this should work for you:
Radiant:
Make a trigger_use and set these kvps:
targetname: turrets
target: turret1
Select the trigger and then the turret (or turrets) you want to activate and press W. Or you can just set the turret (or turrets) kvp targetname to turret1. Same difference.

For each set of triggers and turrets, if you have more than one, name the target something else, but make sure you match the target of the trigger with the targetname of the turret that the trigger activates. Always name the targetname of the trigger turrets. Unless you change the script below.
(Image removed from quote.)             (Image removed from quote.)

Script:
Find FUNCTION CALLS - PRE _Load in your nazi_zombie_MAPNAME.gsc and paste this under it:
Code Snippet
Plaintext
    thread init_turrets();

to look something like this:
Code Snippet
Plaintext
        /*--------------------
FUNCTION CALLS - PRE _Load
----------------------*/
thread init_turrets();
Go to the end of your nazi_zombie__MAPNAME.gsc and paste this code:
Code Snippet
Plaintext
init_turrets(){
//Set the cost for the trigger
cost = 250;
turret_trigs = getentarray("turrets", "targetname");
for(trig=0;trig < turret_trigs.size; trig++){
turret_trigs[trig] setCursorHint("HINT_NOICON");
turret_trigs[trig] UseTriggerRequireLookAt();
turret_trigs[trig] SetHintString("Press &&1 to buy turret [Cost: " + cost + "]");
turret_trigs[trig] thread Buy_Turret(cost);
}
}
Buy_Turret(cost){
turrets = getentarray(self.target, "targetname");
//if you have multiple turrets activated from one trigger
for(turret=0;turret < turrets.size; turret++){
turrets[turret] MakeTurretUnusable(); //disable all of them
}
//Wait for the trigger
self waittill("trigger", player);
while(player.score<cost){
player playsound("no_cha_ching");
self waittill("trigger", player);
}
player playsound("cha_ching");
player maps\_zombiemode_score::minus_to_player_score( cost );
for (turret=0;turret < turrets.size; turret++){
turrets[turret] MakeTurretUsable(); //enable all of them
}
self delete();
}

This script is designed to handle sets that consist of one trigger and at least one turret but not limited to one turret. The cost is set to 250 by default. Change it in the init_turrets() function if you would like, or set up a zombie_cost kvp in each trigger if you want.
wow thanks man +1 for you

 
Loading ...