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

#1501
Quote from: strazer on Mon 25/10/2004 00:19:08
Don't monitors usually save the screen size and position for each resolution/refresh rate combination seperately?
To me it happens when I start a game for the first time that uses a combination that I haven't yet adjusted the screen for. So I adjust my monitor and then all games that use that resolution/refresh combo look fine.
My monitor automatically saves the settings, maybe you have to save it yourself on yours?
#1503
 ;)

Edit:

Btw, you can use repeatedly_execute_always now to make it keep counting during blocking calls.
#1504
Have you tried this (Technical Archive)?
#1505
Code: ags

  //...
  else if (parameter == 3) {
    MoveCharacter (GHOST, 190, 150);
    WaitKey (80);
    NewRoomNPC (GHOST, -1, 25, 160);
    StartCutscene(1);
    Display ("Here is some text.");

    SetGlobalInt(1, 1);

    NewRoom(3);
  }
  //...


Code: ags

  // script for room 3: Player enters screen (after fadein)

  if (GetGlobalInt(1) == 1) { // if global variable 1 is 1

    Display ("Here is some more text.");
    Wait (40);
    FaceLocation (NIK, 150, 160);
    TintScreen (100, 50, 0);
    Display ("More text.");
    Display ("Text.");
    Display ("Guess.");
    MoveCharacter (NIK, 5, 170);
    MoveCharacter (NIK, 160, 160);
    Display ("More text.");
    DisableHotspot(2);
    MoveCharacter (NIK, 92, 155);
    SetCharacterView (NIK, 5);
    AnimateCharacter (NIK, 0, 5, 0);
    ReleaseCharacterView (NIK);
    SetCharacterView(NIK, 9);

    EndCutScene();

    SetGlobalInt(1, 0); // reset variable's value
  }
#1506
Although you can define custom script variables, it's easier to use the predefined GlobalInts for this kind of thing.

There are 500 built-in global variables available, from index 0 to 499.
You can set their values with SetGlobalInt and retrieve them with GetGlobalInt, like this:

Code: ags

  // some interaction

  SetGlobalInt(28, 1); // set global variable 28's value to 1 (default value is 0)
  NewRoom(3); // go to room 3


Code: ags

  // script for room 3: Player enters screen (after fadein)

  if (GetGlobalInt(28) == 1) { // if global variable 28 is 1
    // do stuff
    SetGlobalInt(28, 0); // reset variable 28's value
  }
#1507
NewRoom/Ex are delayed-response commands, meaning they get executed after the script finishes.
So you have to put the stuff that should happen in the other room into the "Player enters screen (after fadein)" interaction of that room. You can set a global variable beforehand and make these commands execute only when this variable is set.
#1508
Quotedo I have to add somthing so he'll import the variable too?

Depends on where the variable is set. Character interactions are handled in the global script, so if you set it there, you don't even need to export it.
If you want to set it within the interaction of an object or hotspot, you need to export it from the global script and import it in the room script as I have shown above.

As for the dialog_request function, do you want this?:

Code: ags

function dialog_request(int parameter) {

  if (parameter == 1) { // if "run-script 1" used

    if (paint == 0) {
      MoveCharacter (TROY,246,146);
      while (character[TROY].walking) Wait(1);
      SetCharacterView(TROY,4);
      AnimateCharacter(TROY,0,0,0);
      while(character[TROY].animating) Wait(1);
      ReleaseCharacterView(TROY);
      SetCharacterView(PEASANT,2);
      AnimateCharacter(PEASANT,0,0,0);
      while(character[PEASANT].animating) Wait(1);
      dead = 1;
    }
    else if (paint == 1) {
      MoveCharacter (TROY,246,146);
      while (character[TROY].walking) Wait(1);
      SetCharacterView(TROY,7);
      AnimateCharacter(TROY,0,0,0);
      while(character[TROY].animating) Wait(1);
      ReleaseCharacterView(TROY);
      SetCharacterView(PEASANT,2);
      AnimateCharacter(PEASANT,0,0,0);
      while(character[PEASANT].animating) Wait(1);   
    }

  }
  else if (parameter == 2) { // if "run-script 2" used

    MoveCharacter (PEASANT,500,163);
    while (character[PEASANT].walking) Wait(1);     
    NewRoomNPC(PEASANT,2,100,50); 

  }

}
#1509
QuoteDo I have to write something additional in it like: its not my work, its from chris Jones! (In officially style for sure)

Definitely make sure to mention that this a third-party translation and that there's no official support in german. We don't want CJ to get flooded with german-language requests.
I would also change any links to the official forums to Adventure-Treff.
#1510
Where have you declared the paint variable?
To be able to access a global variable in room scripts, you have to export it from the global script and import it in the main script header or the room script. If you declare the variable in the main script header, you effectively have several seperate variables, one in the main global script and one for each room.
So do this:

Code: ags

// main global script

int paint;
export paint;


Then, if you need to access the variable in all rooms:

Code: ags

// Main script header

import int paint;


Or import it only in the rooms where you need it:

Code: ags

// room script

import int paint;
#1511
According to my WhoIs query, you're the owner of terran-x.com.
When I switched providers years ago, I simply had to send both the old and my new provider a so-called "KK-Antrag" so the domain would be transferred.
A similar thing should be possible for non-.de domains. I say ask your provider first before getting a new domain name and causing dead links around here.
#1512
Just a few notes:

Code: ags

//declare local vars
  textid = 0;


You don't declare this variable anywhere in this function, otherwise it would have to be
  int textid = 0;
And since you set its value with CreateTextOverlay anyway, why initialize it to 0 at all?

If you declare it outside of the function, it's a global variable and not a local one.
This concerns almost all variables in this function. Where do you declare "line", "length", "i"?
Unless you need a variable in other functions, there's no reason to make it a global one.

Also, you use a lot of redundant variables.

Here is a cleaned up version of your function:

Code: ags

function TypeLineInvis (string text, int xpos, int vpos, int width, int delay, int wait) {

  if (IsGamePaused()==0) {

    StopMoving(EGO);
    SetTextWindowGUI(31);

    string displayedline; // declare string holding the letters to display
    StrCopy(displayedline, ""); // initialize string

    int overlay_id = CreateTextOverlay(xpos, 100, 400, 1, 1, displayedline); // create empty text overlay

    int i = 0; // declare loop counter
    while (i < StrLen(text)) { // loop for each position of the supplied string

      StrFormat(displayedline, "%s%c", displayedline, StrGetCharAt(text, i)); // stick letter from current position "i" to end of string "displayedline"
      SetTextOverlay(overlay_id, xpos, vpos, width, 1, 1, displayedline); // set text overlay to "displayedline" string
      if (StrGetCharAt(text, i) != ' ') PlaySound(1); // if letter is NOT a space, play 'tick' sound

      Wait(delay); // wait for specified game loops before looping to next letter
      i++; // increase loop counter: loop to next position
    }
    // loop ends here: all letters displayed

    WaitKey(wait); // wait until specified game loops elapse or player presses a key

    RemoveOverlay(overlay_id); // remove the text overlay
//  Wait(5); // what for?

  } // endif (IsGamePaused() == 0)

}


Hope this helps.
#1513
1. The safest way is this:

Code: ags

function teleport(int charID, int newX, int newY) {
  if (charID == GetPlayerCharacter()) // if the character is the player character
    NewRoomEx(character[GetPlayerCharacter()].room, newX, newY); // put player in current room at new coordinates
  else // if character is a non-player character (NPC)
    NewRoomNPC(charID, character[GetPlayerCharacter()].room, newX, newY); // put NPC in current room at new coordinates
}


These are room coordinates. If you really want to pass screen coordinates, add GetViewPortX/Y to the newX and newY variables first.

2. Sure:

Code: ags

// room script

int IsPlayerInBox = 0; // declare room variable storing if player has himself sealed in box


function object0_a {
  // script for object0: Interact with object

  if (IsPlayerInBox == 1) { // if player is sealed in box
    // code for player getting himself out of box
    IsPlayerInBox = 0;
  }
  else { // if player is NOT sealed in box
    // code for player sealing himself in box
    IsPlayerInBox = 1;
  }

}


function on_mouse_click() {

  if (GetCursorMode == MODE_LOOK) { // if mouse is in look mode
    if (IsPlayerInBox == 1) { // if player is sealed in box
      DisplaySpeech(GetPlayerCharacter(), "I can't see anything.");
      ClaimEvent(); // don't run global on_mouse_click afterwards (i.e. don't run any look interactions)
    }
  }

}
#1514
You have probably used a single = instead of ==.
Use one = to assign a value, i.e.
  variable = 12;
and two == to do a comparison, i.e.
  if (variable == 12) {

If you still have problems, please post the actual code you're using.
#1515
Quoteonce the cursor changes to the inventory item graphic, the darned GUI won't move so i cant click on the payphone

If you're using the built-in inventory gui, can't you just click on the "OK" button to close it?
#1516
General Discussion / Re: Back to the Future
Wed 16/03/2005 17:32:18
I picked this particular example because it actually ruins the scene.

If you remember, Doc gives him that fancy jacket and Marty complains that the sleeves are too long. Doc reaches for a button on the jacket and the sleeves adjust themselves.

Another example is in BTTF3 when you see Marty for the first time in his cheesy cowboy outfit and in the uncorrected versions you don't see his modern sneakers.

Go here and here for more comparison pictures.
#1517
General Discussion / Re: Back to the Future
Wed 16/03/2005 17:13:08
On a side note, if you plan to purchase the DVD set, be sure to get the corrected version:



#1518
Well, since the parameter is an integer, there are "only" 2,147,483,647 numbers you can use (double that if you can pass negative numbers, haven't checked).
Should be sufficient, no? ;)
#1519
Thanks, the whole Dima Software site was down when I was trying to download it.
The above script compiles and runs fine here now.

Any luck DrSnark?
#1520
Code: ags

  CursorMode prevmode = mouse.Mode; // save current cursor mode
  mouse.Mode = 7; // change to Wait cursor mode
  mouse.UseModeGraphic(prevmode); // override cursor graphic to look like the previous one
  player.Say("I say some stuff."); // <- problem: Wait cursor reverts to default
  mouse.UseDefaultGraphic(); // restore Wait mode graphic to default
  mouse.Mode = prevmode; // change to previous cursor mode


It seems the Say command changes to the Wait cursor mode, even if it is already the current cursor mode, thereby restoring the cursor mode graphic, so the Wait cursor is displayed as usual.
Strangely, if I use "Wait(40);" instead of the Say command, it works like intended.

Shouldn't the Say command leave the Wait cursor graphic alone?

(I could of course use mouse.ChangeModeGraphic, but how do I return the sprite slot of the current cursor mode other than (non-universal) if-clauses? Seems like a mouse.Graphic property would be needed for this. And what about animated mouse cursors?)

Edit:

I just realized I could use SayBackground and Wait together, but I really need Say because I want all other background speech to be removed.

Edit 2:

Spelling error in manual: SetGlobalString example: contian -> contain
SMF spam blocked by CleanTalk