Thread: Orphaned case?

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1 Orphaned case? 
    Registered Member Projectkingdom's Avatar
    Join Date
    Sep 2012
    Posts
    22
    Thanks given
    1
    Thanks received
    0
    Rep Power
    11
    Code:
    public static ItemDef forID(int i) {
    	
            for(int j = 0; j < 10; j++)
                if(cache[j].id == i)
                    return cache[j];
    
            cacheIndex = (cacheIndex + 1) % 10;
            ItemDef itemDef = cache[cacheIndex];
            stream.currentOffset = streamIndices[i];
            itemDef.id = i;
            itemDef.setDefaults();
            itemDef.readValues(stream);
    		ItemDef_2.Items(i);
    		/* Customs added here? */
    			case 15084:
    			itemDef.actions = new String[5];
    			itemDef.actions[0] = "Roll";
    			itemDef.modelID = 7509;
    			itemDef.modelZoom = 760;
    			itemDef.modelRotation1 = 0;
    			itemDef.modelRotation2 = 0;
    			itemDef.modelOffset1 = 0;
    			itemDef.modelOffset2 = 0;
    			itemDef.name = "Dice bag";
    			itemDef.description = "@red@!!!WARNING!!!@bla@ VERY ADDICTIVE!".getBytes();
    			break;
    		
            if(itemDef.certTemplateID != -1)
                itemDef.toNote();
    			
    			
            if(!isMembers && itemDef.membersObject) {
    		
                itemDef.name = "Members Object";
                itemDef.description = "Login to a members' server to use this object.".getBytes();
                itemDef.groundActions = null;
                itemDef.itemActions = null;
                itemDef.team = 0;
    		}	
            return itemDef;
        }
    When i add

    Code:
    		case 15084:
    			itemDef.actions = new String[5];
    			itemDef.actions[0] = "Roll";
    			itemDef.modelID = 7509;
    			itemDef.modelZoom = 760;
    			itemDef.modelRotation1 = 0;
    			itemDef.modelRotation2 = 0;
    			itemDef.modelOffset1 = 0;
    			itemDef.modelOffset2 = 0;
    			itemDef.name = "Dice bag";
    			itemDef.description = "@red@!!!WARNING!!!@bla@ VERY ADDICTIVE!".getBytes();
    			break;
    i get : error orphaned case
    case: 15084

    cant figure out whats wrong :/
    thats the only custom in there also, there is no other case: 15084

    heres my item def

    Can anyone see anything wrong?
    Reply With Quote  
     

  2. #2  
    Registered Member
    Bubletan's Avatar
    Join Date
    May 2011
    Posts
    585
    Thanks given
    133
    Thanks received
    283
    Rep Power
    320
    Add a switch. "switch(itemDef.id) {"
    - Playing RS almost 24/7?

    Reply With Quote  
     

  3. #3  
    Registered Member Projectkingdom's Avatar
    Join Date
    Sep 2012
    Posts
    22
    Thanks given
    1
    Thanks received
    0
    Rep Power
    11
    were should i put it?
    Reply With Quote  
     

  4. #4  
    Registered Member Projectkingdom's Avatar
    Join Date
    Sep 2012
    Posts
    22
    Thanks given
    1
    Thanks received
    0
    Rep Power
    11
    everywhere i put it, either gives me 62 or 100 errors
    Reply With Quote  
     

  5. #5  
    Registered Member
    Kamiel's Avatar
    Join Date
    Jul 2010
    Age
    28
    Posts
    1,272
    Thanks given
    66
    Thanks received
    166
    Rep Power
    295
    Code:
    public static ItemDef forID(int i) {
    	
            for(int j = 0; j < 10; j++)
                if(cache[j].id == i)
                    return cache[j];
    
            cacheIndex = (cacheIndex + 1) % 10;
            ItemDef itemDef = cache[cacheIndex];
            stream.currentOffset = streamIndices[i];
            itemDef.id = i;
            itemDef.setDefaults();
            itemDef.readValues(stream);
    		ItemDef_2.Items(i);
    		/* Customs added here? */
            switch(i) {
    			case 15084:
    			itemDef.actions = new String[5];
    			itemDef.actions[0] = "Roll";
    			itemDef.modelID = 7509;
    			itemDef.modelZoom = 760;
    			itemDef.modelRotation1 = 0;
    			itemDef.modelRotation2 = 0;
    			itemDef.modelOffset1 = 0;
    			itemDef.modelOffset2 = 0;
    			itemDef.name = "Dice bag";
    			itemDef.description = "@red@!!!WARNING!!!@bla@ VERY ADDICTIVE!".getBytes();
    			break;
    		}
            if(itemDef.certTemplateID != -1)
                itemDef.toNote();
    			
    			
            if(!isMembers && itemDef.membersObject) {
    		
                itemDef.name = "Members Object";
                itemDef.description = "Login to a members' server to use this object.".getBytes();
                itemDef.groundActions = null;
                itemDef.itemActions = null;
                itemDef.team = 0;
    		}	
            return itemDef;
        }
    Use that.
    Reply With Quote  
     

  6. #6  
    Registered Member Projectkingdom's Avatar
    Join Date
    Sep 2012
    Posts
    22
    Thanks given
    1
    Thanks received
    0
    Rep Power
    11
    gives me 4 errors :/

    Reply With Quote  
     

  7. #7  
    Registered Member
    Bubletan's Avatar
    Join Date
    May 2011
    Posts
    585
    Thanks given
    133
    Thanks received
    283
    Rep Power
    320
    change both "actions" to "itemActions" and modelrotations change to "modeRotationY" and X
    - Playing RS almost 24/7?

    Reply With Quote  
     

  8. #8  
    Registered Member
    Kamiel's Avatar
    Join Date
    Jul 2010
    Age
    28
    Posts
    1,272
    Thanks given
    66
    Thanks received
    166
    Rep Power
    295
    Quote Originally Posted by Projectkingdom View Post
    gives me 4 errors :/
    try searching trough your ItemDef. The ones it cannot find have a different name in your class.
    Reply With Quote  
     

  9. #9  
    Registered Member Projectkingdom's Avatar
    Join Date
    Sep 2012
    Posts
    22
    Thanks given
    1
    Thanks received
    0
    Rep Power
    11
    Thanks
    Reply With Quote  
     

  10. #10  
    Registered Member Projectkingdom's Avatar
    Join Date
    Sep 2012
    Posts
    22
    Thanks given
    1
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by Bubletan View Post
    change both "actions" to "itemActions" and modelrotations change to "modeRotationY" and X
    Worked thank you ^_^
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

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


User Tag List

Similar Threads

  1. Case Orphaned (case 17) Paying $2
    By Bondie8 in forum Help
    Replies: 13
    Last Post: 11-28-2010, 10:44 AM
  2. Replies: 5
    Last Post: 11-10-2010, 08:05 PM
  3. Replies: 3
    Last Post: 02-16-2009, 06:25 AM
  4. Case 252: Orphaned Case
    By Aeronix in forum Help
    Replies: 20
    Last Post: 02-07-2009, 06:36 PM
  5. Case 130: Orphaned Case?
    By Dark Zero™ in forum Help
    Replies: 11
    Last Post: 10-30-2008, 04:40 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •