t7500 Posted January 29, 2012 Author Share Posted January 29, 2012 HII've created a new system for tiles animation for my project. Also the same way created a 4 seasons. Brutal way, but simpleReserve 4 tilesets to make animation frames (in that case 11.bmp - 14.bmp) 4 different state of water**ALL IN CLIENT SIDE**create new timer and name it "Tileanimate"set interval to 500```Private Sub Tileanimate_Timer()tanim = tanim + 1If tanim = 4 Then tanim = 0End Sub```**In ModGlobals add:**```Public tanim As Integer```**In modDirectDraw7**in BltMapTile**add**```Dim ani As Integer```**before:**```Call Engine_BltFast(ConvertMapX(x * PIC_X), ConvertMapY(y * PIC_Y), DDS_Tileset(.Layer(i).tileset), rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)```**add**```'------------------------ANIMACJA WODY---------------- For ani = 0 To 4 Select Case tanim Case 1 If Map.Tile(x, y).Layer(ani).tileset = 11 Then Map.Tile(x, y).Layer(ani).tileset = 12 Case 2 If Map.Tile(x, y).Layer(ani).tileset = 12 Then Map.Tile(x, y).Layer(ani).tileset = 13 Case 3 If Map.Tile(x, y).Layer(ani).tileset = 13 Then Map.Tile(x, y).Layer(ani).tileset = 14 Case 0 If Map.Tile(x, y).Layer(ani).tileset = 14 Then Map.Tile(x, y).Layer(ani).tileset = 11 End Select Next '------------------------------------------------------```That should workKnown bugs:when new map loaded, first 4 frames of animated tiles can blit with black colour, maybe the preload of tilesets may help. Link to comment Share on other sites More sharing options...
Growlith1223 Posted January 30, 2012 Share Posted January 30, 2012 um….I don't understand your system...Does the tiles have to be in the same slot???Like if you select the first tile in the 11th tileset, does the other tiles have to be on the same slot but on the other tilesets??Your system is so confusing! >.< Link to comment Share on other sites More sharing options...
Kemerd Posted January 30, 2012 Share Posted January 30, 2012 What exactly, does this do? Link to comment Share on other sites More sharing options...
kibbelz Posted January 30, 2012 Share Posted January 30, 2012 It is a basic animation system it seems with 4 frames, (tilesets 11 - 14) It is a very basic system, however, it would be much simpler to make mask animations, fringe animations etc. Link to comment Share on other sites More sharing options...
Rew Posted January 30, 2012 Share Posted January 30, 2012 ```Use code -_-'``` Link to comment Share on other sites More sharing options...
t7500 Posted January 31, 2012 Author Share Posted January 31, 2012 It is basic but fast and almost no CPU usage, but little more RAMLike Growlith1223 wrote@Growlith1223:> tiles have to be in the same slot…> Like if you select the first tile in the 11th tileset, does the other tiles have to be on the same slot but on the other tilesets...Here is example of my animation tilesets 11-14 - in each different water phase![](http://img3.imageshack.us/img3/9919/67809688.png) ![](http://img338.imageshack.us/img338/8165/64629884.png) ![](http://img4.imageshack.us/img4/4702/67504099.png) ![](http://img689.imageshack.us/img689/7384/64784624.png) Link to comment Share on other sites More sharing options...
Justn Posted January 31, 2012 Share Posted January 31, 2012 I thought using timers was a no no? Link to comment Share on other sites More sharing options...
haileelipse Posted February 14, 2012 Share Posted February 14, 2012 ~~This doesn't work.~~My bad had other things interfering with it, worked on fresh eo2 Link to comment Share on other sites More sharing options...
haileelipse Posted February 16, 2012 Share Posted February 16, 2012 anyone managed to fix the black tiles appearing…. EDIT:ok so i have found a fix but i dont know if it would cause problems someone more experienced would have to tell me off but seams to be working...In HandleCheckForMapIn the section``` ' Either the revisions didn't match or we dont have the map, so we need it Set Buffer = New clsBuffer Buffer.WriteLong CNeedMap Buffer.WriteLong NeedMap SendData Buffer.ToArray() Set Buffer = Nothing```i added Buffer.WriteLong 1so it now reads``` ' Either the revisions didn't match or we dont have the map, so we need it Set Buffer = New clsBuffer Buffer.WriteLong CNeedMap Buffer.WriteLong 1 Buffer.WriteLong NeedMap SendData Buffer.ToArray() Set Buffer = Nothing```Anyone know if this will cause any issues? because it seams to have fixed the black tiles.oh and I didnt like adding a timer so i have my tmr100 doing this``` ' Update inv animation If NumItems > 0 Then If tmr100 < Tick Then tanim = tanim + 1 If tanim = 4 Then tanim = 0 BltAnimatedInvItems tmr100 = Tick + 100 End If End If```instead of just``` ' Update inv animation If NumItems > 0 Then If tmr100 < Tick Then BltAnimatedInvItems tmr100 = Tick + 100 End If End If```If someone could try this out / knows if it'll cause issues im sure im not the only one who'd love to know. ;)edit: after further testing only works for room 1… Link to comment Share on other sites More sharing options...
t7500 Posted February 17, 2012 Author Share Posted February 17, 2012 If you use tmr100 timer it can skip some animation, even stop (when too much details on the map makes lag)tanim can get value more than 4 and continuosly rising. It is more safe to make in tmr100 variable from:If tanim = 4 Then tanim = 0toIf tanim >= 4 Then tanim = 0–---------------------------------For blitting black tiles:Buffer.WriteLong 1 didn't changed too much - I've attached 9 map in 1 (my developing system) as big continuosly world so in this case it's not working.Technically i've make copy one of animated tile in regular tileset. - As ground painted static water and as mask1 used animated tile - this sort of masking bug is temporary fix but helpful. Link to comment Share on other sites More sharing options...
Wortel Angels Posted March 11, 2012 Share Posted March 11, 2012 > create new timer and name it "Tileanimate"> set interval to 500But where ? Link to comment Share on other sites More sharing options...
Ruins of Hell Posted March 11, 2012 Share Posted March 11, 2012 @Mortal:> But where ?frmMain. Link to comment Share on other sites More sharing options...
Displaced Posted March 11, 2012 Share Posted March 11, 2012 @Mortal:> But where ?Don't do it… look at the two posts above you.. The Client already loops on idle.. put your timer there in form of a clock counter.. it's much better than an extra timer.@t7500 if you're still around here: please update your first post... Link to comment Share on other sites More sharing options...
Wortel Angels Posted March 12, 2012 Share Posted March 12, 2012 So I must not create a timer? And use the Fix at post 8?Or How ?German PM is allowed ;) Link to comment Share on other sites More sharing options...
Displaced Posted March 12, 2012 Share Posted March 12, 2012 Exactly.There's no need to pm you. Maybe other people have the same problem ;)Just use the Fix from post #8\. It will be fine. Link to comment Share on other sites More sharing options...
Wortel Angels Posted March 12, 2012 Share Posted March 12, 2012 Thanks..But i see now, then i can only have 1 Animation or not ?Because there is that :```'------------------------ANIMACJA WODY---------------- For ani = 0 To 4 Select Case tanim Case 1 If Map.Tile(x, y).Layer(ani).tileset = 11 Then Map.Tile(x, y).Layer(ani).tileset = 12 Case 2 If Map.Tile(x, y).Layer(ani).tileset = 12 Then Map.Tile(x, y).Layer(ani).tileset = 13 Case 3 If Map.Tile(x, y).Layer(ani).tileset = 13 Then Map.Tile(x, y).Layer(ani).tileset = 14 Case 0 If Map.Tile(x, y).Layer(ani).tileset = 14 Then Map.Tile(x, y).Layer(ani).tileset = 11 End Select Next '------------------------------------------------------``` Link to comment Share on other sites More sharing options...
Displaced Posted March 12, 2012 Share Posted March 12, 2012 No.. you can animate every tile with that but only from tileset 11 to 14.. what a … well.. not a good option..you should add some layers and show and hide them ... or better use something different..Well it's your choice. This system should work, but you have to animate over 4 tilesets.. (11-14). Link to comment Share on other sites More sharing options...
Wortel Angels Posted March 12, 2012 Share Posted March 12, 2012 Which Animation system is then the best ? Link to comment Share on other sites More sharing options...
Displaced Posted March 12, 2012 Share Posted March 12, 2012 you just have to make an option to place the animation of the animation system on the map.. done. 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