Welcome to the Builder Academy

Question Trigger of the Day - Obj Extract Example

More
03 Nov 2012 20:36 #975 by Rumble
Code:
Name: 'Yoda Using Extract to Warp Speech', VNum: [ 208], RNum: [ 207] Trigger Intended Assignment: Mobiles Trigger Type: Speech , Numeric Arg: 1, Arg list: * Commands: * By Rumble of The Builder Academy tbamud.com 9091 wait 2 sec extract word1 1 %speech% extract word2 2 %speech% extract word3 3 %speech% extract word4 4 %speech% extract word5 5 %speech% extract word6 6 %speech% say %word6% %word5% %word4% %word3% %word2% %word1%?
Another more advanced version
Code:
wait 2 s while %speech.car% set altered_speech %altered_speech% %speech.car% set speech %speech.cdr% done say %altered_speech%
If this was helpful please vote or leave a review for TBA.

Rumble
The Builder Academy
tbamud.com 9091
rumble@tbamud.com

Please Log in or Create an account to join the conversation.

More
11 Mar 2019 17:11 #8339 by Parnassus
I was looking for more information on extract so searching for Yoda was the obvious step. I was interested to find this advanced version so I checked it out.

What I'm really looking for is a way to show the original line minus the extracted word without having to go through each word manually and sticking them back together. Help Extract uses the phase "do you want chicken" and changes it to "chicken want do you?" What I'm looking for is to extract, as an example, word 3 with an output of "do you chicken". The obvious way is to output extract1, extract2, extract4 but I'm hoping for something easier. I was in hopes that the %altered_speech% would give me some insight but just the compared efficiency interested me.

I was so surprised to try it out and find...nothing. I threw in a bunch of echoes to see what was happening and I found that the trigger took the original sentence and very stealthily took it apart, word by word, and then put it back together. Did I miss something? I suppose I could actually play with it to make it react more like the previous example but anything I could do to it would make it less efficient than trigger 208.

Perhaps the efficient way might be to do a while cdr in the first example instead of extracting each word individually? Of course, this doesn't help my original question at all but now that advanced version is kinda bugging me.

Please Log in or Create an account to join the conversation.

Time to create page: 0.272 seconds