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
Benjaminaott
Newbie


Joined: 13 May 2003
Posts: 1
Location: USA

PostPosted: Tue May 13, 2003 2:25 am   

trigger help
 
In my mud I want to pick up objects off the ground known as artifacts. I've made a stringlist of the artifact names the problem is recognizing when they are on the ground to be picked up. Here is a sample room description with an artifact on the ground:

Rue des Orhe.
You are able to see by the light of the lantern. The Rue des Orhe continues to
the east and west. You could progress eastwards, westwards. In your immediate
vicinity you see a bottle of cognac.

What I need to do is test the string between "vicinity you see" and "." against my artifact list but there are more complicated cases. For example sometimes the line breaks within the artifact name and sometimes there are multiple objects on the ground. Here is an example of the latter:
In your immediate vicinity you see a young black horse and a bottle of cognac.

In that example the first object is not an artifact but as you can imagine it might well be or there may even be more than 2 on the ground.

Since there are so many cases I'm not sure of how to make triggers to account for them all. I've made one that works in the simplest case where everything is on one line and there is only one artifact but with everything else I've had no luck. Can anyone help me with this?
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Sun Jun 15, 2003 6:56 pm   
 
Please list more cases so that we can better help you.

#trigger {In your immediate
vicinity you see (*).} {#var newitem "";#var newitem "%1";#var founditem "";#var founditem %ismember(@newitem,@stringlist);#echo you found this~: %item(@stringlist,@founditem)}

if like you said it has more than one item try searcing the finished scripts for the one that allows you to capture multiple lines.

Then use the word "and" as a delimiter like so:

%replace(@newitem,"and","|") then make it loop through this list checking it against you @stringlist.

Any questions?

megamog75
I will do this.Nothing in my life matters except this.No moment in my life exists except this moment.I am born in this moment, and if I fail, I will die in this moment.
-Raistlin Majere
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sun Jun 15, 2003 7:03 pm   
 
You might want to try adapting the script I made for Babyl recently to rearrange every part of a room description. It would allow you to put the items on seperate lines, or parse out the right sentence more readily.

http://www.zuggsoft.com/forum/topic.asp?TOPIC_ID=12005&FORUM_ID=7&CAT_ID=1&Topic_Title=Achaea+Auto%2DMapping+Impossible%3F&Forum_Title=zMUD+General+Discussion
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