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


Joined: 17 May 2024
Posts: 17

PostPosted: Fri Jul 05, 2024 9:54 am   

Button to enable/disable a trigger
 
I have a trigger for my healer which will do a "party check" command for each "new round" of combat
so that I can know who to heal and not.

However, this "party check" command is spammy when I'm not playing my healer, and thus I want to create a button which turns this trigger on and off.

Trigger *** NEW ROUND *** TODO party status percent

This trigger has ID 32, can i use this in my button to toggle it on and off? Or maybe I'm forced to create/destroy the trigger with the button?

Any examples of how this could be implemented would be greatly appreciated
Reply with quote
Pauley
Beginner


Joined: 17 May 2024
Posts: 17

PostPosted: Fri Jul 05, 2024 2:38 pm   Re: Button to enable/disable a trigger
 
Pauley wrote:
I have a trigger for my healer which will do a "party check" command for each "new round" of combat
so that I can know who to heal and not.

However, this "party check" command is spammy when I'm not playing my healer, and thus I want to create a button which turns this trigger on and off.

Trigger *** NEW ROUND *** TODO party status percent

This trigger has ID 32, can i use this in my button to toggle it on and off? Or maybe I'm forced to create/destroy the trigger with the button?

Any examples of how this could be implemented would be greatly appreciated



Somewhat of a workaround, but it works - just make the same trigger for both button toggles, just that one state does something and the other state still triggers but does nothing.
Reply with quote
shalimar
GURU


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

PostPosted: Sun Jul 07, 2024 11:35 pm   
 
You can do that.
You need to give the trigger an ID of "PartyChecker"
then your button will do the following:

Code:
#SWITCH (%trigger(PartyChecker))
  (0) {#T+ PartyChecker}
  (1) {#T- PartyChecker}
_________________
Discord: Shalimarwildcat
Reply with quote
Pauley
Beginner


Joined: 17 May 2024
Posts: 17

PostPosted: Mon Jul 08, 2024 9:51 am   
 
shalimar wrote:
You can do that.
You need to give the trigger an ID of "PartyChecker"
then your button will do the following:

Code:
#SWITCH (%trigger(PartyChecker))
  (0) {#T+ PartyChecker}
  (1) {#T- PartyChecker}


Ah yes, I read about this way of switching. I found the trigger ID in the xml part in the GUI, how would I go about giving it its own ID ?
Reply with quote
shalimar
GURU


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

PostPosted: Mon Jul 08, 2024 10:18 am   
 
You can either edit the xml directly, id="PartyChecker"

Or you can click the 'More' button at the bottom of the package editor window and just fill in the panel labeled ID.
_________________
Discord: Shalimarwildcat
Reply with quote
Pauley
Beginner


Joined: 17 May 2024
Posts: 17

PostPosted: Sun Aug 04, 2024 10:52 am   
 
shalimar wrote:
You can either edit the xml directly, id="PartyChecker"

Or you can click the 'More' button at the bottom of the package editor window and just fill in the panel labeled ID.


I cannot get this button to work. I make a simple push button and put the code into the script text field.
for testing purposes i changed the command to #ECHO commands to give me a visible output.
pushing the button does exactly nothing.


Code:
#SWITCH (%trigger(475))
 (0) {#ECHO test}
 (1) {#ECHO TESTING}


when i disable the trigger this should output "test" and when i enable the trigger it should output "TESTING" (when pushing the button)

The client is behaving as if the code in that button doesn't exist
(it was the same with the original quoted code, it didn't turn the trigger on or off)

screenshot:
https://i.ibb.co/Xz0yszp/Untitled.png
Reply with quote
shalimar
GURU


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

PostPosted: Mon Aug 05, 2024 12:06 pm   
 
The ID needs to start with a letter is the issue here, fully numeric IDs are not supported.
_________________
Discord: Shalimarwildcat
Reply with quote
Pauley
Beginner


Joined: 17 May 2024
Posts: 17

PostPosted: Sun Aug 11, 2024 4:03 pm   
 
shalimar wrote:
The ID needs to start with a letter is the issue here, fully numeric IDs are not supported.


Aaah, that makes sense - i was using the default ID assigned by cmud upon creating the trigger
Reply with quote
shalimar
GURU


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

PostPosted: Sat Aug 31, 2024 11:20 am   
 
The numeric ID is actually the priority in which settings execute, should any given thing cause several settings to go off simultaneously. (lower goes first)
I have no idea why it isn't labeled as such in the XML.
_________________
Discord: Shalimarwildcat
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