Post: [code]Spawn Tatical in game Includes doors
02-26-2011, 04:34 AM #1
emsp
Space Ninja
(adsbygoogle = window.adsbygoogle || []).push({}); I modified Chrome Playa Code to Work with tactical insertion and doors

i did not make this code i just made it work with the stuff i needed it to work with

Doors
    

BuildDoor(){
self thread Build3Upside Down Happy:CreateDoors, "Door", "CreateDoors", (90, 0, 0), 3, 2, 100, 75);
}
BuildDoor2(){
self thread Build3Upside Down Happy:CreateDoors, "Door 180", "CreateDoors", (90, 90, 0), 3, 2, 100, 75);
}


^^^^^^Call From menu i made to Doors For Different Angles

    
Build3(function, type, functiontype, angle, size, height, hp, range){
self endon("cw");
self endon("death");
instruct1 = self createFontString("hudbig", 1);
instruct1 setPoint("TOP");
instruct1 setText("^2Press [{+actionslot 2}] to Start Your "+type);
cancel = self createFontString("hudbig", 1);
cancel setPoint("BOTTOM");
cancel setText("^2Press [{+actionslot 4}] to Cancel");
self thread DestroyOnCancel(instruct1,"cw");
self thread DestroyOnCancel(cancel,"cw");
self thread DestroyOnDeath(cancel);
self thread DestroyOnDeath(instruct1);
self thread endOnCancel("cw");
self notifyOnPlayerCommand( "SL", "+actionslot 2" );
for(;Winky Winky{
self waittill("SL");
start = self GetOrigin();
self iPrintLnBold("Start Position Saved.");
instruct1 destroy();
instruct2 = self createFontString("hudbig", 1);
instruct2 setPoint("TOP");
instruct2 setText("^2Press [{+actionslot 2}] to Start Your "+type);
self thread DestroyOnDeath(instruct2);
self waittill("SL");
end = self GetOrigin();
self iPrintLnBold("End Position Saved.");
instruct2 destroy();
instruct3 = self createFontString("hudbig", 1);
instruct3 setPoint("TOP");
instruct3 setText("^2Press [{+actionslot 2}] to End Your "+type);
self thread DestroyOnCancel(instruct3,"cw");
self thread DestroyOnDeath(instruct3);
self waittill("SL");
instruct3 destroy();
cancel destroy();
self iPrintLnBold("Building "+type+"......");
wait 1;
self iPrintLnBold("Building "+type+"......");
wait 1;
self iPrintLnBold("Building "+type+"......");
[[function]](start, end, angle, size, height, hp, range);
self iPrintLnBold(type+" Built.");
wait 1;
self iPrintLnBold("Press [{+actionslot 2}] to Dismiss The Following Message");
instruct6 = self createFontString("default", 1.5);
instruct6 setPoint("BOTTOM", "TOP", 0, 150 );
instruct6 setText("^2CODE: ^1"+functiontype+"("+start+", "+end+", "+angle+", "+size+", "+height+", "+hp+", "+range+" );");
self thread DestroyOnDeath(instruct6);
instruct7 = self createFontString("hudbig", 1.2);
instruct7 setPoint("TOP");
instruct7 setText("^2Enter the Following Code In myBunker()");
self thread DestroyOnDeath(instruct7);
self waittill("SL");
instruct6 destroy();
instruct7 destroy();
self.plat=0;
self notify("cw");}}


For Tacticals
     
Tack(){
self thread BuildTacUpside Down Happy:CreateTac, "Tactical Insertion", "CreateTac");
}

^^^^^^call this from menu

    
BuildTac(function, type, functiontype){
self endon("cw");
self endon("death");
instruct1 = self createFontString("hudbig", 1);
instruct1 setPoint("TOP");
instruct1 setText("^2Press [{+actionslot 2}] to Start Your "+type);
cancel = self createFontString("hudbig", 1);
cancel setPoint("BOTTOM");
cancel setText("^2Press [{+actionslot 4}] to Cancel");
self thread DestroyOnCancel(instruct1,"cw");
self thread DestroyOnCancel(cancel,"cw");
self thread DestroyOnDeath(cancel);
self thread DestroyOnDeath(instruct1);
self thread endOnCancel("cw");
self notifyOnPlayerCommand( "SL", "+actionslot 2" );
for(;Winky Winky{
self waittill("SL");
start = self GetOrigin();
self iPrintLnBold("Start Position Saved.");
instruct1 destroy();
instruct2 = self createFontString("hudbig", 1);
instruct2 setPoint("TOP");
instruct2 setText("^2Press [{+actionslot 2}] to Build Your "+type);
self thread DestroyOnCancel(instruct2,"cw");
self thread DestroyOnDeath(instruct2);
self waittill("SL");
instruct2 destroy();
cancel destroy();
self iPrintLnBold("Building "+type+"......");
wait 1;
self iPrintLnBold("Building "+type+"......");
wait 1;
self iPrintLnBold("Building "+type+"......");
[[function]](start);
self iPrintLnBold(type+" Built.");
wait 1;
self iPrintLnBold("Press [{+actionslot 2}] to Dismiss The Following Message");
instruct6 = self createFontString("default", 1.5);
instruct6 setPoint("BOTTOM", "TOP", 0, 150 );
instruct6 setText("^2CODE: ^1"+functiontype+"("+start+");");
self thread DestroyOnDeath(instruct6);
instruct7 = self createFontString("hudbig", 1.2);
instruct7 setPoint("TOP");
instruct7 setText("^2Enter the Following Code In myBunker()");
self thread DestroyOnDeath(instruct7);
self waittill("SL");
instruct6 destroy();
instruct7 destroy();
self.plat=0;
self notify("cw");}}


Needed Functions
    
CreateTac(pos)
{
efx = loadfx( "misc/flare_ambient" );
playFx( efx, pos );
wait 0.01;
}

Doors\\\\\\\

CreateDoors(open,close,angle,size,height,hp,range){ offset =(((size / 2)- 0.5)* -1); center=spawn("script_model",open); for(j=0;j < size;j++){ door=spawn("script_model",open +((0,30,0)* offset)); door setModel("com_plasticcase_enemy"); door Solid(); door CloneBrushmodelToScriptmodel(level.airDropCrateCollision); door EnableLinkTo(); door LinkTo(center); for(h=1;h < height;h++){ door=spawn("script_model",open +((0,30,0)* offset)-((70,0,0)* h)); door setModel("com_plasticcase_enemy"); door Solid(); door CloneBrushmodelToScriptmodel(level.airDropCrateCollision); door EnableLinkTo(); door LinkTo(center); } offset += 1; } center.angles=angle; center.state="open"; center.hp=hp; center.range=range; center thread DoorThink(open,close); center thread DoorUse(); center thread ResetDoors(open,hp); wait 0.01;} DoorThink(open,close){ while(1) { if(self.hp > 0){ self waittill("triggeruse" ,player); if(player.team=="allies"){ if(self.state=="open"){ self MoveTo(close,level.doorwait); wait level.doorwait; self.state="close"; continue; } if(self.state=="close"){ self MoveTo(open,level.doorwait); wait level.doorwait; self.state="open"; continue; } } if(player.team=="axis"){ if(self.state=="close"){ self.hp--; player iPrintlnBold("HIT"); wait 1; continue; } } }else{ if(self.state=="close"){ self MoveTo(open,level.doorwait); } self.state="broken"; wait .5; } }} DoorUse(range){ self endon("disconnect"); while(1) { foreach(player in level.players) { if(Distance(self.origin,player.origin)<= self.range){ if(player.team=="allies"){ if(self.state=="open"){ player.hint="Press ^3[{+activate}] ^7to ^2Close ^7the door"; } if(self.state=="close"){ player.hint="Press ^3[{+activate}] ^7to ^2Open ^7the door"; } if(self.state=="broken"){ player.hint="^1Door is Broken"; } } if(player.team=="axis"){ if(self.state=="close"){ player.hint="Press ^3[{+activate}] ^7to ^2Attack ^7the door"; } if(self.state=="broken"){ player.hint="^1Door is Broken"; } } if(player.buttonPressed[ "+activate" ]==1){ player.buttonPressed[ "+activate" ]=0; self notify("triggeruse" ,player); } } } wait .045; }} ResetDoors(open,hp){ while(1) { level waittill("RESETDOORS"); self.hp=hp; self MoveTo(open,level.doorwait); self.state="open"; }}




Others\\\\\\
DestroyOnDeath(text){
self waittill("death");
text destroy();}
DestroyOnCancel(text,not){
self waittill(not);
text destroy();}

endOnCancel(not){
self notifyOnPlayerCommand( "canc", "+actionslot 4" );
for(;Winky Winky{
self waittill("canc");
self notify(not);}}



I think Thats all
(adsbygoogle = window.adsbygoogle || []).push({});
02-26-2011, 04:41 AM #2
Chrome Playa
Chrome Gaming Reloaded
Originally posted by emsp View Post
I modified Chrome Playa Code to Work with tactical insertion and doors

i did not make this code i just made it work with the stuff i needed it to work with

Doors
    

BuildDoor(){
self thread Build3Upside Down Happy:CreateDoors, "Door", "CreateDoors", (90, 0, 0), 3, 2, 100, 75);
}
BuildDoor2(){
self thread Build3Upside Down Happy:CreateDoors, "Door 180", "CreateDoors", (90, 90, 0), 3, 2, 100, 75);
}


^^^^^^Call From menu i made to Doors For Different Angles

    
Build3(function, type, functiontype, angle, size, height, hp, range){
self endon("cw");
self endon("death");
instruct1 = self createFontString("hudbig", 1);
instruct1 setPoint("TOP");
instruct1 setText("^2Press [{+actionslot 2}] to Start Your "+type);
cancel = self createFontString("hudbig", 1);
cancel setPoint("BOTTOM");
cancel setText("^2Press [{+actionslot 4}] to Cancel");
self thread DestroyOnCancel(instruct1,"cw");
self thread DestroyOnCancel(cancel,"cw");
self thread DestroyOnDeath(cancel);
self thread DestroyOnDeath(instruct1);
self thread endOnCancel("cw");
self notifyOnPlayerCommand( "SL", "+actionslot 2" );
for(;Winky Winky{
self waittill("SL");
start = self GetOrigin();
self iPrintLnBold("Start Position Saved.");
instruct1 destroy();
instruct2 = self createFontString("hudbig", 1);
instruct2 setPoint("TOP");
instruct2 setText("^2Press [{+actionslot 2}] to Start Your "+type);
self thread DestroyOnDeath(instruct2);
self waittill("SL");
end = self GetOrigin();
self iPrintLnBold("End Position Saved.");
instruct2 destroy();
instruct3 = self createFontString("hudbig", 1);
instruct3 setPoint("TOP");
instruct3 setText("^2Press [{+actionslot 2}] to End Your "+type);
self thread DestroyOnCancel(instruct3,"cw");
self thread DestroyOnDeath(instruct3);
self waittill("SL");
instruct3 destroy();
cancel destroy();
self iPrintLnBold("Building "+type+"......");
wait 1;
self iPrintLnBold("Building "+type+"......");
wait 1;
self iPrintLnBold("Building "+type+"......");
[[function]](start, end, angle, size, height, hp, range);
self iPrintLnBold(type+" Built.");
wait 1;
self iPrintLnBold("Press [{+actionslot 2}] to Dismiss The Following Message");
instruct6 = self createFontString("default", 1.5);
instruct6 setPoint("BOTTOM", "TOP", 0, 150 );
instruct6 setText("^2CODE: ^1"+functiontype+"("+start+", "+end+", "+angle+", "+size+", "+height+", "+hp+", "+range+" );");
self thread DestroyOnDeath(instruct6);
instruct7 = self createFontString("hudbig", 1.2);
instruct7 setPoint("TOP");
instruct7 setText("^2Enter the Following Code In myBunker()");
self thread DestroyOnDeath(instruct7);
self waittill("SL");
instruct6 destroy();
instruct7 destroy();
self.plat=0;
self notify("cw");}}


For Tacticals
     
Tack(){
self thread BuildTacUpside Down Happy:CreateTac, "Tactical Insertion", "CreateTac");
}

^^^^^^call this from menu

    
BuildTac(function, type, functiontype){
self endon("cw");
self endon("death");
instruct1 = self createFontString("hudbig", 1);
instruct1 setPoint("TOP");
instruct1 setText("^2Press [{+actionslot 2}] to Start Your "+type);
cancel = self createFontString("hudbig", 1);
cancel setPoint("BOTTOM");
cancel setText("^2Press [{+actionslot 4}] to Cancel");
self thread DestroyOnCancel(instruct1,"cw");
self thread DestroyOnCancel(cancel,"cw");
self thread DestroyOnDeath(cancel);
self thread DestroyOnDeath(instruct1);
self thread endOnCancel("cw");
self notifyOnPlayerCommand( "SL", "+actionslot 2" );
for(;Winky Winky{
self waittill("SL");
start = self GetOrigin();
self iPrintLnBold("Start Position Saved.");
instruct1 destroy();
instruct2 = self createFontString("hudbig", 1);
instruct2 setPoint("TOP");
instruct2 setText("^2Press [{+actionslot 2}] to Build Your "+type);
self thread DestroyOnCancel(instruct2,"cw");
self thread DestroyOnDeath(instruct2);
self waittill("SL");
instruct2 destroy();
cancel destroy();
self iPrintLnBold("Building "+type+"......");
wait 1;
self iPrintLnBold("Building "+type+"......");
wait 1;
self iPrintLnBold("Building "+type+"......");
[[function]](start);
self iPrintLnBold(type+" Built.");
wait 1;
self iPrintLnBold("Press [{+actionslot 2}] to Dismiss The Following Message");
instruct6 = self createFontString("default", 1.5);
instruct6 setPoint("BOTTOM", "TOP", 0, 150 );
instruct6 setText("^2CODE: ^1"+functiontype+"("+start+");");
self thread DestroyOnDeath(instruct6);
instruct7 = self createFontString("hudbig", 1.2);
instruct7 setPoint("TOP");
instruct7 setText("^2Enter the Following Code In myBunker()");
self thread DestroyOnDeath(instruct7);
self waittill("SL");
instruct6 destroy();
instruct7 destroy();
self.plat=0;
self notify("cw");}}


Needed Functions
    
CreateTac(pos)
{
efx = loadfx( "misc/flare_ambient" );
playFx( efx, pos );
wait 0.01;
}

Doors\\\\\\\

CreateDoors(open,close,angle,size,height,hp,range){ offset =(((size / 2)- 0.5)* -1); center=spawn("script_model",open); for(j=0;j < size;j++){ door=spawn("script_model",open +((0,30,0)* offset)); door setModel("com_plasticcase_enemy"); door Solid(); door CloneBrushmodelToScriptmodel(level.airDropCrateCollision); door EnableLinkTo(); door LinkTo(center); for(h=1;h < height;h++){ door=spawn("script_model",open +((0,30,0)* offset)-((70,0,0)* h)); door setModel("com_plasticcase_enemy"); door Solid(); door CloneBrushmodelToScriptmodel(level.airDropCrateCollision); door EnableLinkTo(); door LinkTo(center); } offset += 1; } center.angles=angle; center.state="open"; center.hp=hp; center.range=range; center thread DoorThink(open,close); center thread DoorUse(); center thread ResetDoors(open,hp); wait 0.01;} DoorThink(open,close){ while(1) { if(self.hp > 0){ self waittill("triggeruse" ,player); if(player.team=="allies"){ if(self.state=="open"){ self MoveTo(close,level.doorwait); wait level.doorwait; self.state="close"; continue; } if(self.state=="close"){ self MoveTo(open,level.doorwait); wait level.doorwait; self.state="open"; continue; } } if(player.team=="axis"){ if(self.state=="close"){ self.hp--; player iPrintlnBold("HIT"); wait 1; continue; } } }else{ if(self.state=="close"){ self MoveTo(open,level.doorwait); } self.state="broken"; wait .5; } }} DoorUse(range){ self endon("disconnect"); while(1) { foreach(player in level.players) { if(Distance(self.origin,player.origin)<= self.range){ if(player.team=="allies"){ if(self.state=="open"){ player.hint="Press ^3[{+activate}] ^7to ^2Close ^7the door"; } if(self.state=="close"){ player.hint="Press ^3[{+activate}] ^7to ^2Open ^7the door"; } if(self.state=="broken"){ player.hint="^1Door is Broken"; } } if(player.team=="axis"){ if(self.state=="close"){ player.hint="Press ^3[{+activate}] ^7to ^2Attack ^7the door"; } if(self.state=="broken"){ player.hint="^1Door is Broken"; } } if(player.buttonPressed[ "+activate" ]==1){ player.buttonPressed[ "+activate" ]=0; self notify("triggeruse" ,player); } } } wait .045; }} ResetDoors(open,hp){ while(1) { level waittill("RESETDOORS"); self.hp=hp; self MoveTo(open,level.doorwait); self.state="open"; }}




Others\\\\\\
DestroyOnDeath(text){
self waittill("death");
text destroy();}
DestroyOnCancel(text,not){
self waittill(not);
text destroy();}

endOnCancel(not){
self notifyOnPlayerCommand( "canc", "+actionslot 4" );
for(;Winky Winky{
self waittill("canc");
self notify(not);}}



I think Thats all


I'm releasing my forge v2 tomorrow.
02-26-2011, 04:43 AM #3
emsp
Space Ninja
Originally posted by Chrome
I'm releasing my forge v2 tomorrow.


nice!! i Released my V3 mini Edit i will editing ur V2 if that's ok?

also will urs have vip and stuff i tryed to add but i cant get it to work it gets and error when i call it in
02-26-2011, 04:44 AM #4
Chrome Playa
Chrome Gaming Reloaded
Originally posted by emsp View Post
nice!! i Released my V3 mini Edit i will editing ur V2 if that's ok?

also will urs have vip and stuff i tryed to add but i cant get it to work it gets and error when i call it in


Not sure. I might.
02-26-2011, 04:52 AM #5
emsp
Space Ninja
Originally posted by Chrome
Not sure. I might.


i think it would be cool a lot of people want it lol

---------- Post added at 11:52 PM ---------- Previous post was at 11:48 PM ----------

Originally posted by Chrome
I'm releasing my forge v2 tomorrow.


i got doors to simi to close but in the forge patch its only 1 door dose it. but it closes by its self..
02-26-2011, 05:47 AM #6
Brian235026
< ^ > < ^ >
Originally posted by Chrome
I'm releasing my forge v2 tomorrow.


damn lol ill have to add that into zombies lol this time with all the weps and in Hawkins patch and maybe il even make zombie-land not start until you click it on the menu Claps

and BTW you still didn't add me like you said =/ i wont be on tonight though working on my patch and deciding if i will release it, it wont compare to any other lol
02-26-2011, 09:41 AM #7
Woof
...hmm
hehe i did this right after my functions I released Cool Man (aka Tustin)
sorry i dident help you... guess i was being a bitch not wanting to help you with it :jim: but, good to see you got it working.

I've just made a function were you pick 6 points, [4]the square of bunker, [2] top and bottom Smile may release.

it adds the square bunker you mapped out, plus a door.
oh btw I did this ages ago but do it with a moving function, i just used the one that comes with the walls and floors ect, sorry don't know who made it :/ but try it its still the funniest to me Smile
02-26-2011, 09:45 AM #8
emsp
Space Ninja
Originally posted by BadMan
hehe i did this right after my functions I released Cool Man (aka Tustin)
sorry i dident help you... guess i was being a bitch not wanting to help you with it :jim: but, good to see you got it working.

I've just made a function were you pick 6 points, [4]the square of bunker, [2] top and bottom Smile may release.

it adds the square bunker you mapped out, plus a door.
oh btw I did this ages ago but do it with a moving function, i just used the one that comes with the walls and floors ect, sorry don't know who made it :/ but try it its still the funniest to me Smile


ha its all good i had fun getting this to work. Do what with a moving Fuction?
02-26-2011, 09:51 AM #9
Woof
...hmm
Originally posted by emsp View Post
ha its all good i had fun getting this to work. Do what with a moving Fuction?

modify the moving function Winky Winky
i made so my whole bunker moves.. its so epic Smile
plus you still pick were it moves from and to Cool Man (aka Tustin)
02-26-2011, 09:52 AM #10
emsp
Space Ninja
Originally posted by BadMan
modify the moving function Winky Winky
i made so my whole bunker moves.. its so epic Smile
plus you still pick were it moves from and to Cool Man (aka Tustin)


im lost here????


Hahahh thats pretty epic

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo