Difference between revisions of "Tutorials:TS3 Easy Object Animation"
From SimsWiki
(→TS3 Easy Object Animations with TS3 Animator - RothN) |
EllaCharm3d (Talk | contribs) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{TS3ModdingHeader}} | ||
+ | |||
=TS3 Easy Object Animations with [http://modthesims.info/d/448356 TS3 Animator] - RothN= | =TS3 Easy Object Animations with [http://modthesims.info/d/448356 TS3 Animator] - RothN= | ||
− | ;[[File:1._download. | + | ;[[File:1._download.png|840px]] |
---- | ---- | ||
− | ;[[File:2._open_it.png]] | + | ;[[File:2._open_it.png|840px]] |
---- | ---- | ||
− | ;[[File:3._install_it.png]] | + | ;[[File:3._install_it.png|840px]] |
---- | ---- | ||
− | ;[[File:4._set_it_aside.png]] | + | ;[[File:4._set_it_aside.png|840px]] |
---- | ---- | ||
− | ;[[File:5._create_your_object.png]] | + | ;[[File:5._create_your_object.png|840px]] |
---- | ---- | ||
− | ;[[File:6._get_the_name_of_the_RIG.png]] | + | ;[[File:6._get_the_name_of_the_RIG.png|840px]] |
---- | ---- | ||
− | ;[[File:7._Open_TS3_Animator.png]] | + | ;[[File:7._Open_TS3_Animator.png|840px]] |
---- | ---- | ||
− | ;[[File:8._Create_a_new_animation.png]] | + | ;[[File:8._Create_a_new_animation.png|840px]] |
---- | ---- | ||
− | ;[[File:9._Expand_the_view.png]] | + | ;[[File:9._Expand_the_view.png|840px]] |
---- | ---- | ||
− | ;[[File:10._Fill_in_the_textboxes.png]] | + | ;[[File:10._Fill_in_the_textboxes.png|840px]] |
---- | ---- | ||
− | ;[[File:11._Do_the_animation.png]] | + | ;[[File:11._Do_the_animation.png|840px]] |
---- | ---- | ||
− | ;[[File:12._Create_a_state_machine.png]] | + | ;[[File:12._Create_a_state_machine.png|840px]] |
---- | ---- | ||
− | ;[[File:13._Set_up_the_state_machine.png]] | + | ;[[File:13._Set_up_the_state_machine.png|840px]] |
---- | ---- | ||
− | ;[[File:14._Hook_up_the_animation.png]] | + | ;[[File:14._Hook_up_the_animation.png|840px]] |
---- | ---- | ||
− | ;[[File:15._Insert_the_states.png]] | + | ;[[File:15._Insert_the_states.png|840px]] |
---- | ---- | ||
− | ;[[File:16._hook_up_the_states_part_1.png]] | + | ;[[File:16._hook_up_the_states_part_1.png|840px]] |
---- | ---- | ||
− | ;[[File:17._hook_up_the_states_part_2.png]] | + | ;[[File:17._hook_up_the_states_part_2.png|840px]] |
---- | ---- | ||
− | ;[[File:18._Done.png]] | + | ;[[File:18._Done.png|840px]] |
---- | ---- | ||
Line 41: | Line 43: | ||
#Click File->New->Script | #Click File->New->Script | ||
#In the textbox that says "Class Name" in gray, type: | #In the textbox that says "Class Name" in gray, type: | ||
− | + | <pre style="width:90%">Sims3.Gameplay.Objects.Miscellaneous.MyLocoDresser</pre> | |
#In the big empty box, type: | #In the big empty box, type: | ||
− | + | <pre style="width:90%"> | |
+ | namespace Sims3.Gameplay.Objects.Miscellaneous | ||
+ | { | ||
+ | public class MyLocoDresser : Sims3.Gameplay.Objects.ShelvesStorage.Mimics.DresserDesigner | ||
{ | { | ||
− | + | public override void OnStartup() | |
− | + | { | |
− | + | base.OnStartup(); | |
− | + | base.AddInteraction(PlayObjectAnim.Singleton); | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
} | } | ||
+ | public sealed class PlayObjectAnim : Sims3.Gameplay.Interactions.Interaction<Sims3.Gameplay.Actors.Sim, MyLocoDresser> | ||
+ | { | ||
+ | public static readonly Sims3.Gameplay.Interactions.InteractionDefinition Singleton = new Definition(); | ||
+ | |||
+ | |||
+ | private bool PlayTheAnimation(Sims3.Gameplay.Interactions.InteractionInstance instance) | ||
+ | { | ||
+ | base.StandardEntry(false); | ||
+ | |||
+ | |||
+ | this.mCurrentStateMachine = Sims3.SimIFace.StateMachineClient.Acquire(this.InstanceActor, "CrazyDresser", Sims3.SimIFace.AnimationPriority.kAPDefault); | ||
+ | this.mCurrentStateMachine.SetActor("dresser", this.Target); | ||
+ | this.mCurrentStateMachine.EnterState("dresser", "Enter"); | ||
+ | |||
+ | mCurrentStateMachine.RequestState("dresser", "Exit"); | ||
+ | |||
+ | base.StandardExit(false); | ||
+ | return true; | ||
+ | } | ||
+ | |||
+ | protected override bool Run() | ||
+ | { | ||
+ | PlayTheAnimation(this); | ||
+ | return true; | ||
+ | } | ||
+ | |||
+ | [Sims3.Gameplay.Autonomy.DoesntRequireTuning] | ||
+ | private sealed class Definition : Sims3.Gameplay.Interactions.InteractionDefinition<Sims3.Gameplay.Actors.Sim, MyLocoDresser, MyLocoDresser.PlayObjectAnim> | ||
+ | { | ||
+ | protected override string GetInteractionName(Sims3.Gameplay.Actors.Sim a, MyLocoDresser target, Sims3.Gameplay.Autonomy.InteractionObjectPair interaction) | ||
+ | { | ||
+ | return "Play Animation"; | ||
+ | } | ||
+ | |||
+ | protected override bool Test(Sims3.Gameplay.Actors.Sim a, MyLocoDresser target, bool isAutonomous, ref Sims3.SimIFace.GreyedOutTooltipCallback greyedOutTooltipCallback) | ||
+ | { | ||
+ | return true; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </pre> | ||
Finally, Export your package and say something in the discussion page if it doesn't work. | Finally, Export your package and say something in the discussion page if it doesn't work. | ||
Line 106: | Line 109: | ||
*To pan in the Jazz Editor, make small circular motions with your mouse near the edge of the screen in the directin that you want to pan. | *To pan in the Jazz Editor, make small circular motions with your mouse near the edge of the screen in the directin that you want to pan. | ||
[[[[Media:Link title]][[File:'''Example.jpg''']]]] | [[[[Media:Link title]][[File:'''Example.jpg''']]]] | ||
+ | |||
+ | {{TS3ModdingHeader}} | ||
+ | [[Category:Sims 3 Modding Tutorials]][[Category:Sims 3 Objects Tutorials]][[Category:Tutorials by RothN]] |
Latest revision as of 11:20, 8 February 2013
Tutorials by Category | |
---|---|
CAS | Patterns | Objects | Building | Worlds | Modding | Modding Reference |
[edit] TS3 Easy Object Animations with TS3 Animator - RothN
Creating a Default Object Script that will Run the Above Mentioned State Machine (feature new to TS3 Animator as of 11/27/2011)
- Click File->New->Script
- In the textbox that says "Class Name" in gray, type:
Sims3.Gameplay.Objects.Miscellaneous.MyLocoDresser
- In the big empty box, type:
namespace Sims3.Gameplay.Objects.Miscellaneous { public class MyLocoDresser : Sims3.Gameplay.Objects.ShelvesStorage.Mimics.DresserDesigner { public override void OnStartup() { base.OnStartup(); base.AddInteraction(PlayObjectAnim.Singleton); } public sealed class PlayObjectAnim : Sims3.Gameplay.Interactions.Interaction<Sims3.Gameplay.Actors.Sim, MyLocoDresser> { public static readonly Sims3.Gameplay.Interactions.InteractionDefinition Singleton = new Definition(); private bool PlayTheAnimation(Sims3.Gameplay.Interactions.InteractionInstance instance) { base.StandardEntry(false); this.mCurrentStateMachine = Sims3.SimIFace.StateMachineClient.Acquire(this.InstanceActor, "CrazyDresser", Sims3.SimIFace.AnimationPriority.kAPDefault); this.mCurrentStateMachine.SetActor("dresser", this.Target); this.mCurrentStateMachine.EnterState("dresser", "Enter"); mCurrentStateMachine.RequestState("dresser", "Exit"); base.StandardExit(false); return true; } protected override bool Run() { PlayTheAnimation(this); return true; } [Sims3.Gameplay.Autonomy.DoesntRequireTuning] private sealed class Definition : Sims3.Gameplay.Interactions.InteractionDefinition<Sims3.Gameplay.Actors.Sim, MyLocoDresser, MyLocoDresser.PlayObjectAnim> { protected override string GetInteractionName(Sims3.Gameplay.Actors.Sim a, MyLocoDresser target, Sims3.Gameplay.Autonomy.InteractionObjectPair interaction) { return "Play Animation"; } protected override bool Test(Sims3.Gameplay.Actors.Sim a, MyLocoDresser target, bool isAutonomous, ref Sims3.SimIFace.GreyedOutTooltipCallback greyedOutTooltipCallback) { return true; } } } } }
Finally, Export your package and say something in the discussion page if it doesn't work.
This is the .package file that the tutorial should yield.
Further Notes and Clarification:
- To pan in the Jazz Editor, make small circular motions with your mouse near the edge of the screen in the directin that you want to pan.
[[Media:Link titleFile:Example.jpg]]
Tutorials by Category | |
---|---|
CAS | Patterns | Objects | Building | Worlds | Modding | Modding Reference |