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

#1301
A user in the german forum reported a problem playing a video from a sub-directory:

  PlayVideo("Videos\x.avi", 1, 0);

works on his comp, other people get

  "File not found or [...] compiled/videos\x.avi"

Changing it to

  PlayVideo("Videos/x.avi", 1, 0);

works on the other comp, but he gets

  "File not found or [...] compiled/videos/x.avi"

He then tested it on various Windows XP systems and on some it works, on some it doesn't.

Any thoughts?
#1302
AGS v2.7 has just been released (see Technical Forum), but the website hasn't been updated yet.
#1303
Please try again and post the exact error message.
And which AGS version are you using?
#1304
Yes, good idea!
#1305
I renamed any such variables from object to objectid, for example, since they do contain the ID of the entity, not a pointer to it.

Here are all names reserved by built-in enum definitions:

bool
TransitionStyle
MouseButton
RoundDirection
RepeatStyle
Alignment
LocationType
CutsceneSkipType
DialogOptionState
eSpeechStyle
eVoiceMode
eCDAudioFunction
FileMode
EventType
BlockingStyle
Direction
WalkWhere

In retrospect, maybe they should have been named AGS_Direction and so on to reduce the probability of them being used as variable names by the user.
#1306
That's right, "Direction" is the name of a built-in enum:

  enum Direction {
    eForwards = 1062,
    eBackwards = 1063
  }

"Direction2" would also work, but it is recommended that you write local variables (declared within a function) in lowercase letters.
So just change all occurrences of "Direction" to "direction".
#1307
This is due to a bugfix.
In AGS v2.62, the clickable z-order was the opposite of the visual z-order, meaning GUI controls that were in front of other GUI controls would not be clickable.

Without knowing the exact layout of your GUI, I'm unable to suggest a workaround. How about making the border part of the GUI background picture?

Disabled GUI controls are still clickable and don't let clicks through to GUI controls beneath. So you may have to wait until a GUIControl.Clickable property is implemented.
#1308
Code: ags

// dialog script

//...

@3 // Hey, check this out!
man: Okay...
run-script 12 // call dialog_request function with value 12
man: Wow, I'm impressed!
return

//...


Code: ags

// global script

//...

function dialog_request(int parameter) {

  if (parameter == 12) { // if "run-script 12" used
    MoveCharacter(EGO, 100, 150);
    MoveCharacterBlocking(MAN, 90, 150);
  }

//else if (parameter == 7) { // if "run-script 7" used
//  do some other stuff
//}

}

//...

#1309
QuoteI have the Object in the corner, but I can't get it to respond when I click on it.

You mean a GUI with a GUI Button on it? Is the button set to "Run script"?
If that's not it, please post the contents of your interface_click function.
#1310
You can also fade in/out manually using the FadeIn/FadeOut commands.
#1311
When an inventory item with an alpha-channelled sprite is active, the cursor hotspot dot isn't drawn. Instead, there's a hole in the cursor graphic where the hotspot dot/sprite should be.
#1312
Cool!
#1313
Then just put

if (GetObjectX(0) == 220) AnimateObject(1, ...); // if shuttle is at x-position 220, start opening hatch

in the while loop.
#1314
(S/he uses my suggestion from this thread.)

Try something like this:

Code: ags

// room script

//...
#define LAMP_BASELINE 50

function repeatedly_execute_always() {
  //...

  if (GetWalkableAreaAt(character[GetPlayerCharacter()].x - GetViewportX(), character[GetPlayerCharacter()].y - GetViewportY()) == CEILING_ID) {
    // if character is on the ceiling's walkable area

    if (character[GetPlayerCharacter()].y - GetViewportY() < LAMP_BASELINE) // if character is above lamp
      SetCharacterBaseline(GetPlayerCharacter(), game.room_height); // draw character in front of lamp
    else // if character is below lamp
      SetCharacterBaseline(GetPlayerCharacter(), 1); // draw character behind lamp

  }
  else // if character is not on the ceiling's walkable area
    SetCharacterBaseline(GetPlayerCharacter(), 0); // reset character's baseline

  //...
}
#1316
PDF, nice!

A good read, but I was surprised it was over after only 6 pages. I was expecting at least an epilogue.

I enjoy reading previews the most, interviews with the creators and so on.

Good job!
#1317
Have you tried another mp3 file?
#1318
Strange, it works fine here with 100 & 80.

Did you import the flipped sprites at the correct resolution ("Import for 640x400 resolution" checkbox)?
Can't think of anything else at the moment.
#1319
QuoteI won't need the code cuase I don't have NPCs that walk on walls...
& it's simpler to revers the LEFT_EDGE & RIGHT_EDGE for the second wall.I won't

Yeah, I know, it was just for future reference in case someone else with a similar problem stumbles upon this thread.

Quote
BTW if you like solving problems what about trying to find a way to walk on cealings! (the walk point of the character is allways at the bottom so I can't find a way to do it)

Hm, how about this:

Make a view with vertically flipped frames of the player character's view and enter it in the walkable area's "Change player view while on this area", then

Code: ags

#define CEILING_ID 2 
#define CEILING_TOP_EDGE 202
#define CEILING_BOTTOM_EDGE 329
#define CEILING_SCALING_TOP 100 
#define CEILING_SCALING_BOTTOM 50 

function repeatedly_execute_always() {
  //...

  if (GetWalkableAreaAt(character[GetPlayerCharacter()].x - GetViewportX(), character[GetPlayerCharacter()].y - GetViewportY()) == CEILING_ID) {
    int scaling = CEILING_SCALING_BOTTOM + (((CEILING_BOTTOM_EDGE - character[GetPlayerCharacter()].y) * (CEILING_SCALING_TOP - CEILING_SCALING_BOTTOM)) / (CEILING_BOTTOM_EDGE - CEILING_TOP_EDGE));
    SetAreaScaling(CEILING_ID, scaling, scaling);

    int slot = GetGameParameter(GP_FRAMEIMAGE, character[GetPlayerCharacter()].view + 1, character[GetPlayerCharacter()].loop, character[GetPlayerCharacter()].frame);
    character[GetPlayerCharacter()].z = -((GetGameParameter(GP_SPRITEHEIGHT, slot, 0, 0) * scaling) / 100);
  }
  else character[GetPlayerCharacter()].z = 0;

  //...
}


I have no vertically flipped Roger sprites handy so I'm unable to check if it looks okay.
#1320
Glad I could help. :)

I think switching the LEFT_EDGE and RIGHT_EDGE values to reverse the scaling is a bit unintuitive, so I came up with this (just for reference):

Code: ags

// room script

// adjust these to your needs:
#define AREA_A_ID 1 // number of walkable area
#define AREA_A_LEFT_EDGE 0 // left edge always < right edge
#define AREA_A_RIGHT_EDGE 150
#define AREA_A_SCALING_LEFT 100 // switch these...
#define AREA_A_SCALING_RIGHT 50 // ...values to reverse scaling
#define AREA_A_CHARID GetPlayerCharacter() // or EGO or GUY etc.

function repeatedly_execute_always() {
  //...

  //--------------------------------------------------
  // Walkable area A horizontal scaling
  //--------------------------------------------------
  if ((character[AREA_A_CHARID].x >= AREA_A_LEFT_EDGE) && (character[AREA_A_CHARID].x) <= AREA_A_RIGHT_EDGE) { // if character is on walkable area A
    int scaling;
    if (AREA_A_SCALING_RIGHT > AREA_A_SCALING_LEFT) // if scaling left-to-right
      scaling = AREA_A_SCALING_LEFT + (((character[AREA_A_CHARID].x - AREA_A_LEFT_EDGE) * (AREA_A_SCALING_RIGHT - AREA_A_SCALING_LEFT)) / (AREA_A_RIGHT_EDGE - AREA_A_LEFT_EDGE));
    else // if scaling right-to-left
      scaling = AREA_A_SCALING_RIGHT + (((AREA_A_RIGHT_EDGE - character[AREA_A_CHARID].x) * (AREA_A_SCALING_LEFT - AREA_A_SCALING_RIGHT)) / (AREA_A_RIGHT_EDGE - AREA_A_LEFT_EDGE));
    SetAreaScaling(AREA_A_ID, scaling, scaling);
  }
  //--------------------------------------------------

  // Walkable area B etc.

  //...
}


Not using GetWalkableAreaAt makes it work with characters not on the screen (NPCs) as well.

Once AGS allows scaling characters directly, I'll come up with something more flexible. Unless of course horizontal scaling is implemented by then.
SMF spam blocked by CleanTalk