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 - strazer

#1081
The player character walks soo slow. I get angry just looking at it...
#1082
The Rumpus Room / Re: Happy Birthday Thread!
Fri 08/07/2005 16:02:35
Happy Birthday, Rick!
#1083
Yes, these custom properties cannot be changed at runtime at the moment (tracker).

As for adding properties to built-in types (character, objects, etc.):
Quote 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.

Depending on what you want to do exactly, you could use a combination of structs and arrays:

Code: ags

// script header

struct MyCharacterStruct {
  bool Wet; // 0 (false) by default
  int Money; // 0 by default
};



Code: ags

// main script

MyCharacterStruct MyCharacter[AGS_MAX_CHARACTERS];


Code: ags

  // some script

  MyCharacter[cEgo.ID].Wet = true;
  MyCharacter[cEgo.ID].Money = 78;
#1084
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!

What do you mean? GetDialogOptionText?
#1085
Yes, the code is for version 2.7. This is for v2.62:

Code: ags

// 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

  //...
}
#1086
Glad I could help. :)
#1087
Are you sure you hadn't used the MoveCharacter command in the room's on_key_press function? The on_key_press function is only called once, when the key is pressed down.

The way your above code in rep_ex works now is that 40 times per second it's checked if the right arrow key is held down and then, the 3-pixel character move is started, !40 times a second!, so it has no chance to actually be executed until the key is released.

You have to check if the movement has already been started before trying to move the character again. Try something like this:

Code: ags

// 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

  //...
}


Check out this thread in the Technical Archive on how to do proper multi-directional keyboard control.
#1088
function repeatedly_execute() {
  // put anything you want to happen every game cycle here
}
//////////////////////////////////////////////////
int newvpx = GetViewportX(); // get current viewport x-position
//...

The code has to be pasted between these two braces. It's not enough to paste the code between the sectionstart and sectionend lines.
The way you have it now the code is outside of any function which cannot be done.
#1089
Yes, the code should also work if you put it into the global repeatedly_execute/_always function.
#1090
1) Putting PlayVideo in the game_start function (menu "Script" -> "game_start") should do the trick. The game_start function is executed when the game starts, before the first room is loaded.
2) A simple room with hotspots is easier to do but I use a GUI that I can cover the current screen with anytime the player chooses to bring up the main menu.
3) AGS is event-driven, so anytime certain things happen, special built-in functions are called, oftentimes with parameters. For example, when a key is pressed, the on_key_press function is executed with its "keycode" parameter containing the ASCII code of the key that has been pressed.
Similarly, when a room is entered for example, commands added to the "Player enters screen (before fadein)" event are executed. If one of these commands happens to be "Run script", the script contained within the function linked to that command ("Edit script..." button) is executed.
Check the manual -> Reference -> Scripting event reference
#1091
Have you created the room_a (or room_b or room_c or ...) function first by doing
  Room editor -> "i" button -> "Repeatedly execute" -> "Edit script..."
?
If you just paste the above code into the room script like that, it isn't linked with the room interaction and isn't executed.
You have to create the interaction function first, then paste the code between the two //... in there (and the #define stuff at the top of the room script by pressing the "{}" button).

If you don't know what I just said, try renaming
  function room_a() {
to
  function repeatedly_execute_always() {
#1093
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.

I run the editor on Linux via WINE and I always get this message with 32-bit games since Linux desktops are 24-bit for some technical reason. So I would use it but I don't really care since it's just a click away.

Edit:

Can we have "repeatedly_execute" in room scripts please?
It would save a lot of time not having to explain to users how and where to paste room rep_ex code.
#1095
First off, from the original description of your problem

Quote
Want to scroll in long rooms but won't have a player char in the room .

it was very hard to tell what kind of scrolling you actually wanted. What ScummBuddy was trying to provide you with was script for scrolling the screen across a room for a cutscene, without player interaction.

In the future, please be more specific what kind of behaviour you're actually looking for so we can help you better.

Now, how about this?:

Code: ags

// 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

  //...
}
#1098
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.

Another, and in my opinion, easier way for these kinds of things would be to just add a second "Run script" action to the "Interact hotspot" interaction and put everything after the RunDialog command in there.
#1099
Hey, just got back from my extended weekend in London.
It was good to see you're all just as nice as on the forums. Sorry for my almost total lack of interaction, I'm kinda shy around new people (especially the ones whose language I haven't quite mastered...).
But I had a great time listening to your conversations and I'm looking forward to meeting you all again.

Custard, I totally forgot to thank you again for the tent space, so Thanks man, very much appreciated. :)

And the AGS annual is a great souvenir to have at home. Thanks Matt!
#1100
Quote from: GarageGothic on Thu 30/06/2005 16:48:59Edit 3: Except he said "add", shouldn't you rather subtract?

Hehe, indeed. :)

Edit:

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.

Tracker'd: http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=530
SMF spam blocked by CleanTalk