Keith |
Currently I'm using Peter K's template to create my "first" AGI game. While viewing other games source code I have noticed they use different commands. For example, to write directions for the new room source code most games use - if (isset(f5)) while the template uses - if (new_room). Which is command sets are better to use? Also, how do you stop the character from overlapping priority lines? Thanks. |
Rich |
|
Keith |
Yes. Logic is tough...too tough. I've been studying LsL1 and have come to ths conclusion - WHAT DOES IT MEAN??? Anyhow, my latest (and definety not last) question is how do you determine whether or not (ego) is close enough to obtain an object? I can't fathom the command this: ... if (posn(ego, 37, 111, 51, 124)) { ... I know ego refers to the character and the others are X, Y, X2, Y2 (or so I think). But when I measure these coordinates (or any others) on PicEdit I don't get how it surrounds the object??? Help. Explain the way to test if the ego is close enough to an object. Thanks..... |
Tarison |
That's one way to test, because the coordinates are a list of corners of a box around the object, and if ego is inside the box, then it means they're close enough. If you mean object in the AGI sense (an o-variable), then you could always use distance(ego, object, vXX), and test the contents of the v-variable. The proper syntax for distance is: distance(oA,oB,vD); |
m1k237 |
Here's how I'd do it. if (posn(ego(blablabla)) { if (posn(ego(blablabla)) { If your object is on the ground the first line should make a diagonal line right thru the object. The second line makes another diagonal line also thru the object so the to diagonal lines form an "X", with the object positioned right where the two lines meet. |
briancorr |
i think youre a little confused here. the way the posn(o0,x1,y1,x2,y2) command is set up is that the first 2 numbers give you a point, and the third and fourth do as well. theses two points are the top left and bottom right cornrs of a box. so if you saw this: if(posn(o0,22,100,36,112){ print("hello"); } and you wanted to know where that was, go into picedit and find point 22,100. then find point 36,112. these points are the corners of a box on screen and that's where to go. also, the compiler transforms if(new_room){ into if(isset(f5)){by itself. chance are the game designer wrote if(new_room){ in the first place. its good to use defines when u r learning agi as they're way less confusing but they take ages to write. once youre more experienced you will probly not need them |