dynamically add a variable to an object that sticks?
3 posts • Page 1 of 1
dynamically add a variable to an object that sticks?
Im so tired of using color and texture matrix variables to store data, isnt there any way to permanently add a custom variable to an object like u do when u type something=2 in the empty box at the bottom of each objects script menu?
- Mr_Stabby
- Posts: 155
- Joined: Wed Dec 16, 2009 12:16 am
Re: dynamically add a variable to an object that sticks?
- Code: Select all
if (!e.this.somevar) { e.this.{somevar} := something; }
Something like that should work. The := is important. (The syntax could be wrong—I don't really know Thyme, just bits and pieces, and I'm much more used to JavaScript syntax.) It'll work without the if, but throw warnings about variable already defined (if you put this in a repeating onCollide/onLaserHit).
- daniels220
- Posts: 95
- Joined: Mon Aug 31, 2009 11:30 pm
Re: dynamically add a variable to an object that sticks?
great! combined that with something else i found while browsing this forum and came up with this:
- Mr_Stabby
- Posts: 155
- Joined: Wed Dec 16, 2009 12:16 am
3 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest