ItsMods

Full Version: Spawn fort function
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
umm this was mainly made for wii but thought id release its a function i made that when called on spawns a fort that has a door (optional) porch roof and walls.
to edit where it spawns edit the coords to edit in a door remove the //s at the bottom

This can be used on any map and to those who are blinde edit this
thread spawnFort( ( 1498.76, 717.474, 303.125 ) );///edit this to add to new map

Code:
#include common_scripts\utility;
#include maps\mp\_airsupport;
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;

main()
{
    thread init();
}

init()
{
    thread onPlayerConnect();
    thread spawnFort( ( 1498.76, 717.474, 303.125 ) );///edit this to add anywhere else :)
}

onPlayerConnect()
{    
    for(;;)
    {
        level waittill( "connecting", player );
        player thread onPlayerSpawned();
    }
}

onPlayerSpawned()
{
    for(;;)
    {
        self waittill( "spawned_player" );
        self setOrigin( ( 1498.76, 717.474, 2303.125 ) );
    }
}


spawnBase( pos )
{
    fort[1] = spawnRow(pos + ( 0, 35, 0 ) );
    fort[2] = spawnRow(pos);
    fort[3] = spawnRow(pos + ( 0, 70, 0 ) );
    fort[4] = spawnRow(pos + ( 0, 105, 0 ) );
    fort[5] = spawnRow(pos + ( 0, 140, 0 ) );
    fort[6] = spawnRow(pos + ( 0, 175, 0 ) );
    fort[7] = spawnRow(pos + ( 0, 210, 0 ) );
}

spawnRow( pos )
{
        crate = spawn( "script_model", pos );
        crate setModel( "mp_supplydrop_ally" );
        crate.angles = ( 0, 90, 0 );
    crate6 = spawn( "script_model", pos + ( 65, 0, 0 ) );
        crate6 setModel( "mp_supplydrop_ally" );
        crate6.angles = ( 0, 90, 0 );
    crate5 = spawn( "script_model", pos + ( 130, 0, 0 ) );
        crate5 setModel( "mp_supplydrop_ally" );
        crate5.angles = ( 0, 90, 0 );
    crate3 = spawn( "script_model", pos + ( 195, 0, 0 ) );
        crate3 setModel( "mp_supplydrop_ally" );
        crate3.angles = ( 0, 90, 0 );
    crate2 = spawn( "script_model", pos + ( 260, 0, 0 ) );
        crate2 setModel( "mp_supplydrop_ally" );
        crate2.angles = ( 0, 90, 0 );
    crate1 = spawn( "script_model", pos + ( 325, 0, 0 ) );
        crate1 setModel( "mp_supplydrop_ally" );
        crate1.angles = ( 0, 90, 0 );
}

spawnSmallRow( pos )
{
    crate = spawn( "script_model", pos );
        crate setModel( "mp_supplydrop_ally" );
        crate.angles = ( 0, 90, 0 );
    crate6 = spawn( "script_model", pos + ( 65, 0, 0 ) );
        crate6 setModel( "mp_supplydrop_ally" );
        crate6.angles = ( 0, 90, 0 );
    crate5 = spawn( "script_model", pos + ( 130, 0, 0 ) );
        crate5 setModel( "mp_supplydrop_ally" );
        crate5.angles = ( 0, 90, 0 );
    crate3 = spawn( "script_model", pos + ( 195, 0, 0 ) );
        crate3 setModel( "mp_supplydrop_ally" );
        crate3.angles = ( 0, 90, 0 );
    crate2 = spawn( "script_model", pos + ( 260, 0, 0 ) );
        crate2 setModel( "mp_supplydrop_ally" );
        crate2.angles = ( 0, 90, 0 );
}

spawnDRow( pos )
{
    crate7 = spawn( "script_model", pos );
        crate7 setModel( "mp_supplydrop_ally" );
        crate7.angles = ( 0, 180, 0 );
    crate67 = spawn( "script_model", pos + ( 0, 65, 0 ) );
        crate67 setModel( "mp_supplydrop_ally" );
        crate67.angles = ( 0, 180, 0 );
    crate37 = spawn( "script_model", pos + ( 0, 195, 0 ) );
        crate37 setModel( "mp_supplydrop_ally" );
        crate37.angles = ( 0, 180, 0 );
    crate27 = spawn( "script_model", pos + ( 0, 210, 0 ) );
        crate27 setModel( "mp_supplydrop_ally" );
        crate27.angles = ( 0, 180, 0 );
}

spawnDoor( pos )
{
    level.door = spawn( "script_model", pos + ( 0, 130, 0 ) );
        level.door setModel( "mp_supplydrop_ally" );
        level.door.angles = ( 0, 180, 0 );
    level.door2 = spawn( "script_model", pos + ( 0, 130, 35 ) );
        level.door2 setModel( "mp_supplydrop_ally" );
        level.door2.angles = ( 0, 180, 0 );
}

spawnSRow( pos )
{
    crate = spawn( "script_model", pos );
        crate setModel( "mp_supplydrop_ally" );
        crate.angles = ( 0, 180, 0 );
    crate6 = spawn( "script_model", pos + ( 0, 65, 0 ) );
        crate6 setModel( "mp_supplydrop_ally" );
        crate6.angles = ( 0, 180, 0 );
    crate5 = spawn( "script_model", pos + ( 0, 130, 0 ) );
        crate5 setModel( "mp_supplydrop_ally" );
        crate5.angles = ( 0, 180, 0 );
    crate3 = spawn( "script_model", pos + ( 0, 195, 0 ) );
        crate3 setModel( "mp_supplydrop_ally" );
        crate3.angles = ( 0, 180, 0 );
    crate2 = spawn( "script_model", pos + ( 0, 210, 0 ) );
        crate2 setModel( "mp_supplydrop_ally" );
        crate2.angles = ( 0, 180, 0 );
}

spawnSmallBase( pos )
{
    fort[1] = spawnSmallRow(pos + ( 0, 35, 0 ) );
    fort[2] = spawnSmallRow(pos);
    fort[3] = spawnSmallRow(pos + ( 0, 70, 0 ) );
    fort[4] = spawnSmallRow(pos + ( 0, 105, 0 ) );
    fort[5] = spawnSmallRow(pos + ( 0, 140, 0 ) );
    fort[6] = spawnSmallRow(pos + ( 0, 175, 0 ) );
    fort[7] = spawnSmallRow(pos + ( 0, 210, 0 ) );
}

spawnFort( pos )
{
    house[1] = spawnBase(pos);
    house[2] = spawnSmallBase(pos + ( 65, 0, 140 ) );
    house[3] = spawnSmallRow(pos + ( 65, 0, 35 ) );
    house[4] = spawnSmallRow(pos + ( 65, 0, 70 ) );
    house[5] = spawnSmallRow(pos + ( 65, 0, 105 ) );
    house[6] = spawnSmallRow(pos + ( 65, 210, 35 ) );
    house[7] = spawnSmallRow(pos + ( 65, 210, 70 ) );
    house[8] = spawnSmallRow(pos + ( 65, 210, 105 ) );
    house[9] = spawnSRow(pos + ( 325, 0, 35 ) );
    house[10] = spawnSRow(pos + ( 325, 0, 70 ) );
    house[11] = spawnSRow(pos + ( 325, 0, 105 ) );
    house[12] = spawnSRow(pos + ( 65, 0, 113 ) );
    house[13] = spawnDRow(pos + ( 65, 0, 70 ) );
    house[14] = spawnDRow(pos + ( 65, 0, 35 ) );
    ////house[15] = spawnDoor(pos + ( 65, 0, 35 ) );// this would be used if you wanted to block the fort
}

[Image: blackopsmp2011100714522.jpg]

[Image: blackopsmp2011100714515.jpg]
screenshots / videos would be nice.
Maybe some screens would be nice.

PS: More information would be good.

Example:

wich map was this fort built for?


Screenshots:

[Image: blackopsmp2011100714515.jpg]


[Image: blackopsmp2011100714520.jpg]


[Image: blackopsmp2011100714520.jpg]


[Image: blackopsmp2011100714521.jpg]


[Image: blackopsmp2011100714522.jpg]



Thanks Barata...
this works on all maps as i stated just edit the coords of this value thread spawnFort( ( 1498.76, 717.474, 303.125 ) );
(10-07-2011, 19:08)tonymamoni1 Wrote: [ -> ]this works on all maps as i stated just edit the coords of this value thread spawnFort( ( 1498.76, 717.474, 303.125 ) );

Added the screens myself.
Looks good :p

Though it's kinda useless for PC modders since they can spawn a totally new house made of (or just one) solid xmodel(s).
(10-07-2011, 19:10)Rendflex Wrote: [ -> ]Looks good :p

Though it's kinda useless for PC modders since they can spawn a totally new house made of (or just one) solid xmodel(s).

ik but for peeps on wii its a whole diff story
and i think a house made of care packages looks cooler than u just spawning a real house :p
Why won't you use maya 2009 instead carepackages?
wtf is maya 2009 and if its a tool im a wii user
(10-07-2011, 19:27)tonymamoni1 Wrote: [ -> ]wtf is maya 2009 and if its a tool im a wii user

Maya is a professional tool which let's you create new models, which you later can export to BO using the mod tools.
Pages: 1 2