Author Topic: Once again...Agi Help  (Read 1724 times)

0 Members and 1 Guest are viewing this topic.

Keith

  • Guest
Once again...Agi Help
« on: September 22, 2001, 09:09:52 PM »
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.
« Last Edit: December 31, 1969, 07:00:00 PM by 1018072800 »



Offline Rich

Re: Once again...Agi Help
« Reply #1 on: September 23, 2001, 01:05:56 AM »

Quote

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
« Last Edit: December 31, 1969, 07:00:00 PM by 1018072800 »

Keith

  • Guest
Re: Once again...Agi Help
« Reply #2 on: September 24, 2001, 11:31:57 AM »
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.....
« Last Edit: December 31, 1969, 07:00:00 PM by 1018072800 »

Offline Tarison

Re: Once again...Agi Help
« Reply #3 on: September 24, 2001, 03:52:36 PM »
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);

« Last Edit: December 31, 1969, 07:00:00 PM by 1018072800 »

Offline m1k237

Re: Once again...Agi Help
« Reply #4 on: September 24, 2001, 08:36:53 PM »
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.
« Last Edit: December 31, 1969, 07:00:00 PM by 1018072800 »

briancorr

  • Guest
Re: Once again...Agi Help
« Reply #5 on: September 26, 2001, 12:28:54 AM »
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
« Last Edit: December 31, 1969, 07:00:00 PM by 1018072800 »


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.045 seconds with 21 queries.