PDA

View Full Version : [Update] SRL: February 6th, 2013 ~ New Actionbar functions



Olly
02-06-2013, 04:35 AM
euphemism has added loads of new actionbar functions for us all :)
These are:


GetAbilityLocation
GetAbilityCooldown
UseAbility
ClickActionBarSlot
AbilityInSlot
AddAbilityToActionBar
AddItemToActionBar
TPAFromLine
TPAFromLineWrap


note: for ability constants 1-12 will use the actionbar, and 13..74 will switch to the ability's tab and use it from there. you can find the Ability Constants in globals.simba starting at line 207.

GetAbilityCooldown - returns the cooldown percentage (1..100) without any hard coding of the cooldowns!

WriteLn('Ability cooldown is ' + IntToStr(GetAbilityCooldown(AB_SURGE)) + '% complete.');

if (GetAbilityCooldown(AB_SURGE) = 100) then
writeln('we can now use the surge ability again!');

UseAbility - what it says uses the inputted ability if its available.
if (UseAbility(3)) then
WriteLn('Casted ability in slot three!');

ClickActionBarSlot - simply clicks the selected actionbar slot

if ClickActionBarSlot(1) then
writeln('we dropped a ore in slot 1');


All say thanks to him. :)

Ashaman88
02-06-2013, 05:56 AM
Very nice gj euph!

Flight
02-06-2013, 06:20 AM
The 'TPAFromLine' is just what I need for some alternate DTM-like object-finding.

Sjoe
02-06-2013, 06:25 AM
Nice updates, could someone explain TPAFromLine? and an example if possible.
Read it in the include, don't understand the usage

Olly
02-06-2013, 06:36 AM
Too late to finish the list tonight, but tpafromline isn't actually a function related to action bar it just creates a line (straight as possible) between 2 points.


The 'TPAFromLine' is just what I need for some alternate DTM-like object-finding.
Interesting indeed.. :)


edit: im not sure if tpafromline is actually in simba yet if its not the function is currently in the include named "tmp_tpafromline"

Flight
02-06-2013, 06:38 AM
too late to finish the list, but tpafromline snit actually a function related to actionbar it just creates a line (straight as possible) between 2 points.

edit: im not sure if tpafromline is actually in simba yet if its not the function is currently in the include named "tmp_tpafromline"

What's the difference between TPAFromLine and the current 'TPABetweenPoints'?

Olly
02-06-2013, 06:47 AM
What's the difference between TPAFromLine and the current 'TPABetweenPoints'?


I would love to know i did ask euphemism and i think? he said its more accurate but i wouldn't take my word wait for him to respond.

procedure test;
var
tpa1, tpa2: TPointArray;
begin
tpa1 := tpabetweenpoints(point(100,100), point(200,200), 1, 0);

tpafromlinewrap(100, 100, 200, 200, tpa2);

writeln(length(tpa1));
writeln(length(tpa2));

//result:
142
101

end;

Coh3n
02-06-2013, 03:45 PM
What's the difference between TPAFromLine and the current 'TPABetweenPoints'?One results in more points, but they are used for exactly the same thing.

Silentcore
02-06-2013, 03:50 PM
Good Job Euph..

euphemism
02-06-2013, 06:06 PM
Coh3n: TPABetweenPoints is great for generating a random dispersion of points along a line, but it is not so great at actually making a line. See below:

On the left are lines generated by TPAFromLine, on the right are lines generated by TPABetweenPoints:
http://puu.sh/1YpqC

Kevin
02-06-2013, 08:13 PM
Wow, awesome job, Euph. Definitely a +1 to all this!

Press Play
02-06-2013, 08:37 PM
Fantastic work man! :)

Coh3n
02-06-2013, 10:19 PM
Wha..? They're almost exactly the same thing. TPABetweenPoints just has more points. They both still make a line from point A to point B.

I think TPABetweenPoints was originally written for tile walking, so that could be why there's more points.

Kyle Undefined
02-06-2013, 11:14 PM
Either way, good job guys :)

Flight
02-07-2013, 12:53 AM
Wha..? They're almost exactly the same thing. TPABetweenPoints just has more points. They both still make a line from point A to point B.

I think TPABetweenPoints was originally written for tile walking, so that could be why there's more points.

That's what I would have guessed, or future use in mouse-movement.

euphemism
02-07-2013, 03:05 AM
Wha..? They're almost exactly the same thing. TPABetweenPoints just has more points. They both still make a line from point A to point B.

I think TPABetweenPoints was originally written for tile walking, so that could be why there's more points.

Sure, they are similar, but the point of TPAFromLine is to produce a line of pixels as true as possible to the specified line. TPABetweenPoints does not do this, and has random extraneous points along the line. I am just trying to point out that the two functions serve different purposes.