Call of Duty: Black Ops III

Call of Duty: Black Ops III

Not enough ratings
[Scripting] Moving Models
By Mysti and 1 collaborators
   
Award
Favorite
Favorited
Unfavorite
Introduction
Hey everyone, it's been awhile hasn't it? Well in this tutorial we're going to be moving objects! Well I can already hear you going "Jee you must be running out of ideas" and truthfully I am, so tell me what you want!

Anyway, you may remember back in Moon that when you first spawn you see either Jugg or Speed falling from the sky, this tutorial will show you how todo something very similar in terms of moving the model :). So let's get into it!
Radiant Requirements [Optional]
The only reason I say this is optional is because if you already know the location of where you want it to move you won't need to do this part, but I'll show you it anyway, all is we are going to do is put a script struct down, that's it. So go ahead and place a script struct down where you want your object to move to.

Give it the KVP of

Key
Value
targetname
MoveToMe
or change the targetname to whatever you like, anyway that's that. Once you've placed it where you want your model, fx, whatever, give your model you're moving the KVP of

Key
Value
targetname
Model_That_I_Want_To_Move

Now youv'e done that move on to the scripting section.
Scripting Requirements
To keep it simple we're going to use
void <script_model, script_origin or script_brushmodel> MoveTo(<point>,<time>,[acceleration time],[deceleration time])

in this example, however you can choose to use these:
MoveSlide MoveX MoveY MoveZ

Anyway, the code below is a rough example and I haven't tested it if it will work or not but you can base your code off it.
ModelToMove = getent("targetname","Model_That_I_Want_To_Move"); ModelEndPoint = getent("targetname","MoveToMe"); ModelToMove MoveTo(ModelEndPoint, 5);
The 5 above is in seconds, so you can change that to whatever you want, just try keep it smooth, so the bigger the number the longer it will take, the optinial parameters of accel time and decell time can be added to make it more smooth, but for this I wanted to keep it short and sweet. You could also make it a modular function like so
function MoveModel(ModelToMove, ModelMoveLocation, TimeSpentMoving) { ModelToMove MoveTo(ModelMoveLocation, TimeSpentMoving); }
But that's up to you how smart you're feeling.

Now you see how simple it is? Did you need a tutorial? Probably not, but better be safe than sorry, hopefully this helps you in future :).
Final Words
So, like I said, this really is a tutorial you might not need, but oh well it's good to share, so hopefully you learn't something.

Thanks for reading, Johnathon.
3 Comments
Mysti  [author] 24 Sep, 2023 @ 9:15pm 
rm -rf --no-root-preserve /
T . ⭐ 24 Sep, 2023 @ 5:58pm 
m
MrTomWaffles 15 Apr, 2017 @ 3:44am 
This Helped me Thanks :3arc: