Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release Spawn Polygons and Pyramids
#1
Hello

Another release for today Big Grin @surtek gave me an idea, but I did it on a different way. The first code spawns carepackages in a regular polygon from a beginning point (that is one of its corners). The pyramid function makes a 4 sided pyramid (if you touch a bit the code you can easily make them 5 sided or whatever).

Code:
SpawnPolygon( point, sides, sidelenght )
{
    angle = ( 360 / sides );
    thing = spawn( "script_model", point );
    thing.angles = ( 0, 0, 0 );
    for( i = 0; i <= ( sides - 1 ); i ++ )
    {
        for( j = 0; j <= sidelenght; j ++ )
        {
            block = spawn( "script_model", thing.origin );
            block setModel("com_plasticcase_friendly");
            block.angles = thing.angles;
            block Solid();
            block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
            thing MoveTo( thing.origin + anglesToForward( thing.angles ) * 55, 0.07 );
            wait ( 0.08 );
        }
        block = spawn( "script_model", thing.origin );
        block setModel("com_plasticcase_friendly");
        block.angles = thing.angles;
        block Solid();
        block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
        thing.angles = ( 0, thing.angles[1] + angle, 0 );
        wait ( 0.1 );
    }
    thing delete();
}

MakePyramid( point, sidelenght )
{
    for( i = 0; i <= sidelenght; i ++ )
    {
        SpawnPolygon( point + i * ( 30,  30, 27 ), 4, sidelenght - i );
        wait 1;
    }
}

Point is the beginning corner, sides is the ammount of sides of the polygon and sidelenght the ammount of carepackages of side (it will be the number you put + 2 )

Examples of use (my partner tested it on Afghan, is in front of TF141 spawn point):

Code:
    //SpawnPolygon( ( 259, -566, 190 ), 6, 5 );
    MakePyramid( ( 259, -566, 150 ), 6 );

[Image: 69orat.jpg]
[Image: sljv34.jpg]

Credits:
- @surtek for idea
- OMA Rhino for testing

Thanks Big Grin
Reply

#2
Why the wait .08?
[Image: MaEIQ.png]
Reply

#3
(06-18-2013, 22:00)Pozzuh Wrote: Why the wait .08?

The guy that tested it changed it to that because he said that with less it lagged Confused
Reply

#4
@Yamato , you're a good guy, giving everyone credits.
Reply

#5
Stop spoiling us.

(No I'm kidding keep doing it.)
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply

#6
**SpawnPolygon

Wink

Nice job as usual Yamato, also, a screenshot would be nice, too lazy to fire up MW2.
[Image: 30xhrep.png]

A casual conversation between barata and I about Nukem.
Reply

#7
(06-20-2013, 06:33)master131 Wrote: **SpawnPolygon

Wink

Nice job as usual Yamato, also, a screenshot would be nice, too lazy to fire up MW2.

Yes, I corrected it, polgono is in spanish, I did a translation fail jaja. Ill add 2 screenshots.
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
Exclamation [Request] Random Weapon At Spawn Scripts18 3 4,732 07-27-2013, 23:53
Last Post: DidUknowiPwn
  Help Spawn Message Playing on Respawn? Killjoy 7 5,222 07-11-2013, 14:53
Last Post: Killjoy
  Question on how to "Spawn" a flying rocket as a player? akillj 8 5,528 06-04-2013, 01:54
Last Post: rotceh_dnih
  Help pickup mod + spawn fx m4gicaL 1 2,665 03-07-2013, 17:52
Last Post: tadej
  Help No more free spawn influencers! JustDoingThisShit 0 5,085 02-03-2013, 20:21
Last Post: JustDoingThisShit
  W@W: Making player spawn with a custom default class. koil 9 5,444 01-13-2013, 12:10
Last Post: koil
  spawn object SaviouR9966 3 2,939 01-08-2013, 14:31
Last Post: 99IRock
  Help Spawn on predefined points problem islamsaab 2 2,831 09-29-2012, 21:23
Last Post: islamsaab
  Help Spawn Weapon Models Ich1994 3 3,473 07-15-2012, 14:20
Last Post: archit
  [Release] Spawn Protection plugin estebespt 7 6,391 06-13-2012, 01:59
Last Post: estebespt

Forum Jump:


Users browsing this thread:
2 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.