UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Play an anim on a model

HOT
broken avatar :(
Created 11 years ago
by Soy-Yo
0 Members and 1 Guest are viewing this topic.
12,147 views
broken avatar :(
×
broken avatar :(
Location: esMadrid
Date Registered: 27 March 2015
Last active: 5 years ago
Posts
371
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
JIGGLYPUFF used SING! YOU fell asleep!
Signature
×
Soy-Yo's Groups
Soy-Yo's Contact & Social LinksSoy-yoElCerdoRey
I made the doors of my map with animated models and now I want to play the animation when I open them but I have no idea what function to use. I tried this functions but I don't know how to use them or if they are what I need.
Code Snippet
Plaintext
anim_single( guy, anime, tag, node, tag_entity );
anim_single_solo( guy, anime, tag, entity, tag_entity );
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 3 years ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
Signature
Do not take life too seriously. You will never get out of it alive.
×
DidUknowiPwn's Groups
UGX Team Member
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
ent SetAnim("anim");
This method might need you to assign an animtree.

Edit: You can just assign script_string "anim" and then script_animname "anim" as kvp's to the ent and it'll handle it for you.
Last Edit: September 29, 2015, 05:23:39 pm by DidUknowiPwn
broken avatar :(
×
broken avatar :(
Location: esMadrid
Date Registered: 27 March 2015
Last active: 5 years ago
Posts
371
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
JIGGLYPUFF used SING! YOU fell asleep!
×
Soy-Yo's Groups
Soy-Yo's Contact & Social LinksSoy-yoElCerdoRey
It isn't working. I think it's because I made a xanim instead of an animtree because the plugin let me port xanims.
Is it possible to make it with xanims? Or do I have to make it with an animtree?
Sorry for my ignorance. :-[
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
This is one method I use/would use:

Code Snippet
Plaintext
#include maps\_utility; 
#include common_scripts\utility;
#include maps\_zombiemode_utility;


init(){
    objects = getentarray("name", "targetname");//replace name with targetname kvp
    array_thread(objects,::PlayMyAnim);
}

#using_animtree( "nameofanimtree" );//replace nameofanimtree with the atr you have the anims in
PlayMyAnim(){
//for your doors, maybe set up trigger as target of model to animate
trig = getent(self.target,"targetname");//if one trig controls multiple doors, then getentarray and put the rest in another function and array thread it
while(1){
trig waittill("trigger",player);
//other door stuff here maybe checking for cost
self UseAnimTree(#animtree);
self SetAnim(%openanimname);//this method replace openanimname with your animname that opens the door
//if you are doing those doors, you would set the model of the open door here that you will play the close door on
wait( getanimlength( %openanimname ) );
self setmodel("opendoor");//change opendoor to open door model to play close anim on
self clearanim( %openanimname, 0 );//stops anim
while(player istouching(trig) || trig OtherPlayersTouching()) wait(.1); //make a function to make sure no other players are touching it either called OtherPlayersTouching or whatever
self SetAnim(%closeanimname);//this method replace closeanimname with your animname that closes the door
wait( getanimlength( %closeanimname ) );
self setmodel("closedoor");//change back to model that you use for a closed door
self clearanim( %closeanimname, 0 );//stops anim
}
}



I'm not sure how you plan to script everything how you are going to do your doors, maybe with a trigger multiple, but that is how I kind of scripted the example above. Also assuming they are looping anims


Edit: You'll have to compile your patch of course before building your mod if you made changes to your animtrees
Last Edit: September 30, 2015, 07:23:30 pm by MakeCents
broken avatar :(
×
broken avatar :(
Purple Square Worshipper
Location: us
Date Registered: 30 January 2014
Last active: 1 month ago
Posts
679
Respect
Forum Rank
Zombie Enslaver
Primary Group
Famous User
My Groups
More
My Contact & Social Links
More
Personal Quote
Purple Square Worshiper
Signature

donate to purplemanwomen www.paypal.me/bwc66930
×
Bwc66930's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Famous User
Famous User
Bwc66930's Contact & Social Linksbwc66931bwc66930bwc66930bwc66930bwc66930dkwithaw
It isn't working. I think it's because I made a xanim instead of an animtree because the plugin let me port xanims.
Is it possible to make it with xanims? Or do I have to make it with an animtree?
Sorry for my ignorance. :-[
For the animtree it is very simple, go to raw/animtree and I suggest using generic_human.atr
Edit generic_human.atr with notepad++ and add your animation name in it

If the animation is not in any animtree then it won't work
broken avatar :(
×
broken avatar :(
Location: esMadrid
Date Registered: 27 March 2015
Last active: 5 years ago
Posts
371
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
JIGGLYPUFF used SING! YOU fell asleep!
×
Soy-Yo's Groups
Soy-Yo's Contact & Social LinksSoy-yoElCerdoRey
I'm using MakeCents script and I think I've made the animtree properly, but when I'm loading the map the game crashes and throws this error:
Code Snippet
Plaintext
Loading fastfile 'aaa_patch'
used 1.25 MB memory in DB alloc
Database: Assets Sync Finished
Loading fastfile aaa
Loading fastfile 'aaa'
used 74.50 MB memory in DB alloc
Waited 1154 msec for asset 'maps/aaa.d3dbsp' of type 'col_map_mp'.
 - R_Cinematic_BeginLostDevice()...
DB_BeginRecoverLostDevice()...
R_ResetModelLighting()...
R_ReleaseAllModels()...
R_ReleaseLostImages()...
Material_ReleaseAll()...
R_ReleaseWorld()...
Recovering lost device...
R_ResetDevice()...
Initializing render targets...
Requested frame buffer to be 24-bit color with 8-b

Unhandled exception caught
Don't know what it means... I compiled the map, the patch and built the mod. ???
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
I don't know what that means either, without more info. Just out of curiosity, did you include the animtree in your csvs if you made a new one or did you add to an existing animtree like bwc said?


Code Snippet
Plaintext
rawfile,animtrees/animatreename.atr
Last Edit: September 29, 2015, 07:32:14 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: esMadrid
Date Registered: 27 March 2015
Last active: 5 years ago
Posts
371
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
JIGGLYPUFF used SING! YOU fell asleep!
×
Soy-Yo's Groups
Soy-Yo's Contact & Social LinksSoy-yoElCerdoRey
I don't know what that means either, without more info. Just out of curiosity, did you include the animtree in your csvs if you made a new one or did you add to an existing animtree like bwc said?


Code Snippet
Plaintext
rawfile,animtrees/animatreename.atr
I made my own atr (I didn't know where to add my anims in the generic human file).
And, of course, I didn't include it to my csv. :D I can't get used to those csv files.
Anyway, I've just included it and it isn't working neither.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
I made my own atr (I didn't know where to add my anims in the generic human file).
And, of course, I didn't include it to my csv. :D I can't get used to those csv files.
Anyway, I've just included it and it isn't working neither.

I think I've included all the necessary things, so it's prob just something simple yet, either prefab setup or you didn't make another function that checked if a player was touching the trig or something along those lines. If this is your first time doing something along these lines I woulds start by getting a test one do just loop without being triggered. Something like:


Code Snippet
Plaintext
#include maps\_utility; 
#include common_scripts\utility;
#include maps\_zombiemode_utility;


init(){
    objects = getentarray("name", "targetname");//replace name with targetname kvp
    array_thread(objects,::PlayMyAnim);
}

#using_animtree( "nameofanimtree" );//replace nameofanimtree with the atr you have the anims in
PlayMyAnim(){
//for your doors, maybe set up trigger as target of model to animate
trig = getent(self.target,"targetname");//if one trig controls multiple doors, then getentarray and put the rest in another function and array thread it
while(1){//may not need loop if anim is looping
self UseAnimTree(#animtree);
self SetAnim(%openanimname);//this method replace openanimname with your animname that opens the door
wait(2);//if no loop needed no wait needed
}
}




Once you get the anim in game and have it working on a script_model continue to the next step of setting up a trigger and making the trigger activate the anim, then set the model and so on.

If you just add it to the beginning of generic_human it should work also without including it. Paste the code you modified in here so I can make sure you changed all the placeholders I put in there and stuff. If you are getting errors, please add an image of that too from developer 1.
Last Edit: September 29, 2015, 08:02:39 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social LinksHarryBo000[email protected]HarryBo21
For the animtree it is very simple, go to raw/animtree and I suggest using generic_human.atr
Edit generic_human.atr with notepad++ and add your animation name in it

If the animation is not in any animtree then it won't work
or, if its just a anim on a model, not a player or ai

just a blank notepad doc, paste you anim in. Save

done lol

do we not need this though?

#usAnimTree( animtree )

at the top ( i forget the exact wording for it )

Code Snippet
Plaintext
#using_animtree( "anim tree name" );
Last Edit: September 29, 2015, 08:13:48 pm by Harry Bo21
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha

do we not need this though?

#usAnimTree( animtree )

at the top ( i forget the exact wording for it )

Code Snippet
Plaintext
#using_animtree( "anim tree name" );

You need:

Code Snippet
Plaintext
#using_animtree( "animtree name" );// change animtree name to the name of the atr

prior to the function that uses:

Code Snippet
Plaintext
self UseAnimTree(#animtree);

I use 4 animtrees in one gsc with this method that handles all my animations for script_models based on kvps. Slightly more complicated to get perfect but much easier once set up.
Last Edit: September 29, 2015, 08:19:55 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 6 years ago
Posts
6,875
Respect
Forum Rank
Immortal
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social LinksHarryBo000[email protected]HarryBo21
You need:

Code Snippet
Plaintext
#using_animtree( "animtree name" );// change animtree name to the name of the atr

prior to the function that uses:

Code Snippet
Plaintext
self UseAnimTree(#animtree);

I use 4 animtrees in one gsc with this method that handles all my animations for script_models based on kvps. Slightly more complicated to get perfect but much easier once set up.
I never worked out how to get more than one working, so ended up using multiple gscs lol

always been curious as doing that twice, always gives me a error that i cant define two? lol im still new to anim stuff tbf
broken avatar :(
×
broken avatar :(
Location: esMadrid
Date Registered: 27 March 2015
Last active: 5 years ago
Posts
371
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
JIGGLYPUFF used SING! YOU fell asleep!
×
Soy-Yo's Groups
Soy-Yo's Contact & Social LinksSoy-yoElCerdoRey
I haven't done anything special but the game doesn't crash now. :o
I'm not getting errors but the anim doesn't seem to work. :-\
I have a file called cube_doors.atr with this in it:
Code Snippet
Plaintext
cube_doors_open
cube_doors_close
These are the two xanims I have.
I added this file to the mod.csv and this is the function in the gsc file (this is just a testing map so the function is a bit changed):
Code Snippet
Plaintext
#using_animtree( "cube_doors" );//replace nameofanimtree with the atr you have the anims in
waitDoor(open,close){ // self is the door model and open/close are the triggers
//for your doors, maybe set up trigger as target of model to animate
//trig = getent(self.target,"targetname");//if one trig controls multiple doors, then getentarray and put the rest in another function and array thread it
while(1){
open waittill("trigger",player);
//other door stuff here maybe checking for cost
self UseAnimTree(#animtree);
self SetAnim(%cube_doors_open);//this method replace openanimname with your animname that opens the door
//if you are doing those doors, you would set the model of the open door here that you will play the close door on
self setmodel("cube_doors_opened");//change opendoor to open door model to play close anim on
self clearanim( %cube_doors_open, 0 );//stops anim
close waittill("trigger",player);
//while(player istouching(trig) || trig OtherPlayersTouching()) wait(.1); //make a function to make sure no other players are touching it either called OtherPlayersTouching or whatever
self SetAnim(%cube_doors_close);//this method replace closeanimname with your animname that closes the door
self setmodel("cube_doors");//change back to model that you use for a closed door
self clearanim( %cube_doors_close, 0 );//stops anim
}
}
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 2 years ago
Posts
1,186
Respect
1,332Add +1
Forum Rank
Zombie Colossus
Primary Group
Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
Signature
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntStuffyBluntstuffy@BluntZombieStuffyZombie
You need a wait in between setting and clearing the anim, that should help.

Code Snippet
Plaintext
self SetAnim(%cube_doors_open);

// Add a wait here

self setmodel("cube_doors_opened");
self clearanim( %cube_doors_open, 0 );


Code Snippet
Plaintext
wait( getanimlength( %cube_doors_open ) );
Last Edit: September 29, 2015, 09:11:36 pm by Harry Bo21
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Interesting. It all seems to be fine. I assume open and close are defined? I would add a wait(length of anim to open) in between setanims and after the second setanim to make sure it isn't just running faster than you can see.

Edit: Pretty much what blunt said.

Edit: Also the two trigger thing is bothersome, I would go with one, and also do a check for while touching for you wait in the end, like my first example. Just so the door doesn't close on the players.
Last Edit: September 29, 2015, 09:15:57 pm by MakeCents

 
Loading ...