Results 1 to 6 of 6

Thread: About vehicles

  1. #1
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts

    About vehicles

    Hey

    I've been trying to modify the united noobs vehicle mod, and I was wondering... why aren't vehicles used in the original maps?
    I know there are a lot of anti-glitch invisible walls, so, wouldn't be good to use a plane, but what about the jeeps? is it possible? Would be really fun to play some maps with those.
    set logfile 2

  2. #2
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts
    Hello guiismiti!

    It's surely possible to play with jeeps in original maps, but I wouldn't do that, because the maps are small and full of buildings.
    It's better if you do an own map: big, free of buildings and some grass on the ground.

  3. The Following User Says Thank You to Loveboy For This Useful Post:

    guiismiti (29th August 2014)

  4. #3
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    I've been reading the scripts and can't find the link between the vehicles and the maps where the vehicles are enabled.
    Why is it that the original maps can't be loaded?

    I'm gonna try to enable jeeps in toujane and carentan - and disable the damage from collision depending on mapname I don't think I'll need help for this but, still need to know what to do for it to be enabled.

    What I understood so far is, all vehicles are weapons (planes are grenades that explode on collision), just like sprint.

    I'm gonna keep reading, thanks in advance.
    set logfile 2

  5. #4
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    iirc the un vehicle mod uses the ctf-flags to calculate the vehicle spawn positions. this is because their mod originally should work only on their custom map mp_libya.
    however you can load the un mod on standard maps, but the vehicles will spawn outside of the map. you should rewrite the entire mod, as the un mod has such a bad performance anyways.

    PUNISH ME
    Last edited by serthy; 30th August 2014 at 11:23.

  6. The Following 2 Users Say Thank You to serthy For This Useful Post:

    guiismiti (30th August 2014),kung foo man (30th August 2014)

  7. #5
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    Well, almost everything is working. I'm using vehicles in TDM with bots (bots don't know how to use it, ofc, they will be there just to get some people into the server)
    The maps I'm using - mp_iceberg_v2 (planes and AA only), mp_iwo_jima_1, mp_gunslingers, zzz_vokbeta
    and also El Alamein (planes and AA only - it's not bad for planes - no buildings, map limits are far away).

    For the AA and jeep spawns I simply used fixed positions I chose in game.

    I'm stuck with the following problem, though - when I eject from a plane and immediately try to use an AA / jeep, I don't get attached.
    When plane pilots eject, the plane falls, explodes and, after a few seconds, it's removed.
    What is happening exactly - I eject, I open the chute, I use an AA or jeep.
    If the plane is still in the map (still in the air, falling, or on the ground, blown up), I don't get attached.
    After the plane is removed, I get properly attached.
    I noticed that, if I leave the AA and use it again while the plane is still in the map, I get attached properly.

    I tested the original mod, it's CTF with random relative spawns around the flag. The bug does not happen then.
    But if I set fix locations for the spawns, the bug will happen.

    Can anybody help, please?

    Here is the code for aa_spawn.
    What has changed is this:

    aa = spawn( "script_model", aaorigin );

    That used to be like this:

    aa = spawn( "script_model", origin );

    I'm now giving the function the location for the spawn, instead of letting it get a random one.
    PHP Code:
    aa_spawn(teamplusAnglesaaorigin)
    {
        
    self endon("intermission");
        
        if( !
    isDefinedteam ) )
            
    team "axis";
        if( !
    isDefinedplusAngles ) )
            
    plusAngles = (0,0,0);
        
        
    alliedf getentarray("allied_flag""targetname");
        
    axisf getentarray("axis_flag""targetname");

        
    originAllied alliedf[0getOrigin();
        
    originAxis =   axisf[0getOrigin();

        
    temp = (0,0,0);
        if( 
    team == "axis" )
        {
            
    tempOrigin originAxis;
            
    temp vectorToAnglesoriginAxis originAllied );
        }
        else
        {
            
    temp vectorToAnglesoriginAllied originAxis );
            
    tempOrigin originAllied;
        }
        
        
    tempF anglesToForwardtemp );
        
        
    temp vector_scaletempFrandomIntRangelevel.aaMinFarBack,level.aaMaxFarBack) );
        
        
    temp += tempOrigin;
        
        
    origin temp;
        
        
    waitrandomIntRange2,) );    
                
        
    randomIntRangelevel.aaMinXlevel.aaMaxX);
        
    randomIntRangelevel.aaMinYlevel.aaMaxY);
        
        
    trace bulletTraceorigin + (x,y,500), origin - (xy11500 ), falseundefined );
        
    origin trace["position"] ;
        
        
    aa spawn"script_model"aaorigin );
        
    aa setModelgame["aa"] );
        
    aa show();
        
        
    aa.cannonRounds = [];
        
    //aa.properties = [];
        
        
    anglesF anglesToForwardaa.angles );
        
    anglesR anglesToRightaa.angles );
        
    anglesU anglesToUpaa.angles );
        
        
        
    // GUNS GUNS GUNS 
        
    aa.properties["gun0"]["f"] = 100;
        
    aa.properties["gun0"]["r"] = -19;
        
    aa.properties["gun0"]["u"] = 56.5;
        
        
    aa.properties["gun1"]["f"] = 100;
        
    aa.properties["gun1"]["r"] = 19;
        
    aa.properties["gun1"]["u"] = 39.5;


        
    aa.properties["gun2"]["f"] = 100;
        
    aa.properties["gun2"]["r"] = -19;
        
    aa.properties["gun2"]["u"] = 40;

        
    aa.properties["gun3"]["f"] = 100;
        
    aa.properties["gun3"]["r"] = 19;
        
    aa.properties["gun3"]["u"] = 56;

        
    maxRounds 20;

        
    aa.cannonRoundsaa.cannonRounds.size ] = maxRounds;
        
    aa.cannonRoundsaa.cannonRounds.size ] = maxRounds;
        
    aa.cannonRoundsaa.cannonRounds.size ] = maxRounds;
        
    aa.cannonRoundsaa.cannonRounds.size ] = maxRounds;

    /////////////////////////////////////

        // GUNNER
        
    aa.properties["gunner"]["f"] = -30;
        
    aa.properties["gunner"]["r"] = 1;
        
    aa.properties["gunner"]["u"] = 20;
        

        
    aa.gunner undefined;
        
    aa.gunner undefined;

        
    // END GUNNER
        
        
    aa.fireSetting 1;
        
    aa.team team;
        
    aa.weaponName "aa_mp";
        
    aa.angles += plusAngles;
        
    aa.plusAngles plusAngles;
        
    aa.damage 0;
        
    aa.maxDamage level.aaMaxDamage;
        
    aa.vehicleType "aa";
        
    aa thread scriptedTrigger75.0);
        
    aa thread onTrigger( );
        
    aa thread trackDamage(aaorigin);


    And this is spawn_jeep. New spawn location called jeeporigin now
    PHP Code:
    spawn_jeepteamjeeporigin )
    {

        
    origin = (-3920011383, -320);

        if( 
    team == "allies")
            
    spawnpointname "mp_ctf_spawn_allied";
        else
            
    spawnpointname "mp_ctf_spawn_axis";

        
    sp getentarray(spawnpointname"classname");

        
        for(
    01j++ )
        {

            
    temp sprandomIntRange(0sp.size -1) ];

            
    randomIntRange(1,2400);
            
    randomIntRange1,2400 );
            
    trace bulletTracetemp.origin + (x,y,550),temp.origin - (x,y,1000), falseundefined );
        
            
    origin trace["position"];
            
            
    jeeps level.jeeps;
            
    gdist true;
            for(
    0jeeps.sizei++ )
            {
                if( !
    isDefinedjeeps[i] ) )
                    continue;
                    
                
    dist distancejeeps[igetOrigin(), origin);
                
    dist2 distanceorigintemp.origin );
                
                
    itemp origin[2] - temp.origin[2];
                if( ( 
    itemp > -120 && itemp 120 ) & dist 1000 && dist2 140 )
                {
                    
    gdist false;
                    break;
                    
                }
            }
            
            if( 
    gdist == true )
                break;
            
            
    wait(0.1);

        }
        
    wait 1;
        
        
    origin getRandomSpawnteam,80700 );
        
        
    jeep spawn("script_model"jeeporigin );
            
        
    jeep setModelgame["jeep" team] );
        
    jeep show();

        
    jeep.teamAlt team;
        
    anglesF anglesToForwardjeep.angles );
        
    anglesR anglesToRightjeep.angles );
        
        
    temp vector_scaleanglesR, -18);
        
    temp += vector_scaleanglesF, -14);
        
    jeep.driverTag spawn("script_origin"jeep getOrigin() + (0,0,10 ));
        
    jeep.driverTag linkTo(jeep);
        
        
    //***********************************
        // passenger location
        //***********************************
        
    if( team == "axis" )
            
    temp vector_scaleanglesF, -45);
        else
            
    temp vector_scaleanglesF, -50);

        
    jeep.passenger1Tag spawn("script_origin"jeep getOrigin() + temp + (0,0,15 ));
        
    jeep.passenger1Tag linkTo(jeep);

        
    //***********************************
        // turret Back passenger location
        //***********************************
        
    temp vector_scaleanglesF, -50);
        
        
    turrets getentarray ("misc_turret","classname");
        
        
    //***********************************
        // Front Left Tire
        //***********************************
        
    temp vector_scaleanglesF50 );
        
    tireOrigin origin temp;
        
        
    temp vector_scaleanglesR, -25 );
        
    tireOrigin += temp;
        
        
    jeep.frontLeftTire spawn("script_origin"tireOrigin + (0,0,1) );
        
    jeep.frontLeftTire linkTojeep );
        
        
    //***********************************
        // Front Right Tire
        //***********************************
        
    temp vector_scaleanglesF50 );
        
    tireOrigin origin temp;
        
        
    temp vector_scaleanglesR25 );
        
    tireOrigin += temp;
        
        
    jeep.frontRightTire spawn("script_origin"tireOrigin + (0,0,1) );
        
    jeep.frontRightTire linkTojeep );
        
        
    //***********************************
        // Back Left Tire
        //***********************************
        
    temp vector_scaleanglesF, -40 );
        
    tireOrigin origin temp;
        
        
    temp vector_scaleanglesR, -25 );
        
    tireOrigin += temp;
        
            
        
    jeep.backLeftTire spawn("script_origin"tireOrigin + (0,0,1) );
        
    jeep.backLeftTire linkTojeep );
        
        
    //***********************************
        // Back Right Tire
        //***********************************
        
    temp vector_scaleanglesF, -40 );
        
    tireOrigin origin temp;
        
        
    temp vector_scaleanglesR25 );
        
    tireOrigin += temp;
        
        
    jeep.backRightTire spawn("script_origin"tireOrigin + (0,0,1) );
        
    jeep.backRightTire linkTojeep );
        
        
    maxspeed getCvarInt("dvar_jeepMaxSpeed");
        
    minspeed getCvarInt("dvar_jeepMinSpeed");
        if( 
    maxspeed == )
            
    maxspeed 40;
        if( 
    minspeed == )
            
    minspeed = -30;


        
    jeep.sounds = [];
        
    jeep.sounds[0] = "jeep_start";
        
    jeep.sounds[1] = "jeep_idle";
        
    jeep.sounds[2] = "jeep_move";
        
    jeep.sounds[3] = "jeep_horn";
        
    jeep.sounds[4] = "jeep_crash";

        
    jeep.team     team;
        
    jeep.speed     0;
        
    jeep.maxSpeed     maxspeed;
        
    jeep.minSpeed     minspeed;
        
    jeep.jeepAngle 0;
        
    jeep.colPos    = (0,0,0);
        
    jeep.colSurf    "";
        
    jeep.maxDamage    10;
        
    jeep.damage     0;
        
    jeep.vehicleType "jeep";
        
        
    jeep.jeepTimerSet undefined;
        
    level.jeepslevel.jeeps.size ] = jeep;
        
    jeep thread engineON(jeeporigin);
        
    jeep thread jeepBackupTime();

        return 
    jeep;


    P. S. Not getting attached means - I can still move with WASD after using AA or jeep, while shooting / driving it.
    Last edited by guiismiti; 9th September 2014 at 22:17.

  8. #6
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    Also, onPlaneShutDown:

    PHP Code:
    onPlaneShutDown()
    {
        
    self endon"intermission" );
        
    self endon"plane_crashed" );
        
        
    self waittill"plane_shutdown" );
        
    self.shutdown 1;
        
    self playLoopSound"plane_dive" );
        
        
    pilot self.peep;

        
    pilot.minefield undefined;
        
        if( 
    isDefinedpilot ) && isPlayerpilot) && isAlivepilot ) )
        {
            
    pilot openMenugame["chute_menu"] );
            
    pilot.altAngles pilot getPlayerAngles();
            
    pilot thread onMenu();
            
        }

        if( 
    isDefinedself.hitBy ) )
        {
            
    self.hitBy.score++;
            
    self.hitBy.shotdownCount += 1;
        }
        
        
    angles self.angles;
        
    iturn 0;
        if( 
    angles[2] > )
            
    iturn 1;
        else
            
    iturn 2;
        
    irotate randomIntRange(10,60);    
            
        
    du anglesToUpself.angles);    
        
        
    maxTime 60;
        while( 
    isDefinedself ) && self.crashed == 0  )
        {
            
    temp vector_scale(du, - 100 );
            
    self getOrigin() + temp;
            
            
    df anglesToForwardself.angles );
            
    temp vector_scale(df1000);
            
    temp t;
            
    angles vectorToAnglesself getOrigin() );
            
            if( 
    iturn ==)
                
    angles = (angles[0], angles[1], self.angles[2] + irotate );
            else
                
    angles = (angles[0], angles[1], self.angles[2] - irotate );
            
            
    self rotateToanglesrandomFloatRange(.1,.5),0,);
            
    self planeAccel();
            if( 
    isDefinedself.peep ) ) 
                
    self.peep setplayerangles(self.angles);
        
            
    maxTime -= .1;
            
            if( 
    maxTime )
                break;
                
            
    wait.1 );
        }

        if( 
    isDefinedself.peep ) ) 
            
    self.peep setplayerangles((0,0,0));

        
    self stopLoopSound("plane_dive");
        
        if( 
    isDefinedself.peep ) )
            
    self.peep suicide();

        
    self.crashed 1;


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •