Call of duty bo3: spinning models: Difference between revisions
Jump to navigation
Jump to search
(Created page with " == 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 '...") |
mNo edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
**''targetname'' value: ''rotate_model'' | **''targetname'' value: ''rotate_model'' | ||
**''script_noteworthy'' and value ''x'' ''y'' or ''z'' - depending on the axis of rotation (testing required) | **''script_noteworthy'' and value ''x'' ''y'' or ''z'' - depending on the axis of rotation (testing required) | ||
**''speed | **''speed'' value: from 0 to 10 (0.5 is default) | ||
== Scripting == | == Scripting == | ||
Line 18: | Line 18: | ||
*Then this at end of the scripts: | *Then this at end of the scripts: | ||
< | <syntaxhighlight lang="python"> | ||
function rotate_fans() | function rotate_fans() | ||
{ | { | ||
Line 49: | Line 49: | ||
} | } | ||
} | } | ||
</ | </syntaxhighlight> | ||
== 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 | |||
[[File:wiki_light_fan.jpg]] |
Latest revision as of 01:45, 28 December 2023
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