 |
EMG Beginner
Joined: 25 Aug 2001 Posts: 13
|
Posted: Sat Feb 16, 2002 1:13 pm
Targetting problems... |
In my MUD, in order to cast a spell at a specific creature, you must use its individual identifying number, such as 'werewolf1234'. All identifying numbers in a location can be gathered by typing 'info here'. The information is displayed like so:
A fearsome Werewolf is uniquely identified as 'werewolf1234'
A begging bowl is uniquely identified as 'bowl2233'
etc.
At present, my setup will save up to five targets when their numbers are returned by 'info here', like this:
#TRIGGER {*is uniquely identified as '&TempTarget'.} {#Var FDTarget@TargetNumber @TempTarget;#AD TargetNumber 1;#IF (@TargetNumber = 5) {@TargetNumber = 1} {}}
I then have a button which simply starts attacking ('fd@' is an alias which equates to 'cast flamedart at '), like so:
#BUTTON 8 {Flame Dart!} {KillNumber=1;fd@ @fdtarget1}
Since everything is 'balance' and 'focus' dependant in this MUD, I then have two triggers for when to continue:
#TRIGGER {Your mind is now focused.} {#IF (@Fighting="TRUE") {cast flamedart @target} {}}
#TRIGGER {You have regained your balance.} #IF (@Fighting="TRUE") {cast flamedart @target} {}}
When one target dies, and I attempt to attack it again, the text "You can see no <targetname> here to cast your flamedart at." is returned. Therefore, to cycle through targets I have the following:
#TRIGGER {You can see no "*" here to cast your flamedart at.} {#IF (@KillNumber="5") {Fighting=FALSE};#IF (@KillNumber<>"5") {#ADD KillNumber 1;fd@ @{fdtarget@Killnumber}}}
I also have a trigger for each direction (is there a way to represent any direction, rather than have an individual trigger for north, south, east etc?)to clear target information when I move.
This can't be the best way of doing things...and it screws up if I have more than 5 targets. I also want to do two additional things: Firstly, exclude things such as 'bowl', 'chest', 'dead body' etc from targetting. Secondly, I want an option which will *only* target a specific creature from a list, which can be scrolled through by a function key and then the targetted creature is displayed on screen. Eg: <Press F5> "Now Targetting: Werewolf", <Press F5 again> "Now Targetting: Troll", <Press F5 again> "Now Targetting: All Targets".
I think that covers everything...help would be more than welcome - I'm seriously struggling with this. |
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sat Feb 16, 2002 4:35 pm |
You can use the wildcard %t in place of directions in your trigger phrase. Or, you could put all the directions in a stringlist and use that in your trigger. Or, if you usually use the keypad numbers to move around you could just add the command to clear target information to the keypad macros and forget the triggers.
I can't think of anything useful to suggest toward your main questions, but perhaps someone else will.
LightBulb
All scripts untested unless otherwise noted |
|
|
 |
EMG Beginner
Joined: 25 Aug 2001 Posts: 13
|
Posted: Wed Feb 20, 2002 7:49 pm |
And I thought you guys were gurus ;)
Ah well, thanks for the tip *smile* |
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed Feb 20, 2002 11:19 pm |
You aren't getting answers because you are asking for what is essentially impossible. There is no way for zMUD to distinguish between objects and mobs if they have the same structure.
For the first question: "exclude things such as 'bowl', 'chest', 'deadbody', etc." there are two approaches. The first approach is to make a stringlist of all the things you want to exclude, you can then test each item present and exclude the ones in the exclude-list. The second approach is the opposite, make a stringlist of all the things you want to include and then test each item and include only the ones on the include-list. In either case, it's up to you to pick what goes in the list.
A script to check what's present and add the appropriate items to a target-list should be fairly easy. You then just need to write your macro to cycle through the list.
#AL checktargets {#T+ targets;#VAR TargetList {};#VAR NextTarget 1;#VAR Target {};info here}
#CLASS targets
#TR {(%w)(%d)} {#IF (%ismember(%1,@IncludeList)) {#ADDITEM TargetList {%1%2}}
#TR {end of info here) {#T- targets}
#CLASS 0
#KEY F5 {#IF (%numitems(@TargetList) >= @NextTarget) {#VAR Target %item(@TargetList,@NextTarget);#SHOW Now Targetting %item(@TargetList,@NextTarget);#ADD NextTarget 1} {#VAR Target {All Targets};#SHOW Now Targetting~: All Targets}
And you can take your sarcasm and put it where your initiative should be. If YOU couldn't figure out an answer, don't smirk at anyone else because they didn't.
LightBulb
All scripts untested unless otherwise noted |
|
|
 |
TonDiening GURU

Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Wed Feb 20, 2002 11:40 pm |
I've found that to distinguish between
a mobile and an object by a bot script is to
figure out commands that work for one and
not the other.
Can you only weigh objects or can you
only "size up" mobile oponents etc..
You can then add them to variables for the
human to look at later or do more tests
to see what you should do with that mobile
or object.
TonDiening
Beta Upgrading to 6.26 |
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5187
|
Posted: Thu Feb 21, 2002 2:13 am |
First get rid of the @ on the end of your alias, special characters in the name of a variable, class, alias, or anyother setting tend to cause problems.
#MobList {}
#TRIGGER {*is uniquely identified as '&TempTarget'.} {#ADDITEM MobList @TempTarget}
You will have to find an appropiate trigger to activate the next alias, if you had provided more info I might have written it all for you.
#VAR DontAttack {bowl|chest|deadbody}
#VAR TempCounter
#AL CleanMobList {TempCounter=1;#WHILE (@TempCounter<=%numitems(@DontAttack) {#FORALL @MobList {#IF (%begins(%i,%item(@DontAttack,@TempCounter))) {#DELITEM MobList %i}}#ADD TempCounter 1}}
That give you a complete moblist with the ones you want removed. You can add anything you want to don't attack ofcourse, also you didn't give any example for dead body so i have no clue if that is the right format.
Someone already took care of your direction triggers, the new one would just have to set the moblist="". Next your attacks...
#BUTTON 8 {Flame Dart:%if(@SelectedTarget,%leftback(%item(@MobList,@SelectedTarget),4),All!)} {KillNumber=%if(@SelectedTarget,@SelectedTarget,1);fd %item(@MobList,@KillNumber)}
I put the target display into the button, cause I am lazy. When you make kill just use the item thing above instead of fdtargetX where X was @killnumber, indirects make for a bloody mess.
#TRIGGER {You can see no "*" here to cast your flamedart at.} {#DELITEM MobList %item(@MobList,@KillNumber);#IF (@SelectedTarget) {KillNumber=1;SelectedTarget=0} {#IF (@KillNumber<=%numitems(@MobList)) {fd %item(@MobList,@KillNumber)}}}
I didn't include the checks and set of Fighting since I don't have any idea where you do some of that, add it as necessary.
Now the actually target selection routine:
#VAR SelectedTarget {0}
#KEY F5 {#IF (@SelectedTarget<%numitems(@MobList)) {#ADD SelectedTarget 1} {SelectedTarget=0}}
Lightbulb has some good points, so make sure to mix everything together. Just don't make it so none of the guru's can understand anything about what you did, then we will all get pissed at you and not help anymore. Maybe that is just me though, I give no guarantees about typos and such since I am drinking heavily while writing this. |
|
|
 |
EMG Beginner
Joined: 25 Aug 2001 Posts: 13
|
Posted: Mon Mar 04, 2002 1:02 pm |
Erk, seems I should apologise.
My previous comment was not intented to be taken seriously, if I had wished otherwise I'd have replaced the smilie with a full-stop, and left it at that. As for my initiative, I'm an incompetant scripter, and have no wish to pretend otherise, hence my seeking help here from people who clearly know what they're doing.
Thanks for the help, I really *am* appreciative, apologees for conveying a contrary impression. |
|
|
 |
|
|
|
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
|
|