SRL Archive - OSR Help

Advanced looting procedure


shiningwhite

2013-01-02 19:18:40

I haven't actually written any code, as I have yet to perfect the procedure,
but I'd like a little feedback on what I have planned so far.

First, the include would contain 2 procedures:

Loot Mapper

Begins on script startup, creates arrays for loot pile storage that include loot mm coords, time made, and lootpile checked status. The procedure will mark all loot found on startup as checked, so as not to robotically check all available loot on map.

LootUpdate

Called whenever a kill is completed, or on a timer. Updates loot map information with new piles and timed out piles. Checks the loot of new piles against desirableness list, and then loots if desirable is found then marks pile as looted.


The loot map will consist of an array of length 50 to contain all loot pile entities. It will grab red dots from minimap, and then convert it to a global position using sps. Then, it will store the lootpile in the array to be checked by the looter function. Only new piles within a certain distance of current minimap center will be checked. The loot mapper will assign an index of 0 to 49, and then rotate back to 0, replacing any previously held entity. This is to keep the array within a small memory requirement, as well as to delete old entries that no longer exist.

The benefits of looting as such is total control, and 100% desireable loot collection. It will never miss a charm, or a valuable loot drop. It is also allows for complete loot list customization without the need for color of specific items.

Does anyone see any glaring error as far as my tentative procedural plan goes?

xdarkshadowx

2013-01-04 03:05:24

Just remember there might be red dots from other players in the area, And that sometimes drops end up on top of old ones so you'll need a system for clearing out your list of already checked areas. Seems like you understand what you're trying to do though :)

Lalaji

2013-01-04 11:26:33

The problem with the loot mapper will be when the player moves. Some of the red dots in the array will disappear from the minimal, some new will appear on the mm. However, with you make a kill, the player moves and all the reedot cords in the array change.

I suppose you could get the player pos using sps, get the reedot array, move the player for a kill, get new player pos again using sps, and then get the x cords and y cords moved. Add the variables to each point on the reddot array to get the updated array.

You would have to do this every time the player moves and i dont know if there is a better way of working around this.

E I hate this iPad sorry for the typos, but you know what I mean?

footballjds

2013-01-04 11:59:04

I'm developing a VERY similar loot mechanism for my waterfiend script. I actually discussed it in depth a week or so ago on SRL's fake skype channel. I'm use a DDTM to get position as it's much more accurate then SPS. I'm still waiting on Narcle to update his MMtoMS function though…