Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[Resolved]Picking up items order (HELP D:)


DopeyBiach
 Share

Recommended Posts

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

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

> 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

> 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

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

Written from the top of my head:

```
if NumItems > 0 then

i = MAX_MAP_ITEMS

Do While i > 0

If MapItem(i).num > 0 then

Call BltItem(i)

End If

i = i - 1

Loop

End If
```

I was going to let you figure it out yourself first, teaches people more. :[
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...