Modme Forums

Can someone write a script for me that will rotate 4 models?

Game Modding | Call of Duty: Black Ops 3 | Scripting


MyNameIsNobody:

I want these four saw blades to be rotating/spinning but scripting is outside of my grasp atm. Can anyone write me a simple script and explain how to implement it? Thank you I would really appreciate it.


RaGe-74:

If you use this script, remember to thank Wakka for the video Tutorial at: or on the UGX or MappersUnited forums.

Copy the file mp_x23_ele.gsc into your \usermaps\mp_mapname\scripts\ folder (attached to this post).

Place a model in your map. It can be absolutely anything.
For this example, using Wakka’s video as reference, I am using a ceiling fan.


Lay out the screen however you want, but for this tut, I’ve opened entity browser (B) and entity info (N) with Camera view in the middle.

Hilight the model you want to spin. Since I only want the bottom of the ceiling fan to spin, I only select the blades model.

Note how in Entity info, the model is a “misc_model”
In entity browser, open script > and hilight “model”.
Drag and drop it into your 3d Window onto the model you have hilighted.
You will have noticed the the “misc_model” has changed to “script_model”.



In the Entity Info screen, change:
targetname ele

Click “Add KVP” in the bottom right corner.
Property / Key Value
script_noteworthy z

Editing your GSC file:
Edit your mapname.gsc file and insert the red lines in their correct places:

#using scripts\codescripts\struct;
#using scripts\shared\util_shared;
#using scripts\mp\_load;
#using scripts\mp\_util;
#using scripts\mp\mp_example_fx;
#using scripts\mp\mp_example_sound;
#using scripts\shared\compass;
#using scripts\mp\mp_x23_ele;
#insert scripts\shared\shared.gsh;



//*****************************************************************************
// MAIN
//*****************************************************************************

function main()
{
mp_x23_ele::main();
load::main();

compass::setupMiniMap( "compass_map_mp_vacant" );

SetDvar( "compassmaxrange", "2100" ); // Set up the default range of the compass
Editing your ZONE file:
Insert the following line into your mapname.zone file
scriptparsetree,scripts/mp/mp_x23_ele.gsc

That’s it. Compile your map, and maybe you’ll have a spinning fan, man, car..or whatever. :)


RaGe-74:

*note* You can have a prefab with the 4 models on it and spin that.


MyNameIsNobody:

Thanks a lot! I'm surprised I didn't find this tutorial video as I looked all over youtube and google and wasn't having any success! I did eventually find a tutorial by IceGrenade but couldn't get it working right!


Harry Bo21:

*note* You can have a prefab with the 4 models on it and spin that.

no - you cant, as prefabs just become part of a map when it gets compiled...


MyNameIsNobody:

no - you cant, as prefabs just become part of a map when it gets compiled...


Thanks for clarifying Harry!