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: 140

PostPosted: Mon Mar 22, 2021 7:18 am   

Switch casting?
 
Idea is, if in a group and someone cast armageddon. Then Zarlix will cast armageddon. 2 seconds later.
After that it depends who is casting out of the four Characters as to who fires next. Since the ^(%w) changes to one of their names.

I have a exit solution, with, You lost your concentration trying to cast armageddon!


^(%w) utters the words, 'armageddon'.

Code:

#SWITCH (%1="Halix") {#ALARM +2, Sutex: c 'arma'}
 (%1="Zarlix") {#ALARM +2, Karlix: c 'arma'}
 (%1="Karlix") {#ALARM +2, Zarlix: c 'arma'}
 (%1="Sutex") {#ALARM +2, Halix: c 'arma'}
 {#ALARM +2, Zarlix: c 'arma'}


You lost your concentration trying to cast armageddon!
Code:

c 'arma'
#T- ArmExit;
#ALARM "Armageddon" +12 {#T+ ArmExit}

*Note looking for away to test this with the editor or debug and its not clear how or if that's possible
_________________
Entropy rules
Reply with quote
hpoonis2010
Apprentice


Joined: 18 Jun 2019
Posts: 188

PostPosted: Mon Mar 22, 2021 9:57 am   
 
Put a message statement into your ArmExit disable script.
Reply with quote
Sutex-Kindred
Apprentice


Joined: 26 Aug 2009
Posts: 140

PostPosted: Mon Mar 22, 2021 10:01 am   
 
Ok, Put a message statement into your ArmExit disable script.

Not sure what you mean an Echo to screen? And how's the syntax of the Switch?, about to test it in game.
_________________
Entropy rules
Reply with quote
shalimar
GURU


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

PostPosted: Mon Mar 22, 2021 11:17 am   
 
You could just give each character its own copycat Variable and do something like:

#TR {^{@copycat} utters the words, 'armageddon'.} {c 'arma'}

Then only the character whose personal @copycat variable matches the name of the caster should be attempting to cast next.
_________________
Discord: Shalimar#3679
Reply with quote
Sutex-Kindred
Apprentice


Joined: 26 Aug 2009
Posts: 140

PostPosted: Mon Mar 22, 2021 11:30 am   
 
So cool; lol


This is my effort and its making 400+ in number the #ALARM in each Characters pkg;
like this: trigger Alarm1641" +2, Zarlix: c 'arma'

Trigger "ArmExit" {(%w) utters the words, 'armageddon'|'abrawitommab'.}
#SWITCH (%1 = "Halix") {#ALARM +2, S: c 'arma'}
(%1 = "Zarlix") {#ALARM +2, K: c 'arma'}
(%1 = "Karlix") {#ALARM +2, Z: c 'arma'}
(%1 = "Sutex") {#ALARM +2, H: c 'arma'}
{#ALARM +2, Zarlix: c 'arma'}
_________________
Entropy rules
Reply with quote
shalimar
GURU


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

PostPosted: Mon Mar 22, 2021 12:10 pm   
 
This #switch is doing too much work, leading to unnecessarily duplicated code.

This is not the proper syntax for an #ALARM command.
You want to name them, to keep from having a bajillion copies.
You want to encapsulate its script in a separate set of {curly brackets}.

You want something like:

Code:
#LOCAL $nextCaster
#SWITCH (%1)
  ("Halix") {$nextCaster=Sutex}
  ("Zarlix") {$nextCaster=Karlix}
  ("Karlix") {$nextCaster=Zarlix}
  ("Sutex") {$nextCaster=Halix}
#EXECWIN $nextCaster {#ALARM "armageddon" +2 {c 'arma'}}
_________________
Discord: Shalimar#3679

Last edited by shalimar on Mon Mar 22, 2021 12:22 pm; edited 1 time in total
Reply with quote
Sutex-Kindred
Apprentice


Joined: 26 Aug 2009
Posts: 140

PostPosted: Mon Mar 22, 2021 12:21 pm   
 
That looks better.
So simple that switch and I understand it!
The copycat is not pattern matching , still tweaking;

So going to try this switch out, cheers
_________________
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