Broojo02 Posted April 12, 2011 Author Share Posted April 12, 2011 Note: Animations don't show perfectly in Eclipse Origins, they tend to miss out the first frame or so.==Client Side==Open up frmEditor_Map and at the bottom of the attributes add an option button, name it optAnimation. Double click on it and add the following code to the new sub:``` ClearAttributeDialogue picAttributes.Visible = True fraAnimation.Visible = True scrlAnimation.Max = MAX_ANIMATIONS scrlAnimation.Min = 1 scrlAnimation.Value = 1 lblAnimation.Caption = "Animation: "```On the right of the attributes you will see a bunch of frames for setting things like map items and NPCs. Add a new frame and name it fraAnimation, set its caption to Animation and its visibility to false. Inside this frame add a label, name it lblAnimation. Below that label add a Horizontal Scroll Bar, name it scrlAnimation, double click it and add in:```lblAnimation.Caption = "Animation: " & Trim$(Animation(scrlAnimation.Value).Name)```Finally add a command button below the scroll bar and name it cmdAnimation, set the caption to "Okay". Double click it and add in this code:``` AnimationNumber = scrlAnimation.Value picAttributes.Visible = False fraAnimation.Visible = False```Now, in modConstants, under "Public Const TILE_TYPE_SLIDE As Byte = 14" add:```Public Const TILE_TYPE_ANIMATION As Byte = 15```In modGlobals, under "Public EditorShop As Long" add:```Public AnimationNumber As Long```In modGameEditors, search for:``` ' slide If frmEditor_Map.optSlide.Value Then .Type = TILE_TYPE_SLIDE .Data1 = MapEditorSlideDir .Data2 = 0 .Data3 = 0 End If```Underneath this block of code add another block for the animation:``` ' animation If frmEditor_Map.optAnimation.Value Then .Type = TILE_TYPE_ANIMATION .Data1 = AnimationNumber .Data2 = 0 .Data3 = 0 End If```In modText, search for "DrawText TexthDC, tX, tY, "S", QBColor(BrightCyan)", under this add:```Case TILE_TYPE_ANIMATION DrawText TexthDC, tX, tY, "A", QBColor(Brown)```==Server Side==In modConstants search for "Public Const TILE_TYPE_SLIDE As Byte = 14", under that add:```Public Const TILE_TYPE_ANIMATION As Byte = 15```Finally, in modServerLoop you need to do two things.1\. In "Sub ServerLoop()" add the following declarations to the top of the sub:```Dim mapNum, x1, y1, Anim, playerNumber As Long```2\. In the same sub, search for:``` ' Checks to update player vitals every 5 seconds - Can be tweaked If Tick > LastUpdatePlayerVitals Then UpdatePlayerVitals LastUpdatePlayerVitals = GetTickCount + 5000 End If```Underneath this code block add:```' Anim every 1 sec If Tick > Anim Then Anim = GetTickCount + 1000 For mapNum = 1 To MAX_MAPS For x1 = 0 To Map(mapNum).MaxX For y1 = 0 To Map(mapNum).MaxY If Map(mapNum).Tile(x1, y1).Type = TILE_TYPE_ANIMATION Then For playerNumber = 1 To Player_HighIndex If IsPlaying(playerNumber) Then If GetPlayerMap(playerNumber) = mapNum Then SendAnimation mapNum, Map(mapNum).Tile(x1, y1).Data1, x1, y1 End If End If Next End If Next Next Next End If```==How it works==When you click the Animation attribute in the map editor you get to choose which animation to set, after clicking the okay button you can click on the map to set an animation there. This animation, along with any other animations on any other map will be drawn every 1 second, this can be changed to any value by changing the "+ 1000" to any other value.I get the feeling I have missed something out, tell me if there are any problems. Link to comment Share on other sites More sharing options...
Death Knight Posted April 12, 2011 Share Posted April 12, 2011 Hm, you should try and fix that glitch you where talking about. On the up side, its a nice tutorial. It could use a picture of what the final result will be. Link to comment Share on other sites More sharing options...
Broojo02 Posted April 12, 2011 Author Share Posted April 12, 2011 Yeah I will look into it, I posted it in the Bugs topic as well. Link to comment Share on other sites More sharing options...
erkro1 Posted April 12, 2011 Share Posted April 12, 2011 Wow, I've waited a long time for this, but, like Beast already said, you really need to fix that bug..And in my opinion its better to make map layer(s), because now you can't do Block on Animation, and people would sometimes need that ;) Link to comment Share on other sites More sharing options...
Broojo02 Posted April 12, 2011 Author Share Posted April 12, 2011 Yeah, hopefully Robin can fix it :D, as for blocks that is a bit of a bummer BUT we have the lovely directional blocking system which Robin gave us which can be used on any tile :) Link to comment Share on other sites More sharing options...
Death Knight Posted April 12, 2011 Share Posted April 12, 2011 Yea like for fire or water, you can't have an fire animation but you can walk over it. Link to comment Share on other sites More sharing options...
Broojo02 Posted April 12, 2011 Author Share Posted April 12, 2011 Another good thing about this is that you can still have multi layered animations, as animations have a layer for below and above the player. So you could have running water for underneath the player and water dripping down over the player. You can also have sounds, although it would be a bit annoying playing the same sound over and over again. Link to comment Share on other sites More sharing options...
damian666 Posted April 12, 2011 Share Posted April 12, 2011 i did the same thing…look carefully, this is a very bad way of doing it im afraid :/your bombarding the client with packets for animation ever frikking second...and thats just the start of things that are wrong.sorry, dont mean to be a asshole, just telling the truthDami Link to comment Share on other sites More sharing options...
erkro1 Posted April 12, 2011 Share Posted April 12, 2011 @Broojo, I've a nice idea how you (possible) can fix this :@Erkro1:> In my opinion its better to make map layer(s), because now you can't do Block on Animation, and people would sometimes need that ;)Make in the Animation window a checkbox called 'Blocked', and if its checked make it block the player ;) Link to comment Share on other sites More sharing options...
Broojo02 Posted April 12, 2011 Author Share Posted April 12, 2011 @Damian666:> i did the same thing…> > look carefully, this is a very bad way of doing it im afraid :/> > your bombarding the client with packets for animation ever frikking second...> > and thats just the start of things that are wrong.> > sorry, dont mean to be a asshole, just telling the truth> > DamiThats fair enough, I was worried about this myself, how much of a performance hit do you think this would give? Link to comment Share on other sites More sharing options...
Broojo02 Posted April 12, 2011 Author Share Posted April 12, 2011 @Erkro1:> @Broojo, I've a nice idea how you (possible) can fix this :> Make in the Animation window a checkbox called 'Blocked', and if its checked make it block the player ;)Yeah, but you can just use the directional blocking that comes with the engine. Link to comment Share on other sites More sharing options...
damian666 Posted April 12, 2011 Share Posted April 12, 2011 sending packets like hell like that? depends on how much players, 1 player you wont notice jack,up that too 10 and more and i think it will be very noticeable.no, best way of doing this, imho, is indeed saving it as a tile atribute, but handle the animation client side.so only if a tile is set to tiletype animation, blt the animation.how? i have no clue, welcome to my world, this is where i am currently at xdDami Link to comment Share on other sites More sharing options...
Broojo02 Posted April 12, 2011 Author Share Posted April 12, 2011 XD Yeah, I looked around the client but couldn't find an easy way to blt an animation, its annoying because it would be best to have it client side and completely remove the need for packets as all the data would be stored locally in the map and animation files.After I found the SendAnimation sub thing I just got a little excited :P Link to comment Share on other sites More sharing options...
damian666 Posted April 12, 2011 Share Posted April 12, 2011 yeah, same here xdDami Link to comment Share on other sites More sharing options...
Sunku Posted April 12, 2011 Share Posted April 12, 2011 Every time i try to compile server.exe it says something is wrong with anim![](http://www.freemmorpgmaker.com/files/imagehost/pics/eae651de9d4f8a2398a4fc8a8e16b05d.bmp) Link to comment Share on other sites More sharing options...
Broojo02 Posted April 12, 2011 Author Share Posted April 12, 2011 Thanks, thought I had forgot something, after the Dim mapNum, x1, y1 add "Anim" so that it says:```Dim mapNum, x1, y1, Anim As Long```For some reason I declared it on another line in my source so I didn't see it :embarrassed: Link to comment Share on other sites More sharing options...
WatTheWaffles... Posted April 13, 2011 Share Posted April 13, 2011 um when you check animation fra animation doesn't show up so i edited the code alittle>! ClearAttributeDialogue picAttributes.Visible = True fraAnimation.Visible = True scrlAnimation.Max = MAX_ANIMATIONS scrlAnimation.Min = 1 scrlAnimation.Value = 1 lblAnimation.Caption = "Animation: " Link to comment Share on other sites More sharing options...
peekay Posted April 13, 2011 Share Posted April 13, 2011 Ill have a crack at makin a client side map animation attribute when my guild system gives me another headache Link to comment Share on other sites More sharing options...
damian666 Posted April 13, 2011 Share Posted April 13, 2011 cool, i am still lost, i really suck at directx stuff >.<im proberly getting to old for this shit xdDami Link to comment Share on other sites More sharing options...
peekay Posted April 13, 2011 Share Posted April 13, 2011 the drawing of the animations is done client side i believe so it shouldn't be hard to make an attribute to draw the animation Link to comment Share on other sites More sharing options...
damian666 Posted April 13, 2011 Share Posted April 13, 2011 yes it is indeed, i am just very bad with it xdi do know, or think i know where to do it, in the drawtile sub, there it loops tru tiles, so my guess is thats where it should be defined, thats as far as i could get :PDami Link to comment Share on other sites More sharing options...
Broojo02 Posted April 13, 2011 Author Share Posted April 13, 2011 @Wat!The!Waffles...:> um when you check animation fra animation doesn't show up so i edited the code alittle> > >! ClearAttributeDialogue> picAttributes.Visible = True> fraAnimation.Visible = True> scrlAnimation.Max = MAX_ANIMATIONS> scrlAnimation.Min = 1> scrlAnimation.Value = 1> lblAnimation.Caption = "Animation: "Thanks very much, added it in. I must have set its value to visible and never tried any other attributes :P Link to comment Share on other sites More sharing options...
WatTheWaffles... Posted April 13, 2011 Share Posted April 13, 2011 Hey broojo can you get me a water animation??? Link to comment Share on other sites More sharing options...
peekay Posted April 13, 2011 Share Posted April 13, 2011 @dami sub bltanimation in mod.dd7 Link to comment Share on other sites More sharing options...
McCull96 Posted April 15, 2011 Share Posted April 15, 2011 I'm not sure but you could look at how animated items are handled0 for reference to get the animations without it lagging Link to comment Share on other sites More sharing options...
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