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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Tue Aug 31, 2010 11:02 am   

[3.23a-3.24] Disabled Multi-line Trigger Copy or Export (Big problem!)
 
If you have a multi-line trigger and disable it in the editor and then copy it or export it to XML, it will disable all states and you cannot enable them no matter what.

To test this I created a trigger and a second state within 1 lines, and then disabled that trigger in the editor. Next I copied it and below is the XML. It will show the same for exporting.

Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <trigger priority="10" regex="true" enabled="false" copy="yes">
    <pattern>^This is the first line\.$</pattern>
    <trigger type="Within Lines" param="1" regex="true" enabled="false">
      <pattern>^This is the second line\.$</pattern>
    </trigger>
  </trigger>
</cmud>


As you can see it makes all states disabled and the editor will NOT let you enable the other states no matter what even though the trigger itself is enabled. If you enable the trigger, the second state will remain disabled. It doesn't matter if you do it manually in the editor or through code the additional states will remain disabled. If you check to enable the second state in the editor and refresh the checkmark will just disappear and it will remain disabled.

This only happens if you copy or export a disabled multi-line trigger. The additional states remain enabled even though the trigger is disabled until you copy or export it.

Edit: Additionally it seems the problem disappears once you close Cmud and reopen it. After pasting the disabled trigger or importing, if you close out Cmud and then reopen it, you can then enable the additional states. However, this doesn't solve the problem of the additional states being disabled in the first place. They remain disabled even if you enable the trigger. You have to enable each additional state as well.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Aug 31, 2010 4:42 pm   
 
Confirmed and added to bug list.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Wed Sep 01, 2010 9:43 pm   
 
OK, I'm actually having a harder time reproducing this. I guess saying "confirmed" above was a bit premature.

I just opened a blank session and pasted the following code:
Code:
<trigger priority="10" regex="true" enabled="false" id="2">
  <pattern>^This is the first line\.$</pattern>
  <value>fire 1</value>
  <trigger type="Within Lines" param="1" regex="true" enabled="false">
    <pattern>^This is the second line\.$</pattern>
    <value>fire 2</value>
  </trigger>
</trigger>

Then I enabled the main trigger. Then I clicked on the trigger state and enabled that too. In both cases, the line drawn through the trigger name in the tree view on the left disappeared properly.
I then typed:
Code:
#SHOW This is the first line.
#SHOW This is the second line.

and the trigger worked correctly.

I didn't have any problems enabling or disabling the trigger or the individual trigger state. So I'm not sure what's going on, but give it a try in a blank session on your computer and see what you get.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Wed Sep 01, 2010 9:56 pm   
 
Apparently, the missing step is this:

If you select the main trigger and enable it, you cannot enable following states. You have to do it in reverse order in order to enable it (start from the last state and work your way up the list).

This can be problematic if you have a large number of trigger states.

Charneus
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Wed Sep 01, 2010 10:10 pm   
 
Since individual states don't support being disabled anyway, I am changing the next version so that the XML import/export of trigger substates ignores the "enabled" property (and doesn't add it to the XML output). When importing XML it will always set the Enabled flag to True for the substate.

Yes, you will still be able to enable/disable states in the editor...that's hard to change. But at least this issue with the xml import should go away.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Wed Sep 01, 2010 10:19 pm   
 
Quote:
Then I enabled the main trigger. Then I clicked on the trigger state and enabled that too. In both cases, the line drawn through the trigger name in the tree view on the left disappeared properly.


Well I did the same exact steps in an untitled session and it won't enable the second state at all. It is still lined out and the checkmark for enabled just vanishes. I'm just right clicking on the main and then enabling it and then right clicking on the second state and enabling and it will not enable. So I am not sure what is going on. I can't enable the second state no matter what or even through code. Like I said earlier the only way I could manually enable the additional states was to close Cmud and then reopen it and THEN it would let me enable the additional states, but again that doesn't solve the problem of it disabling all the states to begin with.

Edit: Haha well I guess that solves the problem with the additional states being disable in the future (referencing your above post).
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Wed Sep 01, 2010 10:21 pm   
 
How *exactly* are you enabling it? Are you clicking the Enabled checkbox on the far right, or are you right-clicking and selecting Enabled from the menu?

I was using the checkbox.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Wed Sep 01, 2010 10:24 pm   
 
charneus wrote:
Apparently, the missing step is this:

If you select the main trigger and enable it, you cannot enable following states. You have to do it in reverse order in order to enable it (start from the last state and work your way up the list).

This can be problematic if you have a large number of trigger states.

Charneus


Right but that's not what you would ever do anyway. Normally you would give your trigger an ID and then do #T+ trigID to enable the trigger which only enables the main trigger. You would have to give every single state an ID and if you have 3 or 4 additional states, you would end up having to do 3 or 4 commands just to enable the entire multistate trigger so it fires properly.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Wed Sep 01, 2010 10:27 pm   
 
Zugg wrote:
How *exactly* are you enabling it? Are you clicking the Enabled checkbox on the far right, or are you right-clicking and selecting Enabled from the menu?

I was using the checkbox.


I was doing both and neither work. I did the following.

1. Copied what you just posted into an untitled session.
2. Right clicked the main trigger and enabled it.
3. Right clicked the second state to enable it.

The second state will not enable.

Then I tried the same exact steps using the checkbox and it still cannot get the second state to enable.

Edit: When I try to enable the second state the little Fetch arrow button turns yellow but nothing happens. It's still remains disabled and lined out in the tree.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Wed Sep 01, 2010 10:57 pm   
 
It's the right clicking that is doing it. If you just do the checkboxes and never touch the right click option, then it seems to work.

Turns out the right-click option is trying to enable/disable *all* of the states and the main trigger so that they are the same. And that was causing the problem. Anyway, should be working better in 3.25 although it might still be weird if you try and disable a single trigger state.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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