Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: Spawn Model on ground

  1. #11
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts
    // ... somewhere in your code...
    minigun.angles = orientToNormal(trace["normal"]);
    trace is undefined

  2. #12
    Brigadier General
    Join Date
    Oct 2012
    Posts
    998
    Thanks
    20
    Thanked 590 Times in 390 Posts
    Quote Originally Posted by Loveboy View Post
    trace is undefined
    The function Kung posted is from maps\mp\_utility.gsc. It is used as part of the getPlant() function. If you do what serthy suggested, you can use the getPlant() function to find the normals of a map and spawn your turret base at the origin returned by getPlant():

    Code:
    	plant = self maps\mp\_utility::getPlant();
    	turret = spawn( "script_model", plant.origin );
    	turret.angles = plant.angles;
    Your problem then is getting the turret head/barrel to align with the turret base. In COD4, you can do that by finding the origin of the base by a tag name - for example "j_pivot":

    Code:
    	plant = self maps\mp\_utility::getPlant();
    	self.turret_base = spawn( "script_model", plant.origin );
    	self.turret_base.angles = plant.angles;
    
    	self.turret_barrel = spawn( "script_model",  self.turret_base getTagOrigin( "j_pivot" ) );
    	self.turret_barrel.angles = self.turret_base.angles;
    But COD2 does not support getTagOrigin(). So, your problem then is to match the orign and angles of your turret barrel with that of the turret base.

    WARNIG: getPlant() often spawns models below the map surface texture (the "noramal") and often at funny angles.

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

    Loveboy (5th March 2014)

Posting Permissions

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