Author |
Message |
Ophanim
Joined: Wed Dec 26, 2007 6:33 am Posts: 1743 Location: Trapped in UCP. Send help.
|
Quick Lua Tips
Data's crazy and Australian or something and -y is up. Team 1 is Green, Team 0 is Red. Anyone got anything else?
|
Sun Aug 24, 2008 1:05 am |
|
|
Lord Tim
Joined: Fri Apr 27, 2007 4:55 pm Posts: 1178 Location: America!
|
Re: Quick Lua Tips
Code: Constants:
Activity. TEAM_1 0 TEAM_2 1 PLAYER_1 0 PLAYER_2 1 PLAYER_3 2 PLAYER_4 3 EDITING 2 RUNNING 3 OVER 6
Actor. AIMODE_NONE 0 AIMODE_SENTRY 1 AIMODE_PATROL 2 AIMODE_GOTO 3 AIMODE_BRAINHUNT 4 AIMODE_GOLDDIG 5
Controller. CIM_AI 2 List of functions lol: http://cortex.pastebin.com/f31593c76
|
Sun Aug 24, 2008 1:10 am |
|
|
AtomicTroop
Joined: Fri Mar 16, 2007 1:28 pm Posts: 328 Location: Finland
|
Re: Quick Lua Tips
Ophanim, the inverted y is pretty much normal in all kinds of script languages, not only in DaTa's lua intepretation. For example, actionscript does it the same way too. To me, it feels more logical though. I mean, if it starts from upper left corner, of course it would go down as + and right as +.
|
Sun Aug 24, 2008 10:46 am |
|
|
Daman
Joined: Fri Jan 26, 2007 3:22 am Posts: 1451
|
Re: Quick Lua Tips
AtomicTroop wrote: Ophanim, the inverted y is pretty much normal in all kinds of script languages, not only in DaTa's lua intepretation. For example, actionscript does it the same way too. To me, it feels more logical though. I mean, if it starts from upper left corner, of course it would go down as + and right as +. What are you talking about? Also actionscript is just a crappy Flash language.
|
Sun Aug 24, 2008 3:57 pm |
|
|
war_man333
Joined: Sun Nov 11, 2007 1:49 pm Posts: 785
|
Re: Quick Lua Tips
Daman wrote: AtomicTroop wrote: Ophanim, the inverted y is pretty much normal in all kinds of script languages, not only in DaTa's lua intepretation. For example, actionscript does it the same way too. To me, it feels more logical though. I mean, if it starts from upper left corner, of course it would go down as + and right as +. What are you talking about? Also actionscript is just a crappy Flash language. Yeah, actionscript blows, it's not flexible at all and doesn't make much sense to me whatsoever. Also how come lua doesn't use brackets instead of the end stuff?
|
Sun Aug 24, 2008 4:13 pm |
|
|
FarvanTorna
Joined: Sat Dec 02, 2006 11:51 pm Posts: 204
|
Re: Quick Lua Tips
Hey I've seen some crazy stuff with actionscript.
|
Sun Aug 24, 2008 4:26 pm |
|
|
Ophanim
Joined: Wed Dec 26, 2007 6:33 am Posts: 1743 Location: Trapped in UCP. Send help.
|
Re: Quick Lua Tips
AtomicTroop wrote: Ophanim, the inverted y is pretty much normal in all kinds of script languages, not only in DaTa's lua intepretation. For example, actionscript does it the same way too. To me, it feels more logical though. I mean, if it starts from upper left corner, of course it would go down as + and right as +. Or you can start in the ♥♥♥♥ center.
|
Sun Aug 24, 2008 4:34 pm |
|
|
Lord Tim
Joined: Fri Apr 27, 2007 4:55 pm Posts: 1178 Location: America!
|
Re: Quick Lua Tips
Ophanim wrote: AtomicTroop wrote: Ophanim, the inverted y is pretty much normal in all kinds of script languages, not only in DaTa's lua intepretation. For example, actionscript does it the same way too. To me, it feels more logical though. I mean, if it starts from upper left corner, of course it would go down as + and right as +. Or you can start in the fudge center. Which would require the game to do more calculations than it needs, and be a whole lot more complicated for anyone trying to code against it. It's a bunch easier when everything is generally positive. Plus, yeah, pretty much any computer graphics thing you use ever will have y+ as down. It's a convention.
|
Sun Aug 24, 2008 5:53 pm |
|
|
Ophanim
Joined: Wed Dec 26, 2007 6:33 am Posts: 1743 Location: Trapped in UCP. Send help.
|
Re: Quick Lua Tips
It's a dumb convention.
|
Sun Aug 24, 2008 8:45 pm |
|
|
Omni
Joined: Sat Jan 27, 2007 9:38 am Posts: 170 Location: St. Louis, MO
|
Re: Quick Lua Tips
Wait, why are you confused about the +y down? What's confusing is the +x left.
|
Mon Aug 25, 2008 3:45 am |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Quick Lua Tips
Uh what? +X is right, not left.
There's just no negative X. Scene wrap point and onward moves to the right.
|
Mon Aug 25, 2008 3:48 am |
|
|
Omni
Joined: Sat Jan 27, 2007 9:38 am Posts: 170 Location: St. Louis, MO
|
Re: Quick Lua Tips
Disregard, I stimulate receptacles. Apparently this grid in this article is a backwards grid for joint offset. http://www.datarealms.com/wiki/index.ph ... _TutorialsWhy the backwards grid is given priority in the article I'll never know. Stupidity aside, there's always negative X. At least when you're talking relative. Relative to an actor at (300,100), an actor at (200,100) is off the x coordinate of the first by -100 pixels.
|
Mon Aug 25, 2008 4:50 am |
|
|
Tea
|
Re: Quick Lua Tips
Hey, need help with scene Lua. Is it possible to Have a Countdown (three minutes) that starts when an actor enters an area and results in the gibbing of another actor if it gets to 0?
Seemed like the right place to put this.
|
Mon Aug 25, 2008 4:51 pm |
|
|
Ophanim
Joined: Wed Dec 26, 2007 6:33 am Posts: 1743 Location: Trapped in UCP. Send help.
|
Re: Quick Lua Tips
self.GibTimer Timer(); or something like that. This is in every lua file, so check there, as I am too lazy. Then just run a check if self.GibTimer IsPastSimMS(3 minutes of milliseconds here ) then blah blah.
|
Mon Aug 25, 2008 5:23 pm |
|
|
robowurmz
Joined: Thu Aug 16, 2007 10:09 am Posts: 163
|
Re: Quick Lua Tips
Negative X works for me. Just don't put a space after the negaitve. This works: Code: for actors in MovableMan.Actors do actors.Vel = Vector(-5,-10) Makes them hop left. Code: for actors in MovableMan.Actors do actors.Vel = Vector(5,-10) Makes them hop right.
|
Mon Aug 25, 2008 5:31 pm |
|
|
|
Who is online |
Users browsing this forum: No registered users |
|
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 post attachments in this forum
|
|