Thread: Animation Loading. [better [I think]]

Results 1 to 9 of 9
  1. #1 Animation Loading. [better [I think]] 
    Member Animation Loading. [better [I think]] Market Banned

    Robin Spud's Avatar
    Join Date
    Aug 2008
    Age
    31
    Posts
    2,338
    Thanks given
    46
    Thanks received
    73
    Rep Power
    1068
    well, everybody's loading the same stuff like 20 times. so why not just do this?

    Code:
    		static int[][] frames = {
    				{4982, 1311, 0,11,22,33,44,55,66,77,88,1,2,3,4,5,6,7,8,9,10,12,13,14,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,31,32,34,35,36,37,38,39,40,41,42,43,45,46,47,48,49,50,51,52,53,54,56,57,58,59,60,61,62,63,64,65,67,68,69,70,71,72,73,74,73,74,73,74,73,74,73,74,75,76,78,79,80,81,82,83,84,85,86,87,89,0},
    				{4981, 1290, 1471,1482,1493,1504,1515,1526,1537,1548,1559,1472,1473,1474,1475,1476,1477,1478,1479,1480,1481,1483,1484,1485,1486,1487,1488,1489,1490,1491,1492,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,1516,1517,1518,1519,1520,1521,1522,1523,1524,1525,1527,1528,1529,1530,1531,1532,1533,1534,1535,1536,1538,1539,1540,1541,1542,1543,1544,1545,1544,1545,1544,1545,1544,1545,1544,1545,1546,1547,1549,1550,1551,1552,1553,1554,1555,1556,1557,1558,1560,1561,1562,1563,1562,1563,1562,1563,1564,1565,1566,1567,1568,0}
    		};
    		static int[][] delays = {
    				{4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,10,4,4,4,10,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,10,4,4,4,10,4,4,4,4,4,19,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0},
    				{4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,10,4,4,4,10,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,10,4,4,4,10,4,4,4,4,4,19,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0}
    		};
    
    				for(int i = 0; i < frames.length; i++)
    				{
    					if(j == frames[i][0])
    					{
    						
    						if(FrameStart[frames[i][1]] < 1)
    							Class36.methodCustomAnimations(false, frames[i][1]);
    						
    						setDataSize(j, frames[i].length-3);
    						
    						for(int i2 = 0; i2 < frames[i].length-3; i2++)
    							setData(j, i2, i, frames[i][1]);
    					}
    				}
    
    EDIT:
    
        public static void setDataSize(int j, int i){
    		anims[j].anInt352 = i;
    		anims[j].anIntArray353 = new int[i];
    		anims[j].anIntArray354 = new int[i];
    		anims[j].anIntArray355 = new int[i];
        }
        
        public static void setData(int j, int i2, int i, int file){
    		anims[j].anIntArray353[i2] = frames[i][i2+2]+FrameStart[file];
    		anims[j].anIntArray354[i2] = -1;
    		anims[j].anIntArray355[i2] = delays[i][i2];
        }
    the first 2 id's in frames are the emote id and the file id for that emote.


    this is A LOT smaller than what everybody else is doing...
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Nov 2008
    Posts
    2,180
    Thanks given
    148
    Thanks received
    99
    Rep Power
    2004
    Or load it from cache .
    But it's okay, but people will still use the same format, as they don't have to do anything.
    Reply With Quote  
     

  3. #3  
    Registered Member Ryan Rebelle's Avatar
    Join Date
    Nov 2009
    Age
    29
    Posts
    1,149
    Thanks given
    108
    Thanks received
    57
    Rep Power
    41
    It'd be too much work to put all of their existing animations into this format :/ since everything is dumped the same way


    Attached image
    Reply With Quote  
     

  4. #4  
    #extreme

    +Deus Ex's Avatar
    Join Date
    Nov 2009
    Posts
    2,964
    Thanks given
    236
    Thanks received
    214
    Rep Power
    411
    ^ yeah wat he said
    Best regards,
    +Deus Ex
    Reply With Quote  
     

  5. #5  
    Registered Member
    Chiief's Avatar
    Join Date
    Jun 2010
    Posts
    1,544
    Thanks given
    69
    Thanks received
    238
    Rep Power
    611
    Wait so give me an example of what an animation would look like then.
    Reply With Quote  
     

  6. #6  
    derp
    Guest
    Quote Originally Posted by Ryan Rebelle View Post
    It'd be too much work to put all of their existing animations into this format :/ since everything is dumped the same way
    so write up a quick parser to reformat it? takes about 2 minutes.
    Reply With Quote  
     

  7. #7  
    Client God

    Join Date
    Aug 2009
    Posts
    3,127
    Thanks given
    3
    Thanks received
    617
    Rep Power
    907
    Good job but most peoples wont convert there other 100+ anims to this =\
    Reply With Quote  
     

  8. #8  
    Member Animation Loading. [better [I think]] Market Banned

    Robin Spud's Avatar
    Join Date
    Aug 2008
    Age
    31
    Posts
    2,338
    Thanks given
    46
    Thanks received
    73
    Rep Power
    1068
    Quote Originally Posted by Chief View Post
    Wait so give me an example of what an animation would look like then.
    ...what i posted contains 2 anims...
    Reply With Quote  
     

  9. #9  
    Community Veteran


    Join Date
    Jun 2007
    Posts
    1,683
    Thanks given
    302
    Thanks received
    309
    Rep Power
    481
    Mm looks good, would take a while to reformat them all tho, thanks anyway for this

    One problem tho, some animations dont have delays.

    FIXED METHOD! If you don't have setData, use this:
    Code:
    					for(int i = 0; i < frames.length; i++) {
    						if(j == frames[i][0]) {
    							if(FrameStart[frames[i][1]] < 1)
    							Class36.methodCustomAnimations(false, frames[i][1]);
    							anims[j].anInt352 = frames[i].length-3;
    							anims[j].anIntArray353 = new int[frames[i].length-3];
    							anims[j].anIntArray354 = new int[frames[i].length-3];
    							anims[j].anIntArray355 = new int[frames[i].length-3];
    							for(int i2 = 0; i2 < frames[i].length-3; i2++) {
    								anims[j].anIntArray353[i2] = frames[i][i2]+FrameStart[frames[i][1]];
    								anims[j].anIntArray354[i2] = -1;
    								anims[j].anIntArray355[i2] = delays[i][i2];
    							}
    						}
    					}
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •