Log in

View Full Version : Need finger pointing



JTcm
08-24-2012, 09:06 PM
Hello people,

I am in need of some finger pointing. I am in the middle of writing improvements for a script I have written for a non-RS game. I am using DTM's to find my 'objects' but because I am a developer by trade I want to make the code as dynamic as possible (Inversion of Control and stuff, you know). If possible I would like to create a separate file in which I can store all the DTM's and call into them from my main script like the current use of some constant variables (i.e. MSX1). If there is a guide on here somewhere that has this information a finger point to the location would be awesome.

Also I want this script to be as good as possible so if DTM's are not the way to go for finding buttons etc please "point" me in the right direction.

Thanks,

JT

Runaway
08-24-2012, 09:32 PM
You can create your own include and set the DTMs as string constants. Something like:


const
DTM_1 = 'acbcbef13728319diwudgiwf02y82r3';
DTM_2 = 'iuoc3f3gwfiwuf782g3fugeuaigcf83gf2';
//etc...


Which you can then call in your script as long as you've got it included at the top:


program new;
{$I SRL/SRL/Misc/DTMInclude.Simba}
// ^ Wherever it's located

procedure Whatever;
var
DTM: Integer;
begin
DTM := DTMFromString(DTM_1);
FreeDTM(DTM);
end;


There might be a tutorial on creating your own include; I'll edit this if I find one :)

EDIT: Found two!
Creating Your VERY Own Includes! (http://villavu.com/forum/showthread.php?t=23352) by Daniel
Making your OWN includes! (http://villavu.com/forum/showthread.php?t=35830) by Rich

JTcm
08-24-2012, 10:00 PM
@Runaway

Thanks,

That is exactly what I was looking for. I am still really new to this community/language and so the terminology is lacking. Makes it hard to search for things when you don't know what to call them :)

I really appreciate the help!

Runaway
08-24-2012, 10:13 PM
@Runaway

Thanks,

That is exactly what I was looking for. I am still really new to this community/language and so the terminology is lacking. Makes it hard to search for things when you don't know what to call them :)

I really appreciate the help!

No problem, glad to be of service! The search function here is hard to use even if you know what to look for :p

masterBB
08-24-2012, 10:24 PM
If you want to give it a professional look you could add the dtms to a .ini file. There might be a few tutorials about that on this forum.