Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion Goto page 1, 2  Next
rmorock8869@yahoo.com
Beginner


Joined: 15 May 2018
Posts: 17

PostPosted: Wed Aug 18, 2021 4:08 pm   

Targetting System
 
Do you have any suggestions for an auto target system? I play on another mud. Currently, when I target something, I use T (name). But who if someone is polymorphed, or hidden. Can I setup something to recognize when/who to target? Thanks in advance.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Wed Aug 18, 2021 5:05 pm   
 
Sorry to move your post, but that was a 20-year-old thread, and it didn't even have the T targeting method you referenced.
Better to start a new thread in these situations.

As to your question, Yes you can.
You would just make an alias or an input trigger for the other keywords that essentially do the same thing as your T (name) method.
_________________
Discord: Shalimarwildcat
Reply with quote
rmorock8869@yahoo.com
Beginner


Joined: 15 May 2018
Posts: 17

PostPosted: Fri Aug 20, 2021 11:52 pm   
 
Apologies but I am still super noobish to coding. How would I set something like that up?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Sat Aug 21, 2021 12:37 pm   
 
How did you set the T method up?

Can you show us the code for that?
Then I can show you how to edit it to fit the new situation.
_________________
Discord: Shalimarwildcat
Reply with quote
rmorock8869@yahoo.com
Beginner


Joined: 15 May 2018
Posts: 17

PostPosted: Sat Aug 21, 2021 10:23 pm   
 
I am fairly certain I got the code off of here but here is what I have. I also found an auto rescue code on here and was trying to set my target list up like that as well so that no matter what "Approaches", "Surprises" me then it will go into the list and attack the charcter or creature attacking me

#IF (%1 != %null) {#VAR target %1; #echo You're now hunting @target}
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Sun Aug 22, 2021 3:17 am   
 
Alright, that should work pretty well.
Now we need the lines of text from the game that show how they are displayed in the room, with and without each/all of the conditions you specified.
Including those approaches and surprises.
_________________
Discord: Shalimarwildcat
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Sun Aug 22, 2021 3:21 am   
 
Essentially you will end up with:

Code:
#TRIGGER {Out of the blue (*) rushes in from the (%w) and surprises you!} {
  $target=%1
  //The target string may need to be further broken down.

  $direction=%2
  t $target
  }
_________________
Discord: Shalimarwildcat
Reply with quote
rmorock8869@yahoo.com
Beginner


Joined: 15 May 2018
Posts: 17

PostPosted: Tue Aug 24, 2021 9:21 pm   
 
Here is an example: If a Corby approaches me, or surprises me-

T = Target. If I cast a spell or use a skill, I have alias set up as c 'Silence' @target, If I want to throw something, its always @target. But I have to type in the character name. The issue is that there are some people who try to PVP. They may be polymorphed etc so sometimes spelling the name T (name of person, creature, adjective what-have-you) is sometimes difficult to spell and would be easier if the targeting system automatically tags them if I am attacked. I attempted the trigger you gave me and it didn't seem to work.

A dire corby male approaches you and prepares to engage you in combat!
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Wed Aug 25, 2021 3:45 pm   
 
It was an example, you have to tailor the pattern to fit your situation.

#TR {(*) approaches you and prepares to engage you in combat!} {t %1}

That will work, but @target will end up as "A dire corby male"
Assuming all mobs follow the same pattern: an adjectives race gender
We can further process it down to what you want, if needed, which seems to be the race.

Code:
#TR {(*) approaches you and prepares to engage you in combat!} {
  $this=%trim(%replace(%replace(%1, "female"), "male"))
  t %word($this, %numwords($this))
  }
_________________
Discord: Shalimarwildcat
Reply with quote
rmorock8869@yahoo.com
Beginner


Joined: 15 May 2018
Posts: 17

PostPosted: Thu Aug 26, 2021 12:18 am   
 
This code appears to work exactly how I was hoping it would. I will do more testing and hopefully make sure it works on others. Thank you so much for your help, it is greatly appreciated
Reply with quote
rmorock8869@yahoo.com
Beginner


Joined: 15 May 2018
Posts: 17

PostPosted: Thu Aug 26, 2021 11:55 pm   
 
So, I did some testing and what I thought would happen...did. If there are multiple things in the room, the target changes to the last thing to *approach*. One issue I see is if someone is invisible, it will say *someone* approaches you. At this point, I have to cast a spell called invisiblity purge which shows their true form. But, once we are in combat the target does not change. Is there a way to include a list of possible targets so when I attack/cast a spell if any of those said names are in the room that are not grouped with me will take the hit?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Fri Aug 27, 2021 2:20 am   
 
Should be easy enough to capture the true form from the spell messaging.
You just need to make a trigger based on that to change the variable value.
_________________
Discord: Shalimarwildcat
Reply with quote
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 167

PostPosted: Fri Aug 27, 2021 2:54 am   
 
you can make use of %ismember as a means to whitelist/blacklist potential targets.

I had/have a setup that uses @whitelist which is made up of 'friends' that might be in a party with me or wont care if I accidentally kill something they are fighting... accidents happen

so using something like #IF (%ismember(@whitelist)) {kill @target}
Reply with quote
rmorock8869@yahoo.com
Beginner


Joined: 15 May 2018
Posts: 17

PostPosted: Sun Aug 29, 2021 12:07 am   
 
That doesn't appear to be working. Is there a specific way to target things in the room even if they don't attack or change into something else?
Reply with quote
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 167

PostPosted: Sun Aug 29, 2021 5:36 pm   
 
Sorry that wasn't a sample on how to do it, but how I used it for my situation... without seeing some in-game output for combat/room it's hard to state anything concrete.
Reply with quote
rmorock8869@yahoo.com
Beginner


Joined: 15 May 2018
Posts: 17

PostPosted: Mon Aug 30, 2021 5:09 pm   
 
I am just wondering if its possible to set up a list (blacklist) where I can add names of whatever creature. I hit one button and if the name is on the (blacklist) then it will attack it. Is that possible
Reply with quote
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 167

PostPosted: Tue Aug 31, 2021 2:54 am   
 
More or less yes that is possible. Without knowing a sample of a room desc with mobs present, I can't really speak to specifics on how to set it up...

When you hit your button to check blacklist, you would need to have a trigger of some sort to capture room mob presence, to then be filtered/compared to the blacklist.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Tue Aug 31, 2021 3:51 pm   
 
//Some code to turn all the mobs in the room into $mobList

#FORALL $moblist {#IF (%ismember(%i, @blackList)) {attack %i}}

You have to populate your lists first though.
_________________
Discord: Shalimarwildcat
Reply with quote
chaossdragon
Apprentice


Joined: 09 Apr 2008
Posts: 167

PostPosted: Tue Aug 31, 2021 11:19 pm   
 
Might want to limit that sample, if you have 2-3 mobs in room that is in your lost you might not want to fight all at same time... mileage may vary.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Tue Aug 31, 2021 11:47 pm   
 
Could always toss a #BREAK command in there and recheck the room after each kill.
_________________
Discord: Shalimarwildcat
Reply with quote
rmorock8869@yahoo.com
Beginner


Joined: 15 May 2018
Posts: 17

PostPosted: Wed Sep 01, 2021 2:15 pm   
 
here is an example of a room with some dummies:

An expansive warehouse
N-An expansive wa E-An expansive wa
A vast yet empty structure, you can see the sagging eaves high above you. The
wood of the walls is both cheap and thin, crusted with salt from breezes off
of the sea. The dirt floor is a cold grey, with the furrows of frequent foot
traffic from days long past worn deep.
A large metal dummy stands here.
A large metal dummy stands here.
A large metal dummy stands here.
A large metal dummy stands here.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Wed Sep 01, 2021 6:08 pm   
 
We really need several different examples, otherwise, we don't know if there is any consistency in how they are displayed or not.

Can I correctly assume you have made a map that follows you around as you move?
That would help a lot for using one of CMUDs fun new commands: #EVENT
But we can still use them even if you don't!

Based on what you have shown:

Code:
#TR {(*) stands here.} {
  #IF (%ismember(%1, @blackList)) {
    mobList=%additem(%1, @mobList)
    #ALARM "waitToKill" +.5 {#RAISE onMobsFound}
    }}


Should at least get you populating a list of things to kill now based on the known list.
The alarm is to slow things down enough (half a second) to allow the trigger to fire more than once and fully compile @mobList before further processing.
And then then your event will look like:

Code:
#EVENT onMobsFound {
  #FORALL @moblist {attack %i}
  mobList=""
  }
_________________
Discord: Shalimarwildcat
Reply with quote
rmorock8869@yahoo.com
Beginner


Joined: 15 May 2018
Posts: 17

PostPosted: Tue Jun 07, 2022 2:25 pm   
 
IF T=@target and I am setting up the blacklist with for the mud to see and attack if its in the room. How do I start the attack? T @blacklist?
kill @blacklist?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Tue Jun 07, 2022 2:57 pm   
 
If its a mob you want to kill, technically, that would be a whitelist.

Blacklists are usually things you ignore.

#TR {({@whitelist}) stands here.} {attack %1}
_________________
Discord: Shalimarwildcat
Reply with quote
rmorock8869@yahoo.com
Beginner


Joined: 15 May 2018
Posts: 17

PostPosted: Tue Jun 07, 2022 4:14 pm   
 
So I have these items in place:



#TR {(*) stands here.} {
#IF (%ismember(%1, @blackList)) {
mobList=%additem(%1, @mobList)
#ALARM "waitToKill" +.5 {#RAISE onMobsFound}
}}

#TR {({@whitelist}) stands here.} {attack %1}


#EVENT onMobsFound {
#FORALL @moblist {attack %i}
mobList=""
}




From the MudL Examples-
A defiant dwarf looks ready to escape from her bonds.
A dummy stands here


Currently I have a macro setup as t @target. So, when I see something I want to kill, just type T NAME, it loads it as my target and my macro is set up as K @target.

What I want to do is setup a list of things to look for, Ie, Orc, Goblin, Dummy, whatever and then I use my macro and it will attack what is in the room if its on the whitelist
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net