Newb

Zagrijs Where can I find Agi tutorials ?
Kon-Tiki Neatly organized list of tutorials and aiding ;)
Zagrijs Thanks it realt helped

Can someone just tell me which colour represents which priority number.
Joey it should say in paint. when you click on a color, a number should come up not too far away, i forget where. but it will say there. i think its next to P. i dont remember.
Kon-Tiki For priorities:
Black = Unwalkable
Darkblue = Unwalkable, but can be turned off.
Darkgreen = Sets/resets Flag 3
Cyan = Sets/resets Flag 0
Joel The priority colors correspond directly in number to the colors in the color palette. Starting with black as 0, if you can't find the display that tells you which color goes with which priority (it is, in fact, next to the P in PicEdit -- and the Visual AGI Picture Editor tells you beside the color when you select it), you could always count the colors to find out which color goes with which priority.
zagrijs Thanks

I want to let ego when he turns on a computer be able to view a number of files with info.
zagrijs Thanks for the tutorials

There aren't much on scripting. I got a tutorial on items and doors and the basic structure of a room but not much more. Most of the others weren't complete and didn't tell me much.
Andrew_Baker The best way is to download source code and have a look at it. You can get the code for Voodoo Girl: Queen of the Darned from www.voodoogirl.cjb.net. This includes the actual game, graphics, sound, etc.

I'm sure there are other examples out there, as well. Everyone who posts on this board is intelligent and helpful. Ask for code to look at, or where to find tutorial *code*, and you will probably receive.

BTW, if you have any difficulty deciphering my code (it's not the most well-written, although some of it is clever ::) ), you can message me through this site or my website or e-mail (failrate <at> hotmail <dot> com)
Zagrijs Thanks

Do I have to download source code or can I look at the code through Agistudio.

Look for learning not changing
Zagrijs Okay how can I let a character sit?

I think I should first draw a view of ego sitting.

Then if ego is in the right position and enters sit. I want to hide the view of ego standing and display the view of ego sitting in the right position.

Basically how do I hide a view of ego and load another view of ego
Kon-Tiki
load.view(1);
set.view(ego,1);

This's where 1 is the sitting view. Off course, you'll have to turn off walking around too, but leave parsing in, or he'll be walking like a freak ;D
Zagrijs Thanks I don't understand the position.How do I get ego position right.
Kon-Tiki Hmmm... I'll have a look at the sourcecode of Little Pirate. Ego's doing the exact same thing there.

if (said("sit","rol")) {
if (posn(o0,84,73,102,93)) {
if (!isset(f100)) {
print("You sit down.");
erase(o0);
set.loop(o2,1);
end.of.loop(o2,f100);
}
else {
print("You try to sit down twice, but just hurt yourself. You're not "
"bendable enough.");
}
}
else {
print("Your tuchy's not THAT big.");
}
}
if (isset(f100)) {
stop.cycling(o2);
}

And man, is it weird seeing that old code again.

if (said("examine","a","sink")) {
print("Dirty dishes are everywhere.");
}
What the hell's that "a", doing there? ???
Zagrijs What I don't understand is how the posn(84,73,102,93)
works.
How do you know what do make it.
gennadiy if (posn(o0,84,73,102,93)) {
>if (posn(oA,x,y,x,y)) {
this code checks that object 0 (ego, character) is positioned on the line what begins from point 84,73 and ends at 102,93.
Joel Wait a second.

The posn command is exactly the same as the obj.in.box command, except that the obj.in.box command tests the entire bottom row of pixels of the object and posn tests the bottom-left pixel only. This is according to the AGI Studio help file.

Basically, the purpose for both commands is to check whether an object is positioned within a rectangular region (as opposed to on a line) on the screen, but from the sound of things obj.in.box is more demanding than posn.
Zagrijs Here is the code:

if (said("sit")) {
if (posn(o0,45,159,57,126)) {
if (!isset(f100)) {
print("You sit down.");
   set.view(ego,2);

}
else {
print("You try to sit down twice, but just hurt yourself. You're not "
"bendable enough.");
}
}
else {
print("Your tuchy's not THAT big.");
}
}
if (isset(f100)) {
stop.cycling(o2);
}

The bottom left corner of chairs coordinates are 51 159.
Joel I don't know whether this will make any difference, but try specifying it like this:

if (posn(o0, 45, 126, 57, 159))

since the most common way to express rectangular coordinates is x1, y1, x2, y2, where (x1, y1) is usually the top-left corner and (x2, y2) is usually the bottom-right corner.

You're specifying it as bottom-left, top-right. Like I said, I don't know if that will fix your problem, but it's worth trying.

Oh yeah, and just to be clear, you're not testing the bottom-left pixel of the chair. You're testing the bottom-left pixel of o0, i.e. ego to see whether it's within range of the chair.
Joel This comes from the AGI Specs:

posn(n, x1, y1, x2, y2);

TRUE if the coordinates of the base point of the cel which is the current image of the object n satisfies the equation x1 <= x <= x2 and y1 <= y <= y2.

If this is correct, then that would mean that the order that you specify the arguments DOES matter.
Andrew_Baker Download the source. You can view the game in AGIStudio, but with the source you'll also get the defines and comments, which should help immensely.
Zagrijs Thanks Joel. I finally got ego to sit. Another question

How can I get the control away from the player after he sits so ego cannot move without taking away typing.

Thanks for holding off with all my questions
Joel I believe the command is program.control(). When you're ready for the player to move again, you have to type player.control().

I don't think either of those turn off the ability to type, which I believe is controlled by prevent.input() and accept.input().
Zagrijs In this case the player can still move and type even if I use program.control.

Here is the code

if (said("sit")) {
if (posn(ego,50,125,75,160)) {
if (!isset(f100)) {
print("You sit down.");
program.control();
set.view(ego,2);
ignore.blocks(ego);
set.priority(ego,13);
move.obj(ego,60,137,10,f100);



}
else {
print("You try to sit down twice, but just hurt yourself. You're not "
"bendable enough.");
}
}
else {
print("Your tuchy's not THAT big.");
}
}
if (isset(f100)) {
stop.cycling(ego);
}
Zagrijs I figured it out and it works except that when it should erase the sitting ego view after the player type stand and then draw the regular ego view again it draws the regular ego view and the face of the regular ego view stays where the view is drawn over the background.
Kon-Tiki player.control();
start.cycling();

You'll need those two in the code for standing back up. Player.control(); will make it so that the player can move ego around again. Start.cycling(); is needed because you needed stop.cycling(); first. It'll start the animation of ego again, while if you wouldn't use it, it'd look like it'd be sliding over the screen, kinda like a paper doll on a stick.
Zagrijs Thanks Kon-Tike but after I posted my previous message I tried everything and 15 minutes after your post it was working.

Thanks again for your help
Kon-Tiki Even better. It means you're making progress in coding in AGI :)