Results 1 to 10 of 16

Thread: setmodel

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #12
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by Loveboy View Post
    ******* script compile error *******
    bad syntax: (file 'maps/mp/gametypes/_nuke.gsc', line 166)
    spawnModel( name , pos , angles );
    *
    ************************************
    Let me correct serthy:

    PHP Code:
    spawnModelname pos angles )
    {
        
    model spawn"script_model" pos );
        
    model.angles angles;
        
    model setModelname );
        return 
    model;
    }

    loveboy()
    {
        
    precacheModel"xmodel/vehicle_stuka_flying" );

        
    model spawnModel"xmodel/vehicle_stuka_flying" , ( ) ,  ( 90 ) );

    Basically, DON'T try to call the spawnModel() function without filling in the details: 1. the model, 2, the origin, and 3. the angles. To stop that happening, I would add some checks for such details:

    PHP Code:
    spawnModelmodeloriginangles )
    {
        if( !
    isdefined(model) || !isdefined(origin) )
            return 
    undefined;

        if( !
    isdefined(angles) )
            
    angles = (0,0,0);

        
    spawn spawn ("script_model",(0,0,0));
        
    spawn.origin origin;
        
    spawn setmodel (model);
        
    spawn.angles angles;

        return 
    spawn;

    That will stop the runtime error if you miss out the details, but the model wont spawn.

    HISTORICAL NOTE -

    The spawnModel() was first used in a Call of Duty mod by PoolMaster in his "PoolMaster Mod ver 1.3" for COD1 circa December 2003. But it was made famous by Bell in his AWE mod for COD1 and COD: UO circa 2004 and subsequent years. But Bell got the function from PoolMaster with permission, so correctly speaking, it was PoolMaster who came up with the function in the form it took in AWE. All that was done before the COD1 mod tools came out. We had no help from the developers and pretty much all modding was done by discovering what was possible and passing on the info on the IWNation modding forums. Golden Days of Modding! I miss them.
    Last edited by Tally; 5th May 2013 at 08:07.

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

    kung foo man (10th May 2013),Loveboy (5th May 2013)

Posting Permissions

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