The player character walks soo slow. I get angry just looking at it...
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 MenuQuote from: Pumaman on Mon 28/02/2005 19:47:30
You cannot extend built-in types, no. This is a possibility for a future version.
// script header
struct MyCharacterStruct {
bool Wet; // 0 (false) by default
int Money; // 0 by default
};
// main script
MyCharacterStruct MyCharacter[AGS_MAX_CHARACTERS];
// some script
MyCharacter[cEgo.ID].Wet = true;
MyCharacter[cEgo.ID].Money = 78;
Quote from: Ghost on Thu 07/07/2005 18:00:57
but can I have the first few words of a dialogue option in the script? That's something that should please quite a lot of people!
// room script
int IsMovingRight;
function room_a() {
// room's repeatedly execute
//...
if (IsKeyPressed(377) == 1) { // if right arrow key is held down
if (IsMovingRight != 1) { // if NOT moving right already
MoveCharacter(EGO, character[EGO].x + 3, character[EGO].y); // start moving EGO 3 pixels to the right
IsMovingRight = 1; // set movement started
}
}
else IsMovingRight = 0; // if right arrow key is NOT held down, set movement NOT started
//...
}
// room script
bool IsMovingRight;
function room_a() {
// room's repeatedly execute
//...
if (IsKeyPressed(377) == true) { // if right arrow key is held down
if (IsMovingRight != true) { // if NOT moving right already
cEgo.Walk(cEgo.x + 3, cEgo.y); // start moving EGO 3 pixels to the right
IsMovingRight = true; // set movement started
}
}
else IsMovingRight = false; // if right arrow key is NOT held down, set movement NOT started
//...
}
Quote from: Pumaman link=topic=21373.msg264868#msg264868Is there any reason that you don't just run Windows at 32-bit? Since virtually everyone uses 32-bit desktops these days, I can't really justify adding in a "don't remind me again" option for such a rare message.
Quote
Want to scroll in long rooms but won't have a player char in the room .
// room script
#define SCROLL_SPEED 3
#define SCROLL_EDGE_LEFT 5
#define SCROLL_EDGE_RIGHT 5
#define SCROLL_EDGE_TOP 20
#define SCROLL_EDGE_BOTTOM 5
function room_a() { // (Room editor -> "i" -> "Repeatedly execute" -> "Edit script...")
// script for Room: Repeatedly execute
//...
int newvpx = GetViewportX(); // get current viewport x-position
int newvpy = GetViewportY(); // get current viewport y-position
if (mouse.x > (system.viewport_width - SCROLL_EDGE_RIGHT)) newvpx += SCROLL_SPEED; // if mouse is over right scrolling edge, move new viewport x position right
else if (mouse.x < SCROLL_EDGE_LEFT) newvpx -= SCROLL_SPEED; // if mouse is over left scrolling edge, move new viewport x position left
if (mouse.y > (system.viewport_height - SCROLL_EDGE_BOTTOM)) newvpy += SCROLL_SPEED; // if mouse is over bottom scrolling edge, move new viewport y position down
else if (mouse.y < SCROLL_EDGE_TOP) newvpy -= SCROLL_SPEED; // if mouse is over top scrolling edge, move new viewport y position up
SetViewport(newvpx, newvpy); // set viewport to (new) position
//...
}
Quote
One way to overcome this is, remove the character[EJ].SetAsPlayer(); line, then let the dialog calls dialog_request() to change the character back when it ends.
Quote from: GarageGothic on Thu 30/06/2005 16:48:59Edit 3: Except he said "add", shouldn't you rather subtract?
Quote from: Pumaman on Wed 29/06/2005 18:34:40
Some sort of IsWalkableAreaEnabled function wouldn't be a bad idea, I'll look into it.
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.474 seconds with 15 queries.