Author Topic: targetting  (Read 5898 times)

0 Members and 1 Guest are viewing this topic.

Offline ChrisokTopic starter

  • Jr. Member
  • **
  • Posts: 46
  • Activity:
    0%
  • Reputation Power: 1
  • Chrisok has no influence.
  • Respect: +7
  • Referrals: 0
    • View Profile
targetting
« on: April 01, 2013, 10:03:05 AM »
0
I am having difficulties with LOS issues and checking between assigned friends healthbars

I am using

Code: [Select]
begin
losOptions := losTypeRunUO;
while not dead do
  begin
//edited out
    begin
     c := GetPathArray(PredictedX, PredictedY, PredictedZ, GetX(Host), GetY(Host), 1, True, p);
     if c > 0 then StepQ(CalcDir(PredictedX, PredictedY, p[0].X, p[0].Y), True);
    end;
//edited out
  end;
end.

Code: [Select]
procedure checkthem;
begin
 Friend := [$assigned, $assigned, $assigned, $assigned];
 for i := 0 to Length(Friend) -1 do
  begin
   res := CheckLoS(getX(self), getY(self), getZ(self) + 15, getX(Friend[i]), getY(Friend[i]), getZ(Friend[i]) + 15, WorldNum);
//edited out
  end;  
end;


constant is defined as my chars ID$
and vars i : Integer;
Friend: array of Cardinal;


any ideas? Ive tried to pm a few people with no luck, seems this community is a graveyard.

Offline Crome969

  • Moderator
  • *
  • *****
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: targetting
« Reply #1 on: April 01, 2013, 10:57:31 AM »
0
Dear Chrisok,

Its not like we are a graveyard, but the people who are active using Stealth working on different things to make Stealth and UO much easyer.

Code: [Select]
res := CheckLoS(getX(self), getY(self), getZ(self) + 15, getX(Friend[i]), getY(Friend[i]), getZ(Friend[i]) + 15, WorldNum);I dont know why you add 15 to Z but this will may cause in malfunction.
Whenever you are at a Z Coord ( Like in Cave - 95 ) you check if your Buddy is avaible on Z -80. If you think on a 3 Dimensional Model you will see the that the difference is huge. I would just check
Code: [Select]
res := CheckLoS(getX(self), getY(self), getZ(self), getX(Friend[i]), getY(Friend[i]), getZ(Friend[i]), WorldNum);You also not need to declare
Code: [Select]
res : Boolean if you combine it into an If-Clause
Code: [Select]
If (CheckLoS(getX(self), getY(self), getZ(self), getX(Friend[i]), getY(Friend[i]), getZ(Friend[i]), WorldNum)) then
begin
// Your Code XY
end;

I also  dont understand why you need

Code: [Select]
    begin
     c := GetPathArray(PredictedX, PredictedY, PredictedZ, GetX(Host), GetY(Host), 1, True, p);
     if c > 0 then StepQ(CalcDir(PredictedX, PredictedY, p[0].X, p[0].Y), True);
    end;
This code also miss a lot of references to just check out and understand its sense.
Without the required informations its just a code snipped what could work or not, we dont have a possibility to check it out.

Offline ChrisokTopic starter

  • Jr. Member
  • **
  • Posts: 46
  • Activity:
    0%
  • Reputation Power: 1
  • Chrisok has no influence.
  • Respect: +7
  • Referrals: 0
    • View Profile
Re: targetting
« Reply #2 on: April 01, 2013, 11:02:56 AM »
0
did not want to release everything until its completely owrking - sent you a pm with whole script revised to see if you can see what the problem is

Offline Neo

  • Prime Program
  • Elite
  • *
  • *
  • Posts: 821
  • Activity:
    0%
  • Reputation Power: 13
  • Neo barely matters.Neo barely matters.
  • Respect: +155
  • Referrals: 3
    • View Profile
Re: targetting
« Reply #3 on: April 01, 2013, 02:55:30 PM »
0
any ideas? Ive tried to pm a few people with no luck, seems this community is a graveyard.
Me being one of the people you have pm'ed, I did say I would test it once I could...

I have, however, been on a coding spree here for the last few days trying to fix some issues with Stealth v4.3.6, for everybody's sake.

I don't know who else's "deadness" you have implied with your post, but I don't think it's really fair to make such statements about communities as a whole. Especially suo, which is probably the only online community I know where people will actually get out of their way to help others out...

Hope you do get your code working though, we can always use more people sharing scripts for everyone's use...
Never refuse an invitation.
Never resist the unfamiliar.
Never fail to be polite.
And never outstay your welcome.

Offline gimlet

  • Very Super Secret
  • Global Moderator
  • *
  • *
  • Posts: 6206
  • Activity:
    3.2%
  • Reputation Power: 71
  • gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!
  • Gender: Male
  • Respect: +274
  • Referrals: 3
    • View Profile
Re: targetting
« Reply #4 on: April 01, 2013, 03:52:43 PM »
0
One of those was me, but I just haven't had any time.

Offline ChrisokTopic starter

  • Jr. Member
  • **
  • Posts: 46
  • Activity:
    0%
  • Reputation Power: 1
  • Chrisok has no influence.
  • Respect: +7
  • Referrals: 0
    • View Profile
Re: targetting
« Reply #5 on: April 01, 2013, 05:38:52 PM »
0
It wasnt to be insulting. Just as both of you have mentioned, no time for review and it seems you 3 are the only active ones in SUO that i've encountered. I am currently working on debugging it ;x

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: targetting
« Reply #6 on: April 01, 2013, 05:58:15 PM »
0
Well we're all pretty active, just not with Stealth at the moment.  Who knows?  Perhaps with a little patience and a bit more time, people will catch it on fire.

Patience being the operative word there.  From your perspective you've discovered something neat and it's beyond exciting.  But from our perspective, we've been doing the same old thing since 2005 and before with this whole scripting thing.  So take a deep breath, slow down and enjoy the experience.
« Last Edit: April 01, 2013, 06:37:47 PM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline ChrisokTopic starter

  • Jr. Member
  • **
  • Posts: 46
  • Activity:
    0%
  • Reputation Power: 1
  • Chrisok has no influence.
  • Respect: +7
  • Referrals: 0
    • View Profile
Re: targetting
« Reply #7 on: April 01, 2013, 06:01:09 PM »
0
having an issue here
Code: [Select]
(* Procedure Check_Targets *)
Procedure Check_Targets();
var FriendList : Array of Integer; // If only accessed in this Procedure, no need to reserve Variable Global.
var CurrentFriend : Integer;
begin
  FriendList := [$0002A4EF, $0002CE7F, $000F7F27];
  if CurrentFriend in FriendList do
  begin
    if  ( (GetHP(CurrentFriend) < GetMaxHP(CurrentFriend)) AND ( GetHP(CurrentFriend) > 0 ) AND ( TargetPreset() ) AND ( GetDistance(CurrentFriend) < 11 ) AND ( Mana() > 10 ) AND (CheckLOS( GetX(Self()) , GetY(Self()) , GetZ(Self()) , GetX(CurrentFriend) , GetY(CurrentFriend) , GetZ(CurrentFriend) , WorldNum() ) ))then
    begin
      TargetToObject(CurrentFriend);
      exit;
    end;
  end;
end;

[Error] (test.sc at 14:34):  Type mismatch at " if CurrentFriend in FriendList do "

Offline Neo

  • Prime Program
  • Elite
  • *
  • *
  • Posts: 821
  • Activity:
    0%
  • Reputation Power: 13
  • Neo barely matters.Neo barely matters.
  • Respect: +155
  • Referrals: 3
    • View Profile
Re: targetting
« Reply #8 on: April 01, 2013, 06:36:05 PM »
0
having an issue here
Code: [Select]
(* Procedure Check_Targets *)
Procedure Check_Targets();
var FriendList : Array of Integer; // If only accessed in this Procedure, no need to reserve Variable Global.
var CurrentFriend : Integer;
begin
  FriendList := [$0002A4EF, $0002CE7F, $000F7F27];
  if CurrentFriend in FriendList do
  begin
    if  ( (GetHP(CurrentFriend) < GetMaxHP(CurrentFriend)) AND ( GetHP(CurrentFriend) > 0 ) AND ( TargetPreset() ) AND ( GetDistance(CurrentFriend) < 11 ) AND ( Mana() > 10 ) AND (CheckLOS( GetX(Self()) , GetY(Self()) , GetZ(Self()) , GetX(CurrentFriend) , GetY(CurrentFriend) , GetZ(CurrentFriend) , WorldNum() ) ))then
    begin
      TargetToObject(CurrentFriend);
      exit;
    end;
  end;
end;

[Error] (test.sc at 14:34):  Type mismatch at " if CurrentFriend in FriendList do "
Well, I'm almost done with my current project, then I'll have more time to look into your issue.

I'm taking a small break now for a breather :D

Your problem here is pascal syntax. As far as I know, you can't use "if substring in string do" in pascal.

You should do something like this:

Code: [Select]
if Pos(Friend,Friendlist) > 0 then
Pos just returns the position of a substring inside a string. So, if it's bigger than 0, it means the string is there.
Never refuse an invitation.
Never resist the unfamiliar.
Never fail to be polite.
And never outstay your welcome.

Offline ChrisokTopic starter

  • Jr. Member
  • **
  • Posts: 46
  • Activity:
    0%
  • Reputation Power: 1
  • Chrisok has no influence.
  • Respect: +7
  • Referrals: 0
    • View Profile
Re: targetting
« Reply #9 on: April 01, 2013, 07:14:42 PM »
0
that fixed that error, now running into variable expect at ", 1,"
Code: [Select]
    begin
      if (GetPathArray(PredictedX, PredictedY, PredictedZ, GetX(Host), GetY(Host), 1, True, p) > 0) then
      begin
        StepQ(CalcDir(PredictedX, PredictedY, p[0].X, p[0].Y), True);
      end;
    end

Offline Crome969

  • Moderator
  • *
  • *****
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: targetting
« Reply #10 on: April 01, 2013, 10:30:59 PM »
0
Code: [Select]
  if CurrentFriend in FriendList do never can work!!!
Code: [Select]
For x in y do works for most dynarrays or
Code: [Select]
if ( content = true\false )then for implizit checkups but
Code: [Select]
if x in y do is a pseudo mix of while and if.
You may review this line ( and iam pretty sure i used for for that snippet :P )

Offline ChrisokTopic starter

  • Jr. Member
  • **
  • Posts: 46
  • Activity:
    0%
  • Reputation Power: 1
  • Chrisok has no influence.
  • Respect: +7
  • Referrals: 0
    • View Profile
Re: targetting
« Reply #11 on: April 03, 2013, 01:23:53 PM »
0
still stumped, tried even removing the ability for multiple targets and just adding one target . didnt manage to fix. There must be another way?

Tags: