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

#1021
Quote from: strazer on Wed 13/07/2005 20:58:27
The room script contains script for every event in this room. If you don't put the command in a function, how should AGS know when to execute it?

You first have to create the event function with the interaction editor.
Press the  "i" button, select when your command should be executed ("Player enters screen (before fadein)" for example), add a "Run script" action and press the "Edit script..." button. A window opens where you can put your command. Close and save.

Now press the "{}" button again and you will see that your command is encapsulated by the event function.
The "{}" button exists so you can quickly see and edit every script in this room and don't have to use the interaction editor every time to access the scripts.
#1022
Was it perhaps the same problem as in this thread?:

Quote from: Pumaman on Thu 28/07/2005 20:46:36It's the region tint that's the problem.

Look at region 0 in room 3, it's set to a Tint of (0,0,0) at 50%

However, because your game is 16-bit and the Roger sprite is 8-bit the tint cannot be applied and he's disappearing instead.

To resolve it, set the region back to have a Light Level of 100%.

If you want to use region tints/lighting, you'll need to import a 16-bit sprite instead of using Roger.

I'll look into adding some sort of check for this in the engine, because the sprite just disappearing is very unhelpful, a warning message at least would be handy.
#1024
16 colors (Manual -> Other Features -> Distributing your game -> Custom icon)
#1025
Check out the "AreThingsOverlapping" function in the manual.
#1026
The "game.inv_activated" variable holds the number of the inventory item the user last clicked on. So you can do
  inventory[game.inv_activated].GetPropertyText("Describe", describe);

(Btw, the noun is "description".)
#1027
Please give more details: Are there some specific situations where none of your ambient sounds play (have you tried other files as well?) or is it specific files that don't work? If so, have you tried playing these sounds normally with the PlaySound function to see if they work at all?
So are you sure it's not the sound files themselves? What file format do your files have? For example, remember that AGS only supports uncompressed PCM wave files.
#1028
Very awesome!

Only thing I've noticed is that the upper part of the front leg gets very dark too suddenly when it's moving back.
I think the dark shadow on the underside of the body wouldn't affect the leg that much since it's attached more to the side of the body.
#1029
Code: ags

// dialog script

//...

@3 // option 3
man: Ok, you can take my hook.
run-script 27
stop

//...


Code: ags

// global script

int thevariable = 0; // define global variable
export thevariable; // export variable for use in room scripts


function dialog_request(int parameter) {

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

    thevariable = 1; // or whatever

  }
//else if (parameter == xx) {

}


Code: ags

// main script header

import int thevariable; // import the variable for use in room scripts


Edit:

If you're talking about GlobalInts, you can set them directly by using the set-globalint GI VAL command, e.g.
  set-globalint 8 1
instead of the run-script command.

You can change the graphical variables used by the interaction editor via the SetGraphicalVariable function.
#1030
Quote from: Geoffkhan on Tue 26/07/2005 00:05:22What I like doing is putting all my direction-independent character animations in the same view as the walking animations. That way no "changeview" is required, I can just go straight to a AnimateCharacter.

The Character.ChangeView function is intended for permanently changing a character's view. For animations, you are supposed to use Character.LockView before animating and Character.UnlockView after the animation has finished.

(Just a quick note to clarify things for any beginners reading this thread.)
#1031
I'm sure it's unrelated, I just wanted to correct Gilbert's statement.
#1032
Quote from: Gilbot V7000a on Tue 26/07/2005 06:29:35bear in mind that variables declared inside of a function are not initialized

They are, as of AGS v2.7
#1033
Strange, works great for me together with the code from your first post.
#1034
Glad I could help. :)
#1035
1) Try using a truetype font like this one.

2) You have to fade manually to do that:

- Set "Room transition style" to "Instant" in the General settings.
- Create a screen-sized GUI, set its background color to 16 (black), its border color to 0, its Z-order to 0 and name it "BLACKSCREEN".
- Put this in the on_event function (menu "Script" -> "on_event"):
Code: ags

function on_event(EventType event, int data) {
  //...

  if (event == eEventLeaveRoom) {
    FadeOut(1); // increase number to increase fade-out speed
    gBlackscreen.Visible = true;
  }
  else if (event == eEventEnterRoomBeforeFadein) {
    SetGlobalInt(44, 1);
  }

  //...
}

- and this in the repeatedly_execute function ("Script" -> "repeatedly_execute"):
Code: ags

function repeatedly_execute() {
  //...

  if (GetGlobalInt(44) == 1) {
    FadeOut(64);
    gBlackscreen.Visible = false;
    Wait(1);
    FadeIn(1); // increase number to increase fade-in speed
    SetGlobalInt(44, 0);
  }

  //...
}


3.) I don't think talking animations are affected by a character's animation speed. You can change the default talking anim speed for all characters by changing the game.talkanim_speed variable in the game_start function ("Script" -> "game_start"):
Code: ags

function game_start() {
  //...

  game.talkanim_speed = 2; // default delay per frame is 5

  //...
}


You could also try clicking "SPD: 0" for all frames of your talking view and entering negative values (-3 for example: 5 + -3 = 2). Don't know if that works though.
#1036
Oh yeah, sorry, the repeatedly_execute function doesn't run when the game is blocked, only repeatedly_execute_always does.
So just try changing
  function repeatedly_execute() {
to
  function repeatedly_execute_always() {
#1037
You can also use the RAD Video Tools to convert a series of pictures into a flic ("List files...", save list, select .lst file, "Convert a file", "Output type...", ...).
#1038
The problem was probably this:

Code: ags

#sectionstart room_a  // DO NOT EDIT OR REMOVE THIS LINE
  // script for Room: Player enters screen (before fadein)
#sectionend room_a  // DO NOT EDIT OR REMOVE THIS LINE


As you see the function header
  function room_a() {
and the closing
  }
are missing. You probably accidently deleted it.

To remove a room function, always delete the corresponding "Run script" action in the interaction editor instead of just deleting the code from the room script. Otherwise the "Run script" action is linked to a non-existing function which can lead to these kind of problems.
#1039
Or try this:

Code: ags

function repeatedly_execute() {

  if (IsOverlayValid(Over)) {
    if (IsInterfaceEnabled()) GetLocationName(mouse.x, mouse.y, Name);
    else StrCopy(Name, "");
    SetTextOverlay(Over, mouse.x-25, mouse.y-18, 100, 1, 15, Name);
  }

}
#1040
QuoteI'm using  2.63 beta .

I guess the Character.PreviousRoom property is only available since the final AGS v2.7.
Try player.prevroom then. Why are you using this old beta anyway?
SMF spam blocked by CleanTalk