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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Sutex-Kindred
Apprentice


Joined: 26 Aug 2009
Posts: 141

PostPosted: Fri Mar 26, 2021 8:02 am   

Trail Script - syntax issues
 
Updating my Trail Script
http://forums.zuggsoft.com/forums/viewtopic.php?t=33897
Above has been tweaked, since that post. Yet still %lastcom, sometimes does not get the direction correct

Below, is my new attempt. Opens the door with %lastcom2. And then #CON if That's not a direction comes up in 5 lines and tries %lastcom3
The 2nd #CON (a direction) {#T+ NoDir} Turns on That's not a direction trigger and if it fires, turns off my Trail Class, so not looping at a door that %lastcom2 or %lastcom3 can't open.

*note That's not a direction has problems with the not inside the () with #CON


The (%w) seems to be closed
Code:

#VAR door %1
open @door %lastcom2
#COND {a direction} {open @door %lastcom3} {Within|Param=5}
#COND (a direction) {#T+ NoDir}

#ALARM "trail" {+2}
trail @trailmob
_________________
Entropy rules

Last edited by Sutex-Kindred on Sat Mar 27, 2021 9:58 pm; edited 1 time in total
Reply with quote
hpoonis2010
Adept


Joined: 18 Jun 2019
Posts: 279

PostPosted: Fri Mar 26, 2021 5:38 pm   
 
One assumes you changed the default mapper door name from 'door'?

By the way...what are %lastcom2 and %lastcom3? I thought % was for cmud internal functions.

You like ALARMs.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Fri Mar 26, 2021 9:01 pm   
 
Some of those functions are to serve as variables.
In this case: Second to last command and third to last command, as defined in the 'predefined variables' help file.
I think you have to use the search feature after opening up #HELP.
_________________
Discord: Shalimarwildcat
Reply with quote
Sutex-Kindred
Apprentice


Joined: 26 Aug 2009
Posts: 141

PostPosted: Fri Mar 26, 2021 10:59 pm   
 
I read help, which is no help

While knowledge about ALARMS, % was for cmud internal functions, and 'predefined variables'

I'm once again reminded why it is I spend long periods away from muddling , when the basics elude me.
_________________
Entropy rules
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Sat Mar 27, 2021 4:09 pm   
 
First off, #COND is used for creating a trigger state.
It should not be used like this.
The issue is that there was no #TRIGGER, #ALARM, #ONINPUT, or any of the various other forms declared before it in the script, so CMUD may not always have a valid target in which trigger is getting the new state.
(By default they go to the last trigger defined.)

Second, you should be using {curly brackets}.
_________________
Discord: Shalimarwildcat
Reply with quote
Sutex-Kindred
Apprentice


Joined: 26 Aug 2009
Posts: 141

PostPosted: Sat Mar 27, 2021 9:55 pm   
 
The (%w) seems to be closed in BOLD AT THE TOP is the Trigger state

This is a Trigger state "a direction"
_________________
Entropy rules
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Sun Mar 28, 2021 2:48 pm   
 
That "seems to be closed" is a trigger state is beside the point really.

I know that "a direction" is supposed to be a trigger state, this isn't how you make that happen.

Code:
#TR {some trigger} {does stuff}
#COND {The (%w) seems to be closed} {
  #VAR door %1
  open @door %lastcom2
  #ALARM "trail" {+2} {trail @trailmob}
  }
#COND {a direction} {open @door %lastcom3} {Within|Param=5}
#COND {a direction} {#T+ NoDir}


This is what it sounds like you want.
_________________
Discord: Shalimarwildcat
Reply with quote
Sutex-Kindred
Apprentice


Joined: 26 Aug 2009
Posts: 141

PostPosted: Sun Mar 28, 2021 4:16 pm   
 
This is First The (%w) seems to be closed
#VAR door %1
open @door %lastcom2
This is 2nd #COND {a direction} {open @door %lastcom3} {Within|Param=5}
This is 3rd #COND (a direction) {#T+ NoDir}

#ALARM "trail" {+2}
trail @trailmob


So what is your example, just how NOT to do?

{Within|Param=5} is used with the reparse.

So at a door it's closed, the trigger fires, the trail is still running but the %lastcom did not work, so looping at the door. Reparse, fires the trigger again but this time it goes to COND 2 ect.
_________________
Entropy rules
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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