[SOLVED]Thyme:how to get owner info, inside of IF statement

If you have problems installing or running Algodoo, have found a bug or need in-game help - this is it!

[SOLVED]Thyme:how to get owner info, inside of IF statement

Postby tatt61880 » Sun Apr 08, 2012 3:51 pm

SOLVED: (by tatt61880 on 2012.05.13 21:28)
Solved in 2.0.2b15. Thanks :clap:
-Tatt
----
Please tell me how to get owner info at inside of {};

Code: Select all
Scene.addBox {
   collideSet := {
       true ? {print("inside {}: " + owner)} : {};
       print("outside {}: " + owner);
       1
   }
}


The code above returns below.
inside {}:
outside {}: box

I'd like to get box info at inside of {}

Regards,
Tatt
Last edited by tatt61880 on Sun May 13, 2012 2:29 pm, edited 2 times in total.
Reason: Fixed!
NOTE: I'm not an Algoryx member.
Hi, Algodoo lovers. Have you read next topic? Featured scenes suggestions
To translators: English.cfg changelog will be useful (even for me).
User avatar
tatt61880
[Most Helpful Person 2010]
 
Posts: 1150
Joined: Mon Aug 31, 2009 5:45 pm
Location: Tokyo, Japan

Re: Thyme: how to get owner info at inside of IF statement

Postby Kilinich » Mon Apr 09, 2012 7:33 am

Code: Select all
{
    self := owner;
    true ? {print("inside {}: " + self)} : {};
    print("outside {}: " + self);
    1
}
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: Thyme: how to get owner info at inside of IF statement

Postby tatt61880 » Mon Apr 09, 2012 11:38 am

Kilinich wrote:
Code: Select all
{
    self := owner;
    true ? {print("inside {}: " + self)} : {};
    print("outside {}: " + self);
    1
}


Wonderful!
Thanks, Kilinich. ;)

Edit:
Hmm, it works when you input code in script-menu, however, next code doesn't work well.
Code: Select all
Scene.addBox {
    self := owner;
    collideSet := {
        true ? {print("inside {}: " + self)} : {};
        print("outside {}: " + owner);
        1
    }
}
NOTE: I'm not an Algoryx member.
Hi, Algodoo lovers. Have you read next topic? Featured scenes suggestions
To translators: English.cfg changelog will be useful (even for me).
User avatar
tatt61880
[Most Helpful Person 2010]
 
Posts: 1150
Joined: Mon Aug 31, 2009 5:45 pm
Location: Tokyo, Japan

Re: Thyme: how to get owner info at inside of IF statement

Postby emilk » Sat May 12, 2012 2:24 pm

in 2.0.2 b15 I'll be introducing a "entity" keyword that works like this:

Scene.addBox {
text := {
"Pos: [" + entity.pos(0) + "," + entity.pos(1) + "]" + " - " + (entity.pos(1) < 0 ? "low" : "high");
}
}
Emil Ernerfeldt, lead developer
emilk
 
Posts: 616
Joined: Mon Aug 31, 2009 11:01 am
Location: Umeå, Sweden

Re: Thyme: how to get owner info at inside of IF statement

Postby tatt61880 » Sat May 12, 2012 2:55 pm

emilk wrote:in 2.0.2 b15 I'll be introducing a "entity" keyword that works like this:

Scene.addBox {
text := {
"Pos: [" + entity.pos(0) + "," + entity.pos(1) + "]" + " - " + (entity.pos(1) < 0 ? "low" : "high");
}
}

Thanks! :angel:
NOTE: I'm not an Algoryx member.
Hi, Algodoo lovers. Have you read next topic? Featured scenes suggestions
To translators: English.cfg changelog will be useful (even for me).
User avatar
tatt61880
[Most Helpful Person 2010]
 
Posts: 1150
Joined: Mon Aug 31, 2009 5:45 pm
Location: Tokyo, Japan


Return to Help / Bug reports

Who is online

Users browsing this forum: No registered users and 7 guests