Call of duty bo3: spinning models

From COD Modding & Mapping Wiki
Revision as of 01:45, 28 December 2023 by Zeroy (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Radiant

  • In radiant, place your model then turn it into a script_model and add some KVPs:
    • targetname value: rotate_model
    • script_noteworthy and value x y or z - depending on the axis of rotation (testing required)
    • speed value: from 0 to 10 (0.5 is default)

Scripting

  • Place in your Main function in MAP GSC:
level thread rotate_fans();
  • Then this at end of the scripts:

function rotate_fans()
{
	rotate_obj = getentarray("rotate_model","targetname");
	
	if(isdefined(rotate_obj))
		{
	 		for(i=0;i<rotate_obj.size;i++)
  				rotate_obj[i] thread rotate();
		}
}

function rotate()
{
	if (!isdefined(self.speed))
 		self.speed = 0.5;

	while(true)
		{
			if (self.script_noteworthy == "z")
  				self rotateYaw(360,self.speed);

 			else if (self.script_noteworthy == "x")
  				self rotateRoll(360,self.speed);

 			else if (self.script_noteworthy == "y")
  				self rotatePitch(360,self.speed);

			wait ((self.speed)-0.1);
		}
}

Extra

If you want to have a dynamic light behind a rotating object, the shadow option must be changed to "always" in order for the model shadow to update in RealTime