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

#1381
Okay, I'm still not sure where you've put the different parts of your code.
You probably want to set it up like this:

Code: ags

  // script for object: Interact with object

  SetGlobalInt(83, 1);
  object[4].Visible = true;
  object[4].SetView(54);
  object[4].Animate(0, 3, eRepeat, eNoBlock);
  character[JUAREZ].ChangeView(55);
  character[JUAREZ].SpeechView = 55;
  character[JUAREZ].SetIdleView(56, 0);

  SetTimer (1, 80); // start timer that expires in 2 seconds


Code: ags

  // script for room: Repeatedly execute

  if (IsTimerExpired(1) == 1) { // if the timer is expired (will only be true once, see above)
    object[4].Visible = false;
    SetGlobalInt(83, 0);
    DisplaySpeech(JUAREZ, "Oh.  It's back to normal.  That was strange.");
  }
#1382
Quote from: Manual
IsTimerExpired (int timer_id)
(...)
Note that this function will only return 1 once - after that, the timer is placed into an OFF state where it will always return 0 until restarted.

And where have you put your code?
If SetTimer is in rep_ex too, you re-set the timer every game loop, so it won't expire.
#1383
DC, look at the dates. I've been a moderator for some time now.
But thanks for your vote. ;)
#1385
Quote from: GarageGothic on Sat 16/04/2005 11:46:43It turns out it was caused by a (possible?) gui editor bug in abbreviating long function names.

My textbox names were quite long to begin with ("txtReplaceDescription" was one), and when the editor autocreated the script, the function was abbreviated as "txtReplaceDescription_Activa". However, in the "Run Script" selection, it had been titled "txtReplaceDescription_Activat". So the correct script was never run. This also explains why one textbox, with the shorter name txtSaveDescription, worked while the others didn't.
#1386
QuoteI take it that the command to set the loop for mouse cursors is a no, then?

That's up to CJ, let's see what he says.
Personally, I'd like that, but it depends on how much trouble it is to implement. I guess choosing the loop could be done with an (optional) parameter for Mouse.ChangeModeView.
Btw, the view limit has been increased from 400 in AGS v2.62 to 600 in v2.7.
#1387
The problem is probably that the mouse cursor is set repeatedly, thus always re-displaying the first frame of the view. Try this:

Code: ags

  if ((GetCharacterAt(mouse.x, mouse.y) == 1) && (GetCursorMode() != 8) {
    SaveCursorForLocationChange();
    SetCursorMode(8);
  }


There are already two tracker entries for your suggestions:
- "Mouse moves over object" event (guess we need one for characters too)
- Allow mouse cursor loop choice
#1388
QuoteI guess I might have to find out what sound card I've got.

That would help, yes. ;)

Maybe try installing the latest DirectX first.
#1389
Try switching/turning off sound output in the game setup, installing latest sound drivers and installing latest DirectX.
#1390
Glad I could help. :)
#1391
I don't think this is covered in the BFAQ:

http://www.adventuregamestudio.co.uk/yabb/index.php?topic=20212.msg247842#msg247842


Edit by TerranRich:
UPDATED on April 14th, 2005 - Thanks strazer!
#1392
No, music files go in the game folder.

Are you sure the files are named correctly? They must be called music1.mid, for example. Note that if you have Windows set up to suppress file extensions (the default), the file might actually be called music1.mid.mid which doesn't work.
#1394
I use a Linux program to view the chm file and there's no "Locate" button, but if I click on "unhandled_event" from the Index, it takes me to the correct page (Reference -> Scripting event reference). Strange.

Edit:

Speaking of the manual, I've found a few things regarding v2.7 when I read through it (again) the other day:

Tutorial -> Setting up the game -> Inventory:

"All inventory commands always operate on the current player character."

Tutorial -> Setting up the game -> Importing your own sprite graphics:

"Go to the Sprite Manager pane, under Visual Settings."

"At present you cannot move sprites between folders so they are stuck in the folder in which you create them. (...) Also, you cannot delete folders."

Tutorial -> Setting up the game -> Animations:

"Go to the "Views" pane, under Visual Settings."

Tutorial -> Setting up the game -> Characters:

"The "No interaction" checkbox..." (=> "Clickable")

"(...) the script name may only contain letters A-Z."

Missing:

- "Ignore room area lighting"
- "Do not turn before walking"
- "Diagonal loops"
- "Adjust speed with scaling"
- "Solid"

Tutorial -> Setting up the game -> Conversations:

"You can have as many lines like this as you want within the script." (Dialog script message limit is 3000?)

Tutorial -> Setting up the game -> Game options:

"Conversation on GUI" (=> "Dialog options on GUI")

"Player can't skip speech text" (=> "Skip speech" dropdown menu)

"Buttons off when disabled" (=> "When interface disabled" dropdown menu?)

"Always display as speech" (=> "Always display text as speech")

"Speech style" (QFG4-style not explained)

"No special walk-mode processing" (=> "Don't automatically move character in Walk mode" (Wouldn't "player" be more precise?))

"Use 320x240 letter-box mode" (=> "Use letterbox (320x240 / 640x480) resolution")

"Don't modify inventory cursor" (=> "Don't use inventory graphics as cursors")

"Don't automatically lose inventory" (=> removed)

"Don't scale up fonts" (=> "Don't scale up fonts at 640x400")

"Split resource files" (=> "Resources split every Mb")

"(...) clicking an inventory item will call your on_mouse_click function with LEFTINV or RIGHTINV (...)" (=> eMouseLeftInv / -RightInv)

"(...) WHEELNORTH and WHEELSOUTH (...)" (=> eMouseWheelNorth / -South)

Missing:

- "Use anti-glide mode"
- "Room transition style"
- "Save screenshots in save games"
- "Enforce object-based scripting"
- "Left-to-right operator precedence"
- "Maximum possible score"

Tutorial -> Advanced room features -> Character scaling:

"(...) by checking the "ignore scaling" box in that character's properties." (=> "Ignore room area scaling")

Tutorial -> Advanced room features -> Scrolling:

"(...) the picture could either be a scrolling room at 320x200, or a single non-scrolling screen at 640x480."
(Couldn't that be determined automatically depending on the game resolution, to avoid confusion? Am I missing something here?)

Tutorial -> Advanced room features -> Animating background scenes:

"There is a limit of 15 objects per screen, (...)" (=> I say get rid of the number and just say there's a limit so you won't have to update that part again later)

Tutorial -> Advanced room features -> Lighting effects:

"(...) depending on the individual character "Ignore lighting" and object "Use lighting" settings (...)" (=> "Ignore room area lighting" & "Use region tints and lighting")

That's it for now. :)
#1395
Something like this?:

In the village room's repeatedly_execute interaction:

Code: ags

  // script for room: repeatedly execute

  if (GetGlobalInt(THEGLOBALINTNUMBER) == 0) { // if quest is not solved
    if ((character[PEOP1].room == character[GetPlayerCharacter()].room) && 
       (character[PEOP2].room == character[GetPlayerCharacter()].room) && 
       (character[PEOP3].room == character[GetPlayerCharacter()].room))
    { // if all people are in this room
      FollowCharacter(PEOP1, -1); // people don't follow you anymore
      FollowCharacter(PEOP2, -1);
      FollowCharacter(PEOP3, -1);
      DisplaySpeech(VILLAGER2, "Thank you!"); // people thank you
      SetGlobalInt(THEGLOBALINTNUMBER, 1); // set quest solved
    }
  }
#1396
Quote
I was just hoping there was a more "fool-proof" alternative so that the person using the code wouldn't have to worry about accessing the wrong dialog.

Instead of letting the user directly modify the array, I think the best way would be to provide custom functions in which you can check the parameters first.

In AGS v2.7, this could be done with a script module and static functions:

Code: ags

// module script

static function ScrollingDialog::SetOption(int dialog, int option, bool enabled) {

  if (dialog > NUMTOPICS) AbortGame("Invalid dialog specified: '%d'.", dialog);
  //...more checks

  //...the code

}


Code: ags

// module header

struct ScrollingDialog {
  import static function SetOption(int dialog, int option, bool enabled);
  //...more stuff
}
#1397
Quote
Well, this is normal behaviour for Display() boxes, so I would say for consistency it should stay as is.

But in dialogs, the mouse cursor switches to the pointer mode (at least when the dialog options are displayed) so in my opinion the consistent thing would be to display the pointer cursor.
#1398
You're welcome. :)
#1399
Code: ags

// script for hotspot: Interact with hotspot

  if (IsObjectOn(THEOBJECTNUMBER)) {
    ObjectOff(THEOBJECTNUMBER);
    DisableHotspot(THEHOTSPOTNUMBER);
  }
  else {
    ObjectOn(THEOBJECTNUMBER);
    EnableHotspot(THEHOTSPOTNUMBER);
  }
#1400
Code: ags

// script for hotspot: Interact with hotspot

  if (IsObjectOn(THEOBJECTNUMBER)) ObjectOff(THEOBJECTNUMBER);
  else ObjectOn(THEOBJECTNUMBER);
SMF spam blocked by CleanTalk