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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
aliensurfer
Beginner


Joined: 11 Apr 2005
Posts: 17

PostPosted: Mon Apr 11, 2005 9:50 am   

Auto-Targetting Help please..
 
Firstly, I'm new to this, I have read through to documention and I have searched old articles for any help. I seem to be getting halfway there, but am struggling with the final hurdle. Any help would be appriciated, Sorry if it has been covered at length before.

I'm having trouble working out a targetting system within my MUD. Here is what I have and would like to do:

I have an alias b - Bop @player, and @player is set in all my combat aliases.
I have an alias t - #va player

When I type t Bob at the command line, @player becomes Bob and pressing b will bop him.

Fine, thats super.

This works will for Mobs and maybe PvP with players with shorts name, but typing "t ickcikyfatang" is a bit of a pain, especially in large combat situations like wars or Rampages

What I would like to do is set an automatic targetting system based on who enters the room, but allows me manual override.

So:

Currently, Bob is my target.

If the text: "Harry enters from the east" appears, i would like to enter the word Harry as the threat, but assign a single keystroke to make him my target. If I'm fighting Bob and Harry runs through the room, I don't want to be targetting Harry, as I would have to then manually target Bob again. If I have Bob as a target from an old fight and Harry appears and is a threat, I would like to target him with one keystroke (an alias of my choosing)


I was thinking it was best to use 2 variables. Keeping the manual targetting the same, ie, no changes.

But for the auto targetting try something like.

Harry enters from the east

harry = @threat

alias a (or whatever, maybe even CTRL + A to stop accidental Targetting...? ) will then allow me to target the threat into the @player Variable


Would something like this work?:

(%w) enters from the
or
(%w), riding a *, enters from the (Is this * bad?)
or
(%w) decends from above

#va threat (%w)

#alias a @threat = player


So, "t Bob" will still work, but is harry enters the room "a" will target him in all my combat aliases.


Hope that makes sense!

AS
Reply with quote
DeReP
Adept


Joined: 14 Jun 2003
Posts: 222
Location: Chile

PostPosted: Mon Apr 11, 2005 3:31 pm   
 
As far as I can tell you need to store the new name in a variable, but you dont want the other name to be erased is that right?
Well I think it shouldnt be much of a problem Using a string list and some other commands in it.

So far you have your alias to targer the player with the bop command
I would change that to
#ALIAS b {Bop %item(@player,1)}
this will allow you to select the first name stored in the list variable we are going to make now (wich will allow you to store the other character(s) name(s))

now we do the trigger and the alias to add the new threat

#TRIGGER {(%w) enters from the} {#VAR threat %1}
#ALIAS a {#VAR player %push(@threat,@player);#VAR threat ""}

Now entering "a" will add the new target to the beggining of your list, the will clean the variable @threat to avoid addint it again.

now the alias B you already have, will target the first item in the @player list, wich will be the new target you pushed with the "a" alias
Ok so now the new player has fled or something, and you wanna get back to the one character that was before it in the list

#ALIAS c {#ECHO %pop(player) has been removed from targets.}

this new alias will get rid of the first player stored in the @player list, so now the alias "b" is targetting the one before it.

Hope this helps you in some way, and of corse alias names are just suggested
Reply with quote
aliensurfer
Beginner


Joined: 11 Apr 2005
Posts: 17

PostPosted: Mon Apr 11, 2005 3:35 pm   
 
Thank you!, that sounds about right, I'll give it a whirl.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
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