SRL Archive - SRL Updates & Announcements

SRL: February 6th, 2013 ~ New Actionbar functions


Olly

2013-02-05 23:35:32

@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

2013-02-06 00:56:28

Very nice gj euph!

Flight

2013-02-06 01:20:26

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

Sjoe

2013-02-06 01:25:03

Nice updates, could someone explain TPAFromLine? and an example if possible.
Read it in the include, don't understand the usage

Olly

2013-02-06 01:36:15

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.

From: Flight
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

2013-02-06 01:38:49

From: Ollybest
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

2013-02-06 01:47:50

From: Flight
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

2013-02-06 10:45:16

From: Flight
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

2013-02-06 10:50:54

Good Job Euph..

euphemism

2013-02-06 13:06:02

@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:

Kevin

2013-02-06 15:13:18

Wow, awesome job, Euph. Definitely a +1 to all this!

Press Play

2013-02-06 15:37:08

Fantastic work man! :)

Coh3n

2013-02-06 17:19:34

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

2013-02-06 18:14:56

Either way, good job guys :)

Flight

2013-02-06 19:53:07

From: Coh3n
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

2013-02-06 22:05:17

From: Coh3n
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.