Aiden9 Posted April 2, 2020 Share Posted April 2, 2020 I have made a frame attack, who first work perfectly :   Now we want to make the animation of attack with 4 frame,  if anyone have an idea i will take.  The objective is the attack use frame 4 > 5 > 6 > 7  this is the code in Intersect.Client -> Entities -> Entity.cs   line 879.  Maybe with While/For loop but it doesnt work. Link to comment Share on other sites More sharing options...
0 Aiden9 Posted April 2, 2020 Author Share Posted April 2, 2020 UP ! Anyone has an idea ?  When i say i want to make animation with this 4 frame i speak of this :    Link to comment Share on other sites More sharing options...
0 jcsnider Posted April 2, 2020 Share Posted April 2, 2020 Please don't bump topics in this board unless they are a week old...  CalculateAttackTime() returns a value.. say.. 200ms  Which means you have 200ms to show all 4 frames.  You gotta add your own logic to figure out how long you've been attacking and then show the correct frame for it. Link to comment Share on other sites More sharing options...
0 Aiden9 Posted April 2, 2020 Author Share Posted April 2, 2020 Sorry for the update.. Â It work fine but in the server side i cant see where the animation is generated, can you help me or just direct me to the line approximatively ? Â Thank Link to comment Share on other sites More sharing options...
0 gooby Posted April 4, 2020 Share Posted April 4, 2020 i managed to animate the attack frames, assuming youre also using an 8x4 spritesheet. mine just looks twitchy bc the base attack speed is super high. it looks better with a slower weapon, and can be changed easily to fit your desired speed  i think you can just copy paste the code into the DrawEquipment() section just below to animate equipment paperdolls to match your char sprite  i also made the walk anim work with 8x4  but i wasnt able to make it use the latter half of it where the attack animations are, the anim just comes up blank  im not sure where you can edit that but i will look into it tomorrow if nobody else can tell us. here is what I got for now! hope it helps  GIF  code: Spoiler           var attackTime = CalculateAttackTime();           if (AttackTimer - CalculateAttackTime() / 2 > Globals.System.GetTimeMs() || Blocking)           {             if (Globals.System.GetTimeMs() > FrameTimer)             {               if (AttackFrame > 2)               {                 AttackFrame = 0;               }               else               {                 AttackFrame += 1;               }               FrameTimer = Globals.System.GetTimeMs() + (attackTime / 8);             }             srcRectangle = new FloatRect(               AttackFrame * (int)Texture.GetWidth() / 8 + (int)Texture.GetWidth() / 2, d * (int)Texture.GetHeight() / 4,               (int)Texture.GetWidth() / 8, (int)Texture.GetHeight() / 4             );           }           else           {             srcRectangle = new FloatRect(               WalkFrame * (int)Texture.GetWidth() / 8, d * (int)Texture.GetHeight() / 4,               (int)Texture.GetWidth() / 8, (int)Texture.GetHeight() / 4             );           }         }  edit: apparently when you change the sprite of a class, it does not change an existing character sprite of that class lol.  edit2: fixed it up a bit, but now my NPCs are a bit offset... still working on it. also sorry for my ugly code, i am brand new to C#. there is probably a better way to do this as well with much more effort, like being able to set the spritesheet cell size in editor or something Link to comment Share on other sites More sharing options...
0 Shenmue Posted April 5, 2020 Share Posted April 5, 2020 I've done a patch for the attack frame : Download It should be on the source modification section of the forum if everything is fine. Beefy Kasplant 1 Link to comment Share on other sites More sharing options...
0 Blestro Posted April 5, 2020 Share Posted April 5, 2020 56 minutes ago, Shenmue said: I've done a patch for the attack frame : Download It should be on the source modification section of the forum if everything is fine. Actually works... ill go to test it, looking for any issue Link to comment Share on other sites More sharing options...
0 Blestro Posted April 5, 2020 Share Posted April 5, 2020 Well, the mod works, but  when you equip a weapon with a speedattack modifier this happen:   The frame loop plays the ms of speedattack modifier duration. Link to comment Share on other sites More sharing options...
0 jcsnider Posted April 5, 2020 Share Posted April 5, 2020 2 hours ago, Blestro said: Well, the mod works, but  when you equip a weapon with a speedattack modifier this happen:   The frame loop plays the ms of speedattack modifier duration. Correct. How else would this be handled? I think it's on the game dev to make sure attacks are at a reasonable rate. Link to comment Share on other sites More sharing options...
Question
Aiden9
I have made a frame attack, who first work perfectly :Â
Â
Â
Now we want to make the animation of attack with 4 frame,
Â
if anyone have an idea i will take.
Â
The objective is the attack use frame 4 > 5 > 6 > 7Â
Â
this is the code in Intersect.Client -> Entities -> Entity.cs
Â
Â
line 879.
Â
Maybe with While/For loop but it doesnt work.
Link to comment
Share on other sites
8 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now