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
Myrddraal
Beginner


Joined: 25 Jan 2003
Posts: 14
Location: Australia

PostPosted: Tue Sep 30, 2003 6:01 pm   

Trigger Trouble
 
Hi,

got a few problems with a set of triggers that i'm trying to use for harvesting, in achaea.

Example Text:

A bloodroot plant (bloodroot) 15 left.

your only allowed to harvest the herbs down to 15, so the trigger i use is:

Pattern:
(*)bloodroot(*)%s%1 left.

Value:
#if (%1 < 11) {harnumber = 0}
#if (%1 > 10) {har bloodroot (%1-10)}

and this works fine, aslong as there is only one type of plant in the area. The problem comes when there is more than one, so say 2 or three, which look like this:

Irid moss (irid moss) 15 left.
A bloodroot plant (bloodroot) 10 left.
A valerian plant (valerian) 15 left.

or this

Irid moss (irid moss) 15 left.
A bloodroot plant (bloodroot) 10 left.

what will happen is that it will trigger to harvest the moss, but then also triggers to not harvest the bloodroot, setting the harnumber to 0, and only ends up harvesting 1 moss, instead of 5. If it was like this:

Irid moss (irid moss) 10 left.
A bloodroot plant (bloodroot) 15 left.

There wouldn't be any problems, because it would be 0 then 5. Anyone have any ideas on hos to make it harvest the first trigger it hits, before moving onto any others?

Hope you can all understand what i'm going on about :)

Thanks heaps
Reply with quote
StackAdder
Wanderer


Joined: 30 Sep 2003
Posts: 77
Location: United Kingdom

PostPosted: Tue Sep 30, 2003 6:06 pm   
 
Well as you are using literal herb names, I would guess using vars for each of them would overcome the difficulty (though I am not sure why it is happening...)
Reply with quote
user0101
Apprentice


Joined: 01 Aug 2003
Posts: 100
Location: USA

PostPosted: Wed Oct 01, 2003 6:42 am   
 
If there is a limit on harvesting X amount of herbs per Harvest (which I think is the case), copy and paste this:

#ALIAS HarvestNow {#t+ HARVESTING;#t- HARVESTING|HarvestTrigs;plants}

Then copy all this:

#CLASS HARVESTING
#VAR ExcessHerb 0
#VAR HarAmount 0
#VAR CurrentHerb %null
#ALIAS ExcessHerb {#math ExcessHerb (@haramount-10)}
#ALIAS PlantValues {#if (@excessherb > 10) {excessherb;haramount=10};#if (@excessherb <= 10) {haramount=@excessherb}}
#TRIGGER {^The following plants are growing in this room:$} {#T+ HarvestTrigs}
#TRIGGER {You have finished harvesting or You have recovered Balance etc} {#if (@excessherb > 0) {plantvalues;harvest @currentherb @haramount} {plants}}
#TRIGGER {^* ~((herbnamehere)~) %s (%d) left.$} {#if (%2>15) {haramount=%2;#if (%2 > 10) {#t- HarvestTrigs;CurrentHerb=herbnamehere;excessherb;haramount=10};harvest @currentherb @haramount}} "HARVESTING|HarvestTrigs"
#CLASS 0

You can only harvest by using the abbreviated herb name if it is 2 words, correct? As in, HARVEST RED ELM would not work.. whereas HARVEST ELM would. Again, the red text needs to be changed - I took a guess at 10 plants per harvest. Finishing the harvest/recovering balance needs to be changed, I don't know what message you receive when you have finished harvesting and are able to harvest another batch of plants. The third trigger needs to be copied, and modified for each type of plant you wish to harvest.

Type HARVESTNOW, and let it run. Untested.

Phew, noticed a lot of mistakes. I'm tired, if you get any errors or anything let me know. -passes out-
Reply with quote
Backu
Novice


Joined: 24 Feb 2003
Posts: 36
Location: USA

PostPosted: Thu Oct 02, 2003 4:41 am   
 
Little more clarification please, are you trying to harvest only "A bloodroot plant (bloodroot) 15 left." or harvest herbs with "(bloodroot)"?
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