DopeyBiach Posted August 20, 2012 Author Share Posted August 20, 2012 When there is more than one item on the same spot on the map and you pick the item up.. It picks up the bottom item first? I can't seem to find the code to change this anywhere ![:mellow:](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/mellow.png) .. So say if your standing on a log and a fish.. The log is UNDERNEATH the fish.. However you still pick up the log first.. How do I change this? Thanks. Link to comment Share on other sites More sharing options...
JohnPony Posted August 20, 2012 Share Posted August 20, 2012 It's something to do with map item indexing i believe, i fixed it one but that was awhile ago. Might try and dig up the code. Link to comment Share on other sites More sharing options...
DopeyBiach Posted August 20, 2012 Author Share Posted August 20, 2012 Thanks, I've looked for ages, but can't seem to find any relative coding, will have a further scan ![^_^](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/happy.png) Link to comment Share on other sites More sharing options...
Ecto Posted August 20, 2012 Share Posted August 20, 2012 I think it's somewhere in the sub```CheckMapGetItem```I'm not sure though, I'd have to look. Link to comment Share on other sites More sharing options...
DopeyBiach Posted August 20, 2012 Author Share Posted August 20, 2012 I've looked there lol, I'm most likely missing something and it's bound to be something irritatingly obvious. Link to comment Share on other sites More sharing options...
Joyce Posted August 20, 2012 Share Posted August 20, 2012 Just turn the render sub around, make it go from high to low. The pickup code picks up the first item it can find in the UDT, but the render code layers these, so 1 will be rendered first, 2 on top of that etc. That's how this is caused. Link to comment Share on other sites More sharing options...
JohnPony Posted August 20, 2012 Share Posted August 20, 2012 > Just turn the render sub around, make it go from high to low. The pickup code picks up the first item it can find in the UDT, but the render code layers these, so 1 will be rendered first, 2 on top of that etc. That's how this is caused.So… I did a long complicated process of indexing the map items for nothing? Link to comment Share on other sites More sharing options...
DopeyBiach Posted August 20, 2012 Author Share Posted August 20, 2012 In what sub exactly does the rendering for mapitems take place.. If it's BltItem or Render_Graphics I can't see it.. Urggh, I'm tired lol.. Link to comment Share on other sites More sharing options...
Joyce Posted August 20, 2012 Share Posted August 20, 2012 > So… I did a long complicated process of indexing the map items for nothing?Pretty much yes. Could've done it far easier and just adjusted the render order.> In what sub exactly does the rendering for mapitems take place.. If it's BltItem or Render_Graphics I can't see it.. Urggh, I'm tired lol..BltItem, HOWEVER the order of it is determined in Render_Graphics:```' Blit out the items If NumItems > 0 Then For i = 1 To MAX_MAP_ITEMS If MapItem(i).num > 0 Then Call BltItem(i) End If Next End If``` Link to comment Share on other sites More sharing options...
DopeyBiach Posted August 20, 2012 Author Share Posted August 20, 2012 I've seen this line so many times and ignored it LOL.. So how would I change that so the order was from high to low? Sorry, last question I swear :L.. At least I'll know this in future.. Thanks again ![:lol:](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/laugh.png) Link to comment Share on other sites More sharing options...
Joyce Posted August 20, 2012 Share Posted August 20, 2012 Written from the top of my head:```if NumItems > 0 theni = MAX_MAP_ITEMSDo While i > 0 If MapItem(i).num > 0 then Call BltItem(i) End If i = i - 1LoopEnd If```I was going to let you figure it out yourself first, teaches people more. :[ Link to comment Share on other sites More sharing options...
DopeyBiach Posted August 20, 2012 Author Share Posted August 20, 2012 Ahh, I always try and avoid looping, I never seem to get it right :L.. Thanks :] Link to comment Share on other sites More sharing options...
Joyce Posted August 20, 2012 Share Posted August 20, 2012 It's not hard, so long as you make sure to set a limit and actually GET to that limit it can't go wrong. ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png) Link to comment Share on other sites More sharing options...
DopeyBiach Posted August 20, 2012 Author Share Posted August 20, 2012 Thanks for that, will keep it in mind.. My loops usually crash the prog.. And VB >_> Link to comment Share on other sites More sharing options...
Joyce Posted August 20, 2012 Share Posted August 20, 2012 That just means you're not closing and exiting them properly. :] 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