What's new

Code [GSC] Zombies Spawnable The Claw

  • Thread starter Cryptic7s
  • Start date
  • Views 866
C

Cryptic7s

Enthusiast
Messages
384
Reaction score
48
just a small release. originally created by Mikeeeyy and AgreedBog on World at War, its The Claw!

Place the code below inside your init() script:

Code:
models = strTok("zombie_vending_doubletap2","collision_clip_sphere_32","collision_clip_sphere_64","p6_zm_cratepile","p6_zm_tm_packapunch","zombie_teddybear","defaultactor","defaultvehicle", "zombie_vending_jugg", "t6_wpn_supply_drop_ally", "test_sphere_silver", ";");
        array_precache(models, "model");

Then inside your source, create a new .gsc file, name it Spawnables, and add this:

Code:
Build_TheClaw()

{

    level endon("Destroy_Claw");

    level.clawOrg = self.origin;

    pos = level.clawOrg+(0,15,460);

   

    level.ClawSeats = [];

    level.claw = [];

    level.legs = [];

   

    level.attach = modelSpawner(level.clawOrg+(0,55,60),"tag_origin");

    level.ClawLink = modelSpawner(pos,"tag_origin");

   

    for(e=0;e<2;e++) for(a=0;a<8;a++)

        level.legs[level.legs.size] = modelSpawner(level.clawOrg + (-220,-145+e*320,0) + (a*28,0,a*60),"test_sphere_silver",(25,0,90),.1);

    for(e=0;e<2;e++) for(a=0;a<8;a++)

        level.legs[level.legs.size] = modelSpawner(level.clawOrg + (220,-145+e*320,0) + (a*-28,0,a*60),"test_sphere_silver",(-25,0,90),.1);

    for(a=0;a<5;a++) for(e=0;e<8;e++)

        level.claw[level.claw.size] = modelSpawner(level.clawOrg + (0,-125+a*70,460) + (sin(-90+e*45)*25, 0, sin(e*45)*25), "test_sphere_silver", ((e*45),180,0),.1);

    for(a=0;a<8;a++) for(e=0;e<6;e++)

        level.claw[level.claw.size] = modelSpawner(level.clawOrg + (0,15,460) + (cos(a*45)*30,sin(a*45)*30, e*-70), "test_sphere_silver", (0,(a*45)+90,90),.1);

    level.claw[level.claw.size] = modelSpawner(level.clawOrg + (0,15, 60), "test_sphere_silver", (0,90,90),.1);  

    for(a=0;a<2;a++) for(e=0;e<12;e++)

        level.claw[level.claw.size] = modelSpawner(level.clawOrg + (0,15,100) + (cos(e*30)*40+a*55,sin(e*30)*40+a*55, -70), "test_sphere_silver", (0,(e*30)+-90+a*90,0),.1);

    for(e=0;e<12;e++) level.ClawSeats[level.ClawSeats.size] = modelSpawner(level.clawOrg + (0,15,95) + (cos(e*30)*95,sin(e*30)*95, -70), "test_sphere_silver", Undefined,.1);

   

    foreach(model in level.claw)

        model linkTo(level.ClawLink);

    foreach(model in level.ClawSeats)

        model linkTo(level.ClawLink);

   

    level.ClawLink thread ClawMovements();

    level.attach thread monitorPlayersClaw( level.ClawSeats );

}



ClawMovements()

{

    level endon("Destroy_Claw");

    for(a=0;a>=-40;a-=2)

    {

        self rotateTo((a,self.angles[1],0),.5);

        wait .1;

    }

    for(a=a;a<=60;a+=3)

    {

        self rotateTo((a,self.angles[1],0),.5);

        wait .1;

    }

    for(a=a;a>=-80;a-=3)

    {

        self rotateTo((a,self.angles[1],0),.5);

        wait .05;

    }

    for(a=a;a<=100;a+=4)

    {

        self rotateTo((a,self.angles[1],0),.5);

        wait .05;

    }

    while(true)

    {

        for(a=a;a>=-105;a-=5)

        {

            self rotateTo((a,self.angles[1],0),.5);

            wait .05;

        }

        for(a=a;a<=105;a+=5)

        {

            self rotateTo((a,self.angles[1],0),.5);

            wait .05;

        }

        wait .05;

    }

}



monitorPlayersClaw(Array)

{

    level endon("Destroy_Claw");

    level.ClawTrig = spawnTrig(self.origin,150,80,"HINT_NOICON","Press &&1 To Enter / Exit The Claw!");

    while(isDefined(self))

    {

        level.ClawTrig waittill("trigger",i);

        if(i useButtonPressed() && !i.riding)

        {

            RandSeat = RandomIntRange( 0, 13 );

            if(!RandSeat.occupied)

            {

                i setStance("stand");

                i.riding = true;

                i playerLinkToDelta(Array[RandSeat]);

                i thread playerExitClaw(RandSeat);

                RandSeat.occupied = true;

            }

        }

    }

}

playerExitClaw(seat,info)

{

    level endon("Destroy_Claw");

    while(isDefined(seat))

    {

        if(self fragButtonPressed()) break;

        wait .05;

    }

    info destroy();

    self allowSprint(true);

    self allowProne(true);

    seat.occupied = undefined;

    self unlink();

    self setStance("stand");

    wait 1;

    self.riding = undefined;

}

modelSpawner(origin, model, angles, time)

{

    if(isDefined(time))

        wait time;

    obj = spawn("script_model", origin);

    obj setModel(model);

    if(isDefined(angles))

        obj.angles = angles;

    if(getentarray().size >= 2000)

    {

        self iprintln("^1Error^7: Please delete some other structures");

        obj delete();

    }

    return obj;

}



createRoll( divide )

{

    roll = self getPlayerAngles()[1];

    wait 0.05;

    return (((roll-self getPlayerAngles()[1])*-6) / divide);

}



calcDistance(speed,origin,moveTo)

{

    return (distance(origin, moveTo) / speed);

}



spawnTrig(origin,width,height,cursorHint,string)

{

    trig = spawn("trigger_radius", origin, 1, width, height);

    trig setCursorHint(cursorHint, trig);

    trig setHintString( string );

    trig setvisibletoall();

    return trig;

}



rotateEntYaw(yaw,time)

{

    while(isDefined(self))

    {

        self rotateYaw(yaw,time);

        wait time;

    }

}  



SpawnPlayFx(Fx,pos,ID,Delay,DelayFx)

{  

    if(getentarray().size <= 2000)

    {

        if(!isDefined(pos))

            pos = (0,0,0);

        if(isDefined(Delay))

            wait Delay;

           

        if(ID == "Loop")

            level.SpawnedFx[level.SpawnedFx.size] = PlayLoopedFX(level._effect[Fx], DelayFx, (self.origin + (pos)));

        if(ID == "Normal")

            level.SpawnedFx[level.SpawnedFx.size] = spawnFx(level._effect[Fx], (self.origin + (pos)));

        triggerFx(level.SpawnedFx[level.SpawnedFx.size-1]);

    }  

}

to call it in your menu, follow this:

self add_option("menu", "Spawn The Claw", ::Build_TheClaw);

credit:
Extinct for the original Multiplayer script, Mikeeyy and AgreedBog for the World at War release, and Loz. I only take credit for switching it from Multiplayer to Zombies, and fixing some issues that came from that. Works on all maps
 
Last edited:
H

Harry

Dope
Premium
Messages
4,006
Reaction score
2,057
I do actually remember this from back in the day! Great to see stuff like this still being worked on and released :smile:.
 
C

Cryptic7s

Enthusiast
Messages
384
Reaction score
48
I do actually remember this from back in the day! Great to see stuff like this still being worked on and released :smile:.
I believe Extinct, Loz, and Bog updated it for Multiplayer with Infinity Loader, I just ported it to Zombies. Thanks for the feedback, and enjoy!
 
C

Cryptic7s

Enthusiast
Messages
384
Reaction score
48
Update incoming, I’ve rewritten most of the scripts for this, and it’s a lot cleaner now. Will also be updated with a new project I’ve been working on based on the Infinity Loader rollercoaster, but completely custom.
 
Top Bottom