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
dvgalius2002@yahoo.com
Beginner


Joined: 01 Aug 2006
Posts: 21

PostPosted: Sun Oct 22, 2006 3:07 am   

identify trigger
 
Hello everyone, I'm trying to make an identify trigger to relay the statistics of an object to the whole group. Now I know I could make seperate triggers for each affect and it tell the group each one individually, but I was wondering if there was a way to capture each one and relay them to the group all at once.

Here is an example of a piece being identified:

You feel informed:
Object 'a gold braid', Item type: Armor
It can be worn: Inventory Arms
Item is: NOBITS
Weight: 5, Value: 8500, Rent: 850
AC-apply is 8
Quality: INDESTRUCTABLE
Can affect you as :
Affects: Hitpoints by 13
Affects: Dexterity by 8
Affects: Combat Ability by 2

Basically I just want to be able to tell the group in one line, Affects Hitpoints by 12, Dex by 8, and Combat by 2, rather then multiple lines for each affect. Thank you.
Reply with quote
dvgalius2002@yahoo.com
Beginner


Joined: 01 Aug 2006
Posts: 21

PostPosted: Sun Oct 22, 2006 10:31 pm   
 
anyone know?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Oct 23, 2006 2:13 am   
 
What comes after the last Affects: line? Since I assume that the number of Affects: lines will vary from item to item, you're going to require either three separate triggers or one single-state trigger and one multi-state trigger with three states:

#trigger {Object ~'(*)~'} {Item = "%1"}
#condition {Can affect you as:} {#T+ tItemAffects;Affects = ""}
#condition {whatever line comes next} {#T- tItemAffects;grouptell @Item %expandlist(@Affects,",")}

#trigger "tItemAffects" {Affects: ([%a%s])} {#additem Affects "%1"}
_________________
EDIT: I didn't like my old signature
Reply with quote
dvgalius2002@yahoo.com
Beginner


Joined: 01 Aug 2006
Posts: 21

PostPosted: Mon Oct 23, 2006 2:30 am   
 
Yes the number of affects vary from item to item, but after the affects is nothing. I tried using these triggers with no success.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Oct 23, 2006 4:38 am   
 
No prompt or anything? Is there at least a blank line?
_________________
EDIT: I didn't like my old signature
Reply with quote
dvgalius2002@yahoo.com
Beginner


Joined: 01 Aug 2006
Posts: 21

PostPosted: Mon Oct 23, 2006 4:52 am   
 
Ah yeah after I scan an item I of course can see my prompt. Sorry about that.
Reply with quote
dvgalius2002@yahoo.com
Beginner


Joined: 01 Aug 2006
Posts: 21

PostPosted: Mon Oct 23, 2006 5:09 am   
 
1097(1249)hitp 1561(1711)mana 166(283)move> This is what my prompt basically looks like
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Oct 23, 2006 6:09 am   
 
That is what you'd match on for the third state (that's the second #CONDITION). The pattern should be easy to figure out--~ in front of each of the parentheses, %d for the numbers, and so on. Don't forget to set the Trigger on Prompt option, too.
_________________
EDIT: I didn't like my old signature
Reply with quote
dvgalius2002@yahoo.com
Beginner


Joined: 01 Aug 2006
Posts: 21

PostPosted: Mon Oct 23, 2006 2:05 pm   
 
still can't seem to get it to work heres what I have

#trigger {Object ~'(*)~'} {Item = "%1"}
#condition {Can affect you as:} {#T+ tItemAffects;Affects = ""}
#condition {(%d)~((%d)~)hitp (%d)~((%d)~)mana (%d)~((%d)~)move~> } {#T- tItemAffects;grouptell @Item %expandlist(@Affects,",")}
#trigger "tItemAffects" {Affects: ([%a%s])} {#additem Affects "%1"}

I set it to trigger on prompt, but still nothings happening when I identify.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Oct 23, 2006 10:46 pm   
 
I don't suppose you checked Trigger on Prompt for ALL the triggers and conditions, did you? It occurs to me that I was a little unclear with that, as I meant only to check it for the prompt condition. Everything else should stay on Trigger on Newline.

Beyond that, you can use #SHOW or #SAY to verify that each trigger or condtion is firing.
_________________
EDIT: I didn't like my old signature
Reply with quote
dvgalius2002@yahoo.com
Beginner


Joined: 01 Aug 2006
Posts: 21

PostPosted: Tue Oct 24, 2006 3:54 am   
 
ah ok I've seen to have gotten it to work, just have one little problem whenever an item gives a negative affect (i.e. Affects: Wisdom by -3) all it says is Wisdom by (blank). Any idea how to fix that?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue Oct 24, 2006 4:24 am   
 
just add in - to the range pattern used in the tItemAffects trigger -- [%a%s-]

Ditto for any other symbolic characters that appear
_________________
EDIT: I didn't like my old signature
Reply with quote
dvgalius2002@yahoo.com
Beginner


Joined: 01 Aug 2006
Posts: 21

PostPosted: Tue Oct 24, 2006 5:38 am   
 
Ok got that to work, thanks. Now just one more dumb question for all you smart people and I'll be happy. =) These are the triggers I have so far:

#trigger {Object ~'(*)~'} {Item = "%1"}
#condition {Can affect you as:} {#T+ tItemAffects;Affects = ""}
#condition {(%d)~((%d)~)hitp (%d)~((%d)~)mana (%d)~((%d)~)move~> } {#T- tItemAffects;grouptell @Item %expandlist(@Affects,",")}
#trigger "tItemAffects" {Affects: ([%a%s-])} {#additem Affects "%1"}

Now if I wanted to add the item level and the ac it applys how would I do that? Heres what that looks like on identify

You feel informed:
Object 'a lizard's smoldering cap', Item type: Armor
It can be worn: Inventory Head
Item is: Magic
Weight: 1, Value: 29100, Rent: 2910
Minimum Level: 37
AC-apply is 2
Quality: INDESTRUCTABLE
Can affect you as :
Affects: Wisdom by 4
Affects: Hitroll by 1
Affects: Combat Ability by 1
Affects: Mana by 18

I just want to add the Minimun Level line and the AC-apply line. Again thank you Matt for all this help. =)
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Tue Oct 24, 2006 3:58 pm   
 
Just make a new trigger similar to.

#trigger "tItemAffects" {Affects: ([%a%s-])} {#additem Affects "%1"}

Only matching, (AC-apply is [%a-])
instead of, Affects: ([%a%s-]), and of course Do the same thing for item level.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
dvgalius2002@yahoo.com
Beginner


Joined: 01 Aug 2006
Posts: 21

PostPosted: Wed Oct 25, 2006 3:42 am   
 
#trigger {Object ~'(*)~'} {Item = "%1"}
#condition {Can affect you as :} {#T+ tItemAffects;Affects = ""}
#condition {~<(%d)~((%d)~)hitp (%d)~((%d)~)mana (%d)~((%d)~)move~>~((%d) EXP~)} {#T- tItemAffects;gt %expandlist(@Affects,@Ac"|")}
#trigger "tItemAffects" {Affects: ([%a%s-])} {#additem Affects "%1"}
#trigger "tItemAffects" {AC-apply is ([%a-])} {#additem Ac "%1"}

I tried something like that but it doesn't work, suggestions?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Wed Oct 25, 2006 4:01 am   
 
Unless the AC, Level, and whatever else you'd want to add doesn't appear for all items, I would suggest forgoing separate triggers and simply add in #CONDITIONs in the appropriate places. The easiest way to do this is in the States tab for the multi-state trigger I provided. Because these are in fixed places and thus can be part of the multi-state trigger, you wouldn't necessarily have to save the info to a variable first:

#trigger {Object ~'(*)~'} {Item = "%1"}
#condition {Minimum Level: (%d)} {}
#condition {Can affect you as:} {#T+ tItemAffects;Affects = ""}
#condition {(%d)~((%d)~)hitp (%d)~((%d)~)mana (%d)~((%d)~)move~> } {#T- tItemAffects;grouptell @Item MinLvl~: %t2 Affects~: %expandlist(@Affects,",")}
#trigger "tItemAffects" {Affects: ([%a%s-])} {#additem Affects "%1"}

The AC would appear after the bold part, and would correspond to %t3.
_________________
EDIT: I didn't like my old signature
Reply with quote
dvgalius2002@yahoo.com
Beginner


Joined: 01 Aug 2006
Posts: 21

PostPosted: Wed Oct 25, 2006 5:13 am   
 
Thanks Matt, that way works. However I've noticed that when a certain object doesn't have a Minimum level (since not all do) the trigger doesn't fire, is there a simple way to fix this?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Wed Oct 25, 2006 10:27 pm   
 
You could try changing the condition type to something like duration or withinlines. These two types will invalidate the current trigger condition if it's not found within the specified parameters so that it doesn't just hang waiting for something that never comes, but I'm not entirely sure if it continues on with subsequent conditions or simply resets the trigger entirely (the latter will make it so that subsequent conditions never match.)

If the latter happens, you'll just have to remove that #CONDITION and convert it to a #TRIGGER.
_________________
EDIT: I didn't like my old signature
Reply with quote
dvgalius2002@yahoo.com
Beginner


Joined: 01 Aug 2006
Posts: 21

PostPosted: Thu Oct 26, 2006 5:34 am   
 
when I change the condition to duration or within lines the trigger fires but it makes up a huge number for minlevel in replace of nothing. how would the trigger look like?
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Thu Oct 26, 2006 2:38 pm   
 
Because you are just telling a group of friends this information and throwing it away, there is no reason to store it in a seperate variable.

You are using the expandlist command improperly and using a different variable in your example.

%expandlist(@Affects,",")
Is the correct syntax. What you are doing here is telling zmud that you want to see the variable list named Affects with the comma as your seperator.

%expandlist(@Affects,@Ac"|")
Here you have told zmud that you want to see the Affects varable list with whatever is inside your Ac variable list and the pipe as your seperator. This under extremely rare circumstances actually output something comprehensable. But isn't what you want i'm sure.

Try these.

Code:
#trigger {Object ~'(*)~'} {Item = "%1"}
#condition {Can affect you as :} {#T+ tItemAffects;Affects = ""}
#condition {~<(%d)~((%d)~)hitp (%d)~((%d)~)mana (%d)~((%d)~)move~>~((%d) EXP~)} {#T- tItemAffects;gt %expandlist(@Affects,", ")}
#trigger "tItemAffects" {Affects: ([%a%s-])} {#additem Affects "%1"}
#trigger "tItemAffects" {(AC-apply is [%a%s-])} {#additem Affects "%1"} }

I put the whole line "AC-apply is whatever" into the Affects variable list so that you only have to expand one list in your tell to your friends.
This is untested *posting from work* but it is simple enough code that it should work. Good luck!
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
dvgalius2002@yahoo.com
Beginner


Joined: 01 Aug 2006
Posts: 21

PostPosted: Thu Oct 26, 2006 4:49 pm   
 
Edited.


Last edited by dvgalius2002@yahoo.com on Fri Oct 27, 2006 3:17 am; edited 1 time in total
Reply with quote
dvgalius2002@yahoo.com
Beginner


Joined: 01 Aug 2006
Posts: 21

PostPosted: Fri Oct 27, 2006 3:16 am   
 
actually I might have posted too soon. It seems whenever I add a trigger such as this:

#trigger "tItemAffects" {(AC-apply is [%a%s-])} {#additem Affects "%1"}

For ac level it seems to replace the old one for affects which is this:

#trigger "tItemAffects" {Affects: ([%a%s-])} {#additem Affects "%1"}

I tried changing ttemAffects to another name but then the trigger doesnt work. Sorry for this guys...
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Fri Oct 27, 2006 3:52 am   
 
Sorry I forgot to add that you need to make sure that your second trigger is turned on and off.

#T- tItemAffects
Turns off your first trigger
#trigger "tItemAffects" {Affects: ([%a%s-])} {#additem Affects "%1"}

So add a line for the other trigger to turn off the second trigger.
#T- tItemAffects2
#trigger "tItemAffects2" {(AC-apply is [%a%s-])} {#additem Affects "%1"}

You get this.
#condition {~<(%d)~((%d)~)hitp (%d)~((%d)~)mana (%d)~((%d)~)move~>~((%d) EXP~)} {#T- tItemAffects;#T- tItemAffects2;gt %expandlist(@Affects,", ")}


And of course you need to make sure they are both turned on.

#T+ tItemAffects
#T+ tItemAffects2

#condition {Can affect you as :} {#T+ tItemAffects;#T+ tItemAffects2;Affects = ""}

I'm off to bed. Good luck.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
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