scandum / tintin

TinTin++, aka tt++, is an extensible console MUD client.
https://tintin.mudhalla.net
GNU General Public License v3.0
201 stars 56 forks source link

You can't trig a action "out of range" that created by a locally variable #212

Open Dawn-Xu-helloworld opened 9 months ago

Dawn-Xu-helloworld commented 9 months ago

alias set {

#local {condition} {test local};
#action {$condition} {#show trigged!};

}

alias test {

#show test local;

}

when you "set" up and "test", nothing happened, and the action turn back into #action {$condition} {#show trigged!}

In my point, I think the action's trigging text should be stable and unchangeable.

Dawn-Xu-helloworld commented 9 months ago

I think in some conditions, we would need a temporary but unfixed oneshot action, It's necessary to use a local variable, or a disposable variable to make the namespace clean and tidy, but the action should keep in work

scandum commented 9 months ago

You can use:

#line substitute variables #action {$condition} {#show trigged!};

Keep in mind if you have any variables in the action body, you may want to use $$var to prevent substitution.

Dawn-Xu-helloworld commented 9 months ago

You can use:

#line substitute variables #action {$condition} {#show trigged!};

Keep in mind if you have any variables in the action body, you may want to use $$var to prevent substitution.

Can I use this inside a #line oneshot ?