Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Khris

#12401
Critics' Lounge / Re: Arizona Redneck Home
Tue 17/01/2006 02:23:06
I've fixed the perspective of the door & window which was pretty off compared to the rest of the building:

#12402
Hand-Raiser
100% rational, 100% extroverted, 42% brutal, 42% arrogant
#12403
Quote from: BadBoyZ on Sat 14/01/2006 14:26:31Initially I was looking for a way to turn off moveable sections, but couldn't find one (I blame this on my OO background and being unable to think of any other way than say moveable_section[0].disable()).
Well, as I wrote in the other thread, the commands you need are RemoveWalkableArea(); and RestoreWalkableArea();.

It isn't necessary to disable all script actions. Turn off the walkable area behind the gate in the first time player enters screen-Interaction of your room, then turn it back on as soon as the player gets the gate open.
I don't know what your PickUpObject-Code looks like, so you'd have to make sure that the player has successfully reached some walk-to-point before actually picking up the object. Otherwise the player would be unable to reach the object (due to the turned off WA) but still pick it up afterwards, in terms of the object disappearing from screen and getting added to the inventory.
#12404
What the hell is a "movable section"? I've never heard of that in relation to AGS.
#12405
Quote from: DonB on Fri 13/01/2006 16:11:44If i import the frames into a view, and i do preview this loop, I can increase delay.. tho.. if i click this away.. its still the default 5 delay..
The preview function of the view editor is only for previewing, altering the speed here won't affect the in-game setting. It's mainly used to e.g. check if a walk-cycle looks good and to figure out an appealing speed for later in-game use.
Below each frame it says: "SPD: 0" Click on that, now enter any number you want.
When you animate the sprite later on, this number is added to the chosen animation speed, allowing you to display certain frames longer than others.

Btw, I'm pretty sure this is well explained in the helpfile ;)
#12406
You have to intercept a left click.
You can do this in the global script, there's a function called on_mouse_click() which gets called everytime the player clicks somewhere on the screen.
By default, ProcessClick() is called after a left click.

default:
Code: ags
on_mouse_click(int button) {
...
Ã,  if (button==eMouseLeft) {
Ã,  Ã,  ProcessClick(mouse.x, mouse.y, mouse.Mode);
Ã,  }
...
}


change it to:
Code: ags
on_mouse_click(int button) {
...
Ã,  if (button==eMouseLeft) {
Ã,  Ã,  if (player.Room==x && certain conditions are met e.g. gate is open) {Ã,  // <---- edit this line
Ã,  Ã,  Ã,  ProcessClick(mouse.x, mouse.y, mouse.Mode);
Ã,  Ã,  }
Ã,  Ã,  else {
Ã,  Ã,  Ã,  player.Say("Can't do that right now.");
Ã,  Ã,  }
Ã,  }
...
}


btw, did you read my answer in your other thread?
#12407
Please don't triple-post, use the Modify button instead.

It's absolutely possible to switch back and forth between mouse and keyboard. The most simple solution is to check the room the player is in before handling clicks resp. keypresses. But it is possible to switch controls at any given moment, using variables.

About the corridor: You'd have to move column objects along the two lines (where ground meets left & right wall), scaling them in relation to their y-coord. This can be done using basic maths.

Bear in mind that AGS is very flexible. You can code almost anything, there's even a full 3D engine supporting lighting and scaled sprites somewhere in the Technical forums.
#12408
Look up the Viewport commands in the helpfile.
Depending on your way of moving the char (mouse or keyboard?), it's pretty easy to implement this.

BTW, there's no scaling unless you set it up. So you don't need any declarations.
#12409
Advanced Technical Forum / Re: SUGGESTIONS
Fri 13/01/2006 10:19:46
Here's the correct AGS code:

Code: ags
function HelloWorld() {
Ã, Ã, Display("Hello World!");
}

function Main() {
 Ã, HelloWorld();
}


PS: It's not his homepage, afaik this domain belongs to Neole.
#12410
Critics' Lounge / Re: Alley Photo
Fri 13/01/2006 08:24:41
Quote from: BlankLGPsm1081 on Fri 13/01/2006 01:59:02The whole thing is at an angle and it needs to be level with the viewers eyes, which it's not.

No. The angle you are using is fine, but the perspective of the box is screwed up.
And you should avoid lines that are too close to each other (the top of the box is right where wall meets ground). Make the shapes overlap each other.

Like this:


To the right, you can see the horizon and vanishing point your image is based on.
#12411
That isn't anywhere in the default script.
Code like this goes into the game_start-function of the global script.

To change the number of items per row, resize the inventory window to desired_items_per_row*invMain.ItemWidth
(I assume that you're using a custom inventory GUI)
#12412
Critics' Lounge / Re: caveman sprite for C&C
Thu 12/01/2006 21:26:45
Quote from: ladymeba on Thu 12/01/2006 20:31:39
there must be a way to do it without the funny edge problem....??
Check if the resize function of your gfx prog has a Pixel resize option. At least that's what it's called in PSP.
Another possibility is to resize the sprite, then repaint it in a new (50% transparent) layer.
#12413
Code: ags
bool flying=false;
float x;
float y;
float dx;
float dy;
float mouse_dist;

function hit() {
Ã,  Object *target;
Ã,  target=Object.GetAtScreen(FloatToInt(x), FloatToInt(y));
Ã,  if (target!=null) {
Ã,  Ã,  game.score++;
Ã,  Ã,  target.Visible=false;
Ã,  Ã,  // reset(target);Ã,  // recreate target?Ã,  Ã,  
Ã,  Ã,  return 1;
Ã,  }
Ã,  return 0;
}

function repeatedly_execute() {
Ã,  if (IsTimerExpired(1)) {
Ã,  Ã,  x=x+dx;
Ã,  Ã,  y=y+dy;
Ã,  Ã,  oBullet.SetPosition(FloatToInt(x), FloatToInt(y));Ã,  Ã,  //Ã, <---- bullet object: oBullet
Ã,  Ã,  if (Maths.Sqrt(x*x+y*y)<300 && hit(x, y)==false) {
Ã,  Ã,  Ã,  SetTimer(1, 3);Ã,  // 3: speed
Ã,  Ã,  }
Ã,  Ã,  else {
Ã,  Ã,  Ã,  flying=false;
Ã,  Ã,  }
Ã,  }
}

function on_mouse_click(int button) {
Ã,  if (room==2 && button==eMouseLeft && flying==false) {Ã,  Ã, // shooting-range: room 2
Ã,  Ã,  dx=IntToFloat(mouse.x-player.x);
Ã,  Ã,  dy=IntToFloat(mouse.y-player.y);
Ã,  Ã,  mouse_dist=Maths.Sqrt(dx*dx+dy*dy);
Ã,  Ã,  dx=dx/mouse_dist; // move one pixel every speed/40 seconds
Ã,  Ã,  dy=dy/mouse_dist;
Ã,  Ã,  x=IntToFloat(player.x);
Ã,  Ã,  y=IntToFloat(player.y);
Ã,  Ã,  flying=true;
Ã,  Ã,  SetTimer(1,3);
Ã,  }
Ã,  ...
}


Try this. I didn't test it, but it should work.
Of course you have to edit the existing repeatedly_execute and on_mouse_click to look like my code.
#12414
if (player.ActiveInventory==iTape) {
Ã,  ...
}
else player.Say("What?");
#12415
I've just noticed that my code makes the character rise...
change it to
Code: ags
int c=cRoger.y;
while (c>0) {
Ã,  cRoger.z=c;
Ã,  Wait(1);
Ã,  c--;
}
#12416
If you intend to do this in a cutscene, use something like this:

Code: ags
int c=0;
while (c<230) {
Ã,  cRoger.z=c;Ã,  Ã,  Ã,  // Characters z-coord represents height
Ã,  Wait(1);Ã,  Ã,  Ã,  Ã,  Ã,  Ã, // without this line, movement would happen in an instant
Ã,  c++;
}
#12417
You can disable/enable walkable areas.
RemoveWalkableArea(x); // player isn't able to walk on area x any longer
RestoreWalkableArea(x); // player can walk there again
#12418
Making the intercom a character is a convenient and clean way, IMO. Although this could interfere with custom interface code.

Another solution:
Use an object for the intercom and place a Character directly above it. Then just make the Char invisible and non-clickable.
If the Char you're gonna talk to actually exists in the game, simply use it and change its View to a transparent one in the before fadein of the room.
#12419
Critics' Lounge / Re: Alley Photo
Thu 12/01/2006 06:39:19
Use a darker, lower saturated red, get rid of the black outlines and draw every brick. But be warned: it's hard and often boring work to pixelpaint a realistic-looking background.
As you are a beginner, I'd recommend developing your sense for perspective and proportions further first; Google's image search usually is a great help.
#12420
This topic is great! I'm in.
SMF spam blocked by CleanTalk