View previous topic :: View next topic |
Author |
Message |
false_aesthetic
Joined: 12 Jan 2014 Posts: 3 Location: United States
|
Posted: Sun Jan 12, 2014 1:46 pm Post subject: Losing % symbols. |
|
|
Hey,
I'm pretty new to tintin so apologies if this is really basic or stupid.
I'm running TT++ 2.0.9 on my mac (10.6.8) and have been trying to get an auto heal to work:
#al {setnul} {#nu #var nulm %0;#nu say Heal set to %0}
#alias {nulmira} {#nu #act {^<Null %0(} {#if {%%0<$nulm} {mira2}}}
#alias {mira2} {fmira null;#nu #unact {^<Null %0(};#nu #act {Your life has been restored.} {nulmira}}
{setnul} creates a #var for Null's current HP.
{nulmira} turns the auto-heal on
{mira2} prevents the auto-heal from spamming.
Here's the problem:
When I set this up and check the actions I see this:
#ACTION {^<Null (}={#if {%0<$nulm} {mira2}} @ {5}
The first %0 is gone and the %%0 is replaced with %0
So what am I doing wrong?
Thanks for your patience |
|
Back to top |
|
 |
Scandum Site Admin
Joined: 03 Dec 2004 Posts: 3842
|
Posted: Sun Jan 12, 2014 5:31 pm Post subject: |
|
|
The #alias uses %0 just like the action does, which means you need to escape the %0 which you can do by adding an extra %.
So you'd use:
Code: |
#alias {nulmira} {#nu #act {^<Null %%0(} {#if {%%0<$nulm} {mira2}}}
|
I'm not sure if you come from a wintin95 background, but in tintin++ you escape for each nested trigger (alias/action typically), the braces are irrelevant. |
|
Back to top |
|
 |
false_aesthetic
Joined: 12 Jan 2014 Posts: 3 Location: United States
|
Posted: Sun Jan 12, 2014 7:31 pm Post subject: |
|
|
No,
I don't come from Wintin. I've only used tintin but on a very very basic level (aliases for dirs, logging in, etc). I'm trying to make the gameplay a bit more involved now.
Would you please explain what you mean by "you need to escape the %0 "
I understand adding an extra % but I'm not sure why you don't do that on both sides see below:
Code: |
#alias {nulmira} {#nu #act {^<Null %%0(} {#if {%%%0<$nulm} {mira2}}}
| [/quote] |
|
Back to top |
|
 |
Scandum Site Admin
Joined: 03 Dec 2004 Posts: 3842
|
Posted: Mon Jan 13, 2014 5:50 pm Post subject: |
|
|
I see the confusion, I changed that because I don't see how using %%%0 would result in valid script code in that scenario.
It would result in a literal '%0' being evaluated, which means the if check would always be false.
If you want a % to be placed in front of it you could try: \%%%0 but that would not result in a valid expression, so the if check would still always be false. |
|
Back to top |
|
 |
false_aesthetic
Joined: 12 Jan 2014 Posts: 3 Location: United States
|
Posted: Mon Jan 13, 2014 11:49 pm Post subject: |
|
|
I'm sorry to be a pain.
Previous suggestion didn't work.
I tried something else today:
In the score I have the following.
Align: 830
I wanted to create an action that check the alignment and triggers "use cross" if my alignment is below 700.
Code: |
#var {goodalign} {700}
1. #act {Align: %1} {#if {%1<$goodalign} {use cross}}
and I tried
2. #act {Align: %1} {#if {%%1<$goodalign} {use cross}}
|
Using TT 2.0.9 if try 1. No mater what my align is, I will use cross.
If I try 2. nothing happens.
Now if I try a previous version of TT
I get the following:
1. gives me:
#MATH EXP: INVALID INPUT {830 |<700}
2. gives me:
#MATH EXP: INVALID INPUT {%830 |<700}
I've had a few other players try to help me out, it works for them but they're either using tt++ on a PC or using wintin.
I'm wondering if there's a possibility that #if just doesn't work with my setup.
Thanks for your patience. |
|
Back to top |
|
 |
Scandum Site Admin
Joined: 03 Dec 2004 Posts: 3842
|
Posted: Tue Jan 14, 2014 10:54 am Post subject: |
|
|
Looks like the mud prints: Align: 830 |
If that's the case try:
Code: |
#act {Align: %1 |} {#if {%1 < $goodalign} {use cross}
|
You can use: #debug action on to see what goes on behind the scenes. |
|
Back to top |
|
 |
|