Author Topic: Targeting Issues  (Read 3131 times)

0 Members and 1 Guest are viewing this topic.

Offline CrisisTopic starter

  • Global Moderator
  • *
  • *
  • Posts: 3024
  • Activity:
    2%
  • Reputation Power: 41
  • Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.
  • Gender: Male
  • Scripting well enough to break things!
  • Respect: +206
  • Referrals: 2
    • View Profile
Targeting Issues
« on: March 14, 2015, 07:24:56 AM »
0
I am very confused on this and boy does it show. I am trying an easy little snippet trying to figure out how to cast a spell onto a target that is not myself. I am in the Skara Stable Pen and trying to cast bless onto a horse. I know it won't let me perform beneficial acts but it allows me to see that it is working when that system message comes up. However, I am doing it wrong cause I am getting the targeting cursor from casting but that is it.

Code: [Select]
set %horse SG

finditem %horse G_10
event macro 15 16
target
set #LTargetID %horse
set #LTargetKind
event macros 22
wait 20s
return

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: Targeting Issues
« Reply #1 on: March 14, 2015, 08:49:47 AM »
0

You need to define your Ltarget

Code: [Select]
set %horse SG
finditem %horse G_10

 set #ltargetkind 1     ; <-----------------
    set #ltargetid %horse
    event macro 15 16
    target 3s
    event macro 22 0
    wait 20
 

Offline CrisisTopic starter

  • Global Moderator
  • *
  • *
  • Posts: 3024
  • Activity:
    2%
  • Reputation Power: 41
  • Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.
  • Gender: Male
  • Scripting well enough to break things!
  • Respect: +206
  • Referrals: 2
    • View Profile
Re: Targeting Issues
« Reply #2 on: March 14, 2015, 09:52:49 AM »
0
It still isn't targeting the horse, I am just getting you are already casting a spell

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13305
  • Activity:
    0.8%
  • 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: Targeting Issues
« Reply #3 on: March 14, 2015, 10:44:24 AM »
0
It still isn't targeting the horse, I am just getting you are already casting a spell

Try targeting with the #FINDID of the horse, not the #FINDTYPE.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: Targeting Issues
« Reply #4 on: March 14, 2015, 01:55:42 PM »
0
This is what I use.

Code: [Select]
finditem XI G_10
if #findcnt > 0
{
  set #ltargetkind 1
  set #ltargetid #findid
  event macro 15 17 
  target 3s
  event macro 22
  wait 2s
}
/code]

Offline CrisisTopic starter

  • Global Moderator
  • *
  • *
  • Posts: 3024
  • Activity:
    2%
  • Reputation Power: 41
  • Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.
  • Gender: Male
  • Scripting well enough to break things!
  • Respect: +206
  • Referrals: 2
    • View Profile
Re: Targeting Issues
« Reply #5 on: March 14, 2015, 04:05:50 PM »
0
I added a basic healing to it

Code: [Select]
finditem QHB_PHB G_5
if #findcnt > 0
  {
  set #ltargetkind 1
  set #ltargetid #findid
  event macro 15 41
  target 3s
  event macro 22
  wait 2s
  }
if #HITS < ( #MAXHITS - 30 )
  {
  set #lobjectid
  event macro 15 28
  wait 20
  target
  event macro 23 0
  wait 20
  }

Offline CrisisTopic starter

  • Global Moderator
  • *
  • *
  • Posts: 3024
  • Activity:
    2%
  • Reputation Power: 41
  • Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.
  • Gender: Male
  • Scripting well enough to break things!
  • Respect: +206
  • Referrals: 2
    • View Profile
Re: Targeting Issues
« Reply #6 on: March 14, 2015, 05:04:58 PM »
0
Ok I added  a very basic pathfind to corpse but the whole thing is very rough. I know I should have seperate subs for health monitor, attack, and pathfind to body but I am working on just getting them working before trying to make them all seperate and then to work together lol. I think I am in over my head but it is fun. Thanks Ghost for all the help so far!

Code: [Select]
finditem QHB_PHB G_9
if #findcnt > 0
  {
  set #ltargetkind 1
  set #ltargetid #findid
  event macro 15 41
  target 3s
  event macro 22
  wait 2s
  }
if #HITS < ( #MAXHITS - 30 )
  {
  set #lobjectid
  event macro 15 28
  wait 20
  target
  event macro 23 0
  wait 20
  }
finditem YFM G_9
if findcnt > 0
  {
  event pathfind #findx #findy #charposz
  wait 4s
  until #charposx = #findx && #charposy = #findy
  wait 2s
  if #findkind = -1
  {
return

How do I get the pathfind to stop after it goes to the corpse the first time? I believe that if #findkind = -1 means that it will stay there until the corpse decays but not sure how else to do it.

Offline CrisisTopic starter

  • Global Moderator
  • *
  • *
  • Posts: 3024
  • Activity:
    2%
  • Reputation Power: 41
  • Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.
  • Gender: Male
  • Scripting well enough to break things!
  • Respect: +206
  • Referrals: 2
    • View Profile
Re: Targeting Issues
« Reply #7 on: March 15, 2015, 07:44:31 PM »
0
Would there by chance be someone that might want to work with me and help me make a proper healing and attack sub. This works but won't cut it for my powder quest script. I need to make a solid workable heal sub and a separate attack sub.

I am not looking for someone to do the work for me but that may be able to explain a couple of subs that I am looking at. I get lost when the subs seem to deal with %1 %2 etc and seem to be for generic instances. I understand that they work well because TM has some killer scripts like his FAF. I want to understand how they work and I guess it is something that I cannot figure out on my own.

I have been looking at tutorials here and on EUO but they don't really cover attacking and pathfinding to corpses and then starting the search all over again.

Offline Tidus

  • Lazy
  • Administrator
  • *
  • *
  • Posts: 1291
  • Activity:
    0%
  • Reputation Power: 15
  • Tidus is working their way up.Tidus is working their way up.Tidus is working their way up.
  • Gender: Male
  • Mind Blown
  • Respect: +151
  • Referrals: 2
    • View Profile
    • Ultimate Apparel
Re: Targeting Issues
« Reply #8 on: March 15, 2015, 08:54:15 PM »
0
send me and icq crisis
For those who have fought for it, freedom has a taste the protected will never know ~ Anonymous, Vietnam, 1968

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: Targeting Issues
« Reply #9 on: March 16, 2015, 01:34:19 PM »
0
Here what I have to Pathfind to corpse

Code: [Select]
sub gatherLeather
set %itemtype YFM

finditem %itemtype G_9
repeat
event pathfind #findx #findy #charposz
wait 4s
if #findkind = -1
{
return
}

finditem KFR_HFR C_ , #backpackid
if #findkind = 1
set #lobjectid HFR
set #lobjectid #findID
event macro 17
wait 10
finditem %itemtype G_2
set #ltargetid #findid
set #ltargetkind 1
event macro 22
ignoreitem #findid
wait 1s
If #weight > %recallweight
{
 gosub unloadbase
}
return


Tags: