SRL Archive - OSR Help

Find Landmarks and Get relative position anywhere! ( for the inventive out there... )


sm0k3

2013-04-17 21:26:57

hey all in process of writing a new script ..

got a little problem though and need some inventive ideas

i would like to create a box around my current location so that i can use pointinbox to keep my player from walking away .. BUT i need to do this anywhere.. in previous scripts i would use sps as its the only way i know to get current location (i hate not having reflection…:( ) …

i do have an idea altho not sure how i can get it to work ,

is there any way i can effectively make a location ie where the player starts is Baselocation
then i can create the box lets say 50x50 width height and if no longer in the box walk back
thing is its a script to be used anywhere so i have to find a way of doing this on the fly..

idea

look for things that stand out on the minimap and make them markers to calculate location relative to them

FindLandmarks(): TVariantArray;
then some kind of way to find a colour that is only seen once or twice on MM

or if theres not a colour thats unique enough use somthing thats size/shape is unique or
only seen once or twice

use whatever is found and give it a name ie the array would contain somthing like

Landmarks[0].Name = Baseloc <-could be a bulding or somthin on MM
Landmarks[0].colour = 113244
Landmarks[0].SizeX = 13
Landmarks[0].SizeY = 11
could be that once the colour is found we check if the colour fits a box with a size of 13x 11y

then once we have filled th array with a few of these " Landmarks " we could then check to see how far away we are from them if we had lets say 3 landmarks we could then Triangulate our relative location on the fly

also if scripters do this while making the script then maby it could be used as a walking method aswell as long as you could find enough unique parts of the map then it should in theory be quite accurate as you can include tol and auto colouring to fight rs changing the colours of things as the would only have to stay at least semi-unique


ive got no idea if this would work but ive been thinking about it for a while and i cant see why not….

so What do people think , if i can get it to work i would release it as an include i guess…

Enslaved

2013-04-18 17:35:13

Have you tried DDTMs?

masterBB

2013-04-18 17:47:35

Multiple systems like this has already been made. Look up ObjectDtms.

sm0k3

2013-04-18 20:46:48

From: masterBB
Multiple systems like this has already been made. Look up ObjectDtms.


Ok true is see what you mean on the similarity altho with object dtms can someone just shove there player any where and the script just decide "ok theres a theres a gate there (it sees the colour of a fence in mini map and sees the red marker for the gate)
so im this far a way from it , so this is "ground zero" so i wont stray 5 meters from this point , if i do i will attempt to find the gate and walk back to this point,

i just cant figure out how to make a script do it

so basicly im looking for suggestions on ways to find somthing unique kind of like an anomaly on the minimap
idealy it would place a box around somthing that stands out the most on the minimap and mabey return its size x y ??? any idease on how to do this