Game Modding | Call of Duty: Black Ops 3 | Scripting
ModmeBot:
Thread By: MJPW
Hi there! Im needing help with a script to make a simple Easter Egg where if the player shot certain letters on a sign in the correct order a door would open to a hidden item. This is much like the LOL Easter Egg from Point Of Contact except like I mentioned its for a hidden door. Lets say the word spelled "FIDO" well they would need to shoot F I D and O in that order or it would reset. I think it would work better with triggers that way you could drag a trigger damage over just the letter.
ModmeBot:
Reply By: mathfag
I made a similar ee but to shoot 935 in order on a number pad on my map "935 forest" if you want to test it out. Here's the script. It's horribly written but might help you.
n = needed
d = done
#using scripts\zm\_zm_score;
#using scripts\shared\flag_shared;
#using scripts\shared\util_shared;
#using scripts\codescripts\struct;
#using scripts\custom\forest\ee_teddys;
function init()
{
level.shootable_1n = 2;
level.shootable_1d = 0;
level.shootable_3n = 1;
level.shootable_3d = 0;
level.shootable_5n = 1;
level.shootable_5d = 0;
level.shootable_9n = 1;
level.shootable_9d = 0;
level thread SDFM_Debug();
level thread shootable_9();
//level thread shootable_1();
level thread all_to_zero();
}
function SDFM_Debug( string )
{
if( isDefined(level.SDFMdebug) && level.SDFMdebug )
iprintlnbold( "^6Debug:^7 "+string );
}
function shootable_9()
{
trig_935115_9 = GetEnt("mee_935_9", "targetname");
trig_935115_9 SetHintString("");
trig_935115_9 SetCursorHint("HINT_NOICON");
level.shootable_9d = 0;
level.shootable_3d = 0;
level.shootable_5d = 0;
while(1)
{
trig_935115_9 waittill("trigger", player);
level.shootable_9d = 0;
level.shootable_9d++;
SDFM_Debug("9 shot"); // Not Needed
thread shootable_9done(player);
}
}
function shootable_9done(player)
{
self endon("115music");
self endon("935");
while(1)
{
self waittill(level.shootable_9d >= level.shootable_9n);
if(level.shootable_9d == level.shootable_9n)
{
// What ever code you want to execute once all shootables are collected
SDFM_Debug("9");
player PlaySound("ninethree_accept"+randomintrange(0,1));
level.shootable_3d = 0;
level.shootable_5d = 0;
level thread shootable_3();
}
else
{
player PlaySound("ninethree_fail");
level notify("935");
level thread shootable_9();
}
break;
}
}
function shootable_3()
{
self endon("115music");
self endon("935");
trig_935115_3 = GetEnt("mee_935_3", "targetname");
trig_935115_3 SetHintString("");
trig_935115_3 SetCursorHint("HINT_NOICON");
while(1)
{
trig_935115_3 waittill("trigger", player);
level.shootable_3d = 0;
level.shootable_3d++;
SDFM_Debug("3 shot"); // Not Needed
thread shootable_3done(player);
}
}
function shootable_3done(player)
{
self endon("115music");
self endon("935");
while(1)
{
self waittill(level.shootable_3d >= level.shootable_3n);
if(level.shootable_3d == level.shootable_3n && level.shootable_9d == level.shootable_9n)
{
// What ever code you want to execute once all shootables are collected
SDFM_Debug("3");
player PlaySound("ninethree_accept"+randomintrange(0,1));
level.shootable_5d = 0;
level thread shootable_5();
}
else
{
player PlaySound("ninethree_fail");
level notify("935");
level thread shootable_9();
}
break;
}
}
function shootable_5()
{
self endon("115music");
self endon("935");
trig_935115_5 = GetEnt("mee_935_5", "targetname");
trig_935115_5 SetHintString("");
trig_935115_5 SetCursorHint("HINT_NOICON");
while(1)
{
trig_935115_5 waittill("trigger", player);
level.shootable_5d = 0;
level.shootable_5d++;
SDFM_Debug("5 shot"); // Not Needed
thread shootable_5done(player);
}
}
function shootable_5done(player)
{
self endon("115music");
self endon("935");
while(1)
{
self waittill(level.shootable_5d >= level.shootable_5n);
if(level.shootable_5d == level.shootable_5n && level.shootable_9d == level.shootable_9n && level.shootable_3d == level.shootable_3n)
{
// What ever code you want to execute once all shootables are collected
SDFM_Debug("5");
player PlaySound("mee_obj_spawn");
level thread ninethree_done();
wait(5);
player PlaySound("vox_play_game");
}
else if(level.shootable_5d == level.shootable_5n && level.shootable_1d == level.shootable_1n)
{
level.shootable_1d = 0;
player PlaySound("oneone_done");
level notify("115music");
level notify("935");
SDFM_Debug("numbers"+"1="+level.shootable_1d+" 5="+level.shootable_5d);
level thread all_to_zero();
level thread oneone_done();
}
else
{
// player PlaySound("ninethree_fail");
level notify("935");
level thread shootable_9();
}
break;
}
}
function ninethree_done(player)
{
self endon("115music");
trig_935115_1 = GetEnt("mee_935_1", "targetname");
trig_935115_3 = GetEnt("mee_935_3", "targetname");
trig_935115_5 = GetEnt("mee_935_5", "targetname");
trig_935115_9 = GetEnt("mee_935_9", "targetname");
while(1)
{
self waittill(level.shootable_9d >= level.shootable_9n && level.shootable_5d >= level.shootable_5n && level.shootable_3d >= level.shootable_3n);
if(level.shootable_9d == level.shootable_9n && level.shootable_3d == level.shootable_3n && level.shootable_5d == level.shootable_5n)
{
// What ever code you want to execute once all shootables are collected
SDFM_Debug("935 SHOT");
level.shootable_9d = 0;
level.shootable_3d = 0;
level.shootable_5d = 0;
SDFM_Debug("numbers"+"1="+level.shootable_1d+" 5="+level.shootable_5d);
ee_teddys::init();
}
break;
}
trig_935115_1 Delete();
trig_935115_3 Delete();
trig_935115_5 Delete();
trig_935115_9 Delete();
}
//ONEONE
function shootable_1()
{
self endon("115music");
trig_935115_1 = GetEnt("mee_935_1", "targetname");
trig_935115_1 SetHintString("");
trig_935115_1 SetCursorHint("HINT_NOICON");
while(1)
{
trig_935115_1 waittill("trigger", player);
level.shootable_1d++;
SDFM_Debug("1 shot");
thread shootable_1done(player);
}
}
function shootable_1done(player)
{
self endon("115music");
while(1)
{
self waittill(level.shootable_1d >= level.shootable_1n);
if(level.shootable_1d == level.shootable_1n)
{
// What ever code you want to execute once all shootables are collected
SDFM_Debug("1 1");
player PlaySound("ninethree_accept"+randomintrange(0,1));
level.shootable_5d = 0;
level thread shootable_5();
}
else if(level.shootable_1d > level.shootable_1n)
{
player PlaySound("ninethree_fail");
level.shootable_1d = 0;
level thread shootable_1();
}
break;
}
}
function oneone_done(players)
{
self endon("115music");
trig_935115_1 = GetEnt("mee_935_1", "targetname");
while(1)
{
self waittill(level.shootable_1d >= level.shootable_1n && level.shootable_5d >= level.shootable_5n);
if(level.shootable_1d == level.shootable_1n && level.shootable_5d == level.shootable_5n)
{
// What ever code you want to execute once all shootables are collected
SDFM_Debug("115 SHOT");
players PlaySound("ninethree_fail");
level.shootable_5d = 0;
SDFM_Debug("numbers"+"1="+level.shootable_1d+" 5="+level.shootable_5d);
level notify("115music");
}
break;
}
trig_935115_1 Delete();
}
function all_to_zero()
{
self waittill("115music");
level.shootable_1d = 0;
level.shootable_3d = 0;
level.shootable_5d = 0;
level.shootable_9d = 0;
SDFM_Debug("numbers"+" 1="+level.shootable_1d+" 3="+level.shootable_3d+" 5="+level.shootable_5d+" 9="+level.shootable_9d);
}