|
nijstar Newbie
Joined: 05 Aug 2002 Posts: 9 Location: Australia
|
Posted: Mon Aug 05, 2002 6:51 pm
nested #IF |
In my previous post I tried to get another version of the following script to work.
#IF (@co =~ "com1") {%case(%random(4),co=com2,co=com3,co=com4)} {#IF (@co =~ "com2") {%case(%random(4),co=com1,co=com3,co=com4)} {#IF (@co =~ "com3") {%case(%random(4),co=com1,co=com2,co=com4)} {#IF (@co =~ "com4") {%case(%random (4),co=com1,co=com2,co=com3)}}}: This script also doesn't work not only that when I leave the trigger editor something weird happens. The last portion of the script gets cut off leaving something that looks like this {#IF (@co =~ "com4") {%case(%random (4),co=com1,co=com2,co=com Can someone please help me with this. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Mon Aug 05, 2002 7:12 pm |
Since it's still the same problem, it would have been better to reply in the previous thread.
Version 3.62 is unsupported. Since I've never used it and don't have the helpfiles, I relied on the script you provided for syntax. However, this post makes it appear the syntax is pretty much what I'm used to. So, here's the command line version:
#TR {%w steps into the attack, grabs your arm, and throws you violently} {#wa 1800;
stand;
#IF (@co =~ "com1") {%case(%random(1,3),co=com2,co=com3,co=com4)};
#IF (@co =~ "com2") {%case(%random(1,3),co=com1,co=com3,co=com4)};
#IF (@co =~ "com3") {%case(%random(1,3),co=com2,co=com1,co=com4)};
#IF (@co =~ "com4") {%case(%random(1,3),co=com2,co=com3,co=com1)}}
I'm mystified as to what possible value there could be to randomly changing this variable, since you never take any other action, but it should work.
LightBulb
Senior Member |
|
|
|
nijstar Newbie
Joined: 05 Aug 2002 Posts: 9 Location: Australia
|
Posted: Mon Aug 05, 2002 7:44 pm |
Ok com1,2,3 and 4 are aliases for different attacks. There is another pattern which triggers the co variable causing one of the attacks to occur. The steps into the attack, grabs your arm pattern is a defensive manouver
which I have to avoid. What i was attempting with the If statements was to assign a random attack to co but not the same attack which was guarded against. The problem with the xcript the way that you have written it is that if it is com1 it has a good up to 3 chances of becoming com1 again and thereby hitting the guard again ie com1 becomes com2 com 2 becomes com1 or com1 becomes com3 com3 becomes com 1 or com1 becomes com4 com4 becomes com1. Hence the need for the earlier storage of the answer in coma or b or c and also the attempt at nesting the IF statements. |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Mon Aug 05, 2002 10:01 pm |
#TR {%w steps into the attack, grabs your arm, and throws you violently} {#VAR Coms {com1, com2, com3, com4};#IF (co="com1") {#VAR Coms {%replace(@Coms,"com1, ",%null)}};#IF (co="com2") {#VAR Coms {%replace(@Coms,"com2, ",%null)}};#IF (co="com3") {#VAR Coms {%replace(@Coms,"com3, ",%null)}};#IF (co="com4") {#VAR Coms {%replace(@Coms,", com4",%null)}};#VAR co {%case(%random(1,3),@Coms)};#WAIT 1800;stand}
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue Aug 06, 2002 2:32 am |
The un-nested #IF statements were taken directly from the script you provided in your first post. Had you bothered to tell us the purpose of the script in the first place, a lot of time could have been saved.
#TR {%w steps into the attack, grabs your arm, and throws you violently} {#wa 1800;
stand;changecom}
#AL changecom {temp=@co;co=%case(%random(4),com1,com2,com3,com4)};#IF (@temp=@co) {changecom}}
LightBulb
Senior Member |
|
|
|
nijstar Newbie
Joined: 05 Aug 2002 Posts: 9 Location: Australia
|
Posted: Tue Aug 06, 2002 5:04 am |
Thankyou both Lightbulb and Vijilante I will try these scripts out and get back to you. Forgive my use of two different posts to solve this issue and for beating around the bush this is my first post ever about anything owell live and learn.
|
|
|
|
nijstar Newbie
Joined: 05 Aug 2002 Posts: 9 Location: Australia
|
Posted: Tue Aug 06, 2002 1:25 pm |
I took your advice and got a copy of V6.16 it is very differnt but much much better, thankx :). The syntax checker is awsome. Lightbulb your script works exactly how I want it to in the new version thankx a bunch.
|
|
|
|
|
|
|
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
|
|