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

#1981
You first have to create the functions that will contain your code with the Interaction Editor (the "i" button). Add a "Run Script" action for "Player enter screen (before fadein)" for example and click the "Edit script..." button. You can't create the built-in functions yourself. The "{}" button is for quickly editing the code afterwards.

But you can set a walkable area's scaling directly in the room editor. Select your walkable area in the "Areas" section, check "Use continous scaling" and enter the appropriate values.
#1982
Ok, thanks for the correction.
Shouldn't it now be

if (mouse.y >= (system.viewport_height - 51)) {
  SetGUIPosition(2, mouse.x, system.viewport_height - 51);
}

though?
#1983
It seems mouse coordinates are always in the 320-res system, so you don't need to divide them by 2.
Replace (mouse.x/2) with just mouse.x and (mouse.y/2) with mouse.y
Sorry for the confusion.
#1985
I haven't bothered checking the whole script, but at least one brace is missing:

...
if (interface==3)
{
// if Restore interface
     if (button==0)
    {
        // if cancel is pressed
        InterfaceOff(3);
        // Close interface
    }
      else
     {
...
#1986
I don't think that's directly possible at the moment.

If the GUI has a fixed position, here is a workaround that could work:

Code: ags

// main global script

function on_event(int event, int data) {
  if (event == GUI_MDOWN) { // if clicked on A GUI (any mouse button, combine with IsButtonDown to allow/disallow buttons)
    if (data == YOURGUINAMEHERE) { // if clicked on THIS gui
      if ( ((mouse.x/2) >= (XCOORDINATEOFGUI+XCOORDINATEOFLABEL)) && ((mouse.x/2) <= (XCOORDINATEOFGUI+XCOORDINATEOFLABEL+WIDTHOFLABEL)) && ((mouse.y/2) >= (YCOORDINATEOFGUI+YCOORDINATEOFLABEL)) && ((mouse.y/2) <= (YCOORDINATEOFGUI+YCOORDINATEOFLABEL+HEIGHTOFLABEL)) ) { // mouse is over label
        // do stuff
      }
    }
  }
}


I probably screwed some braces there, but you'll see.
Replace the uppercase stuff with the appropriate values. I like to use + to make the code easier to fix if one of the values changes (e.g. you move label around).
#1987
mouse.y returns the position of the mouse cursor on the screen, not the room.
So you could use screen.viewport_height instead of game.room_height.

Edit:

Or is it system.screen_height?
Try this:

if (mouse.y >= (system.screen_height - (51*2))) {
  SetGUIPosition(2, mouse.x, game.viewport_height - 51);
}
#1989
Actually you would be better off using the second suggestion as it is how it's intended to work and it lets you use the idle view properly.
What you have now is a workaround that could cause problems later on. Better do it right from the start.
If you don't want to draw seperate standing sprites for each direction (would look better though) you can just use loop 0's standing sprite as first sprite for each direction.
#1990
QuoteAs I said, only commercial video drivers have really good 2D acceleration. NVidia and ATi's drivers and the free ones generally do not.

Just to let you know, I've recompiled the kernel with MTRR support and installed the nvidia module from the source package.
Not sure what exactly the problem was, but now everything runs perfect, even AGP is enabled. :)
#1992
I have bookmarked this thread and will move it there once it has faded beyond the front page.
#1993
Quotehow do i get more than one drop down from the tree to have 2 commands under Player enters screen (after fadein) ?

Right-click on the parent and choose "New action...".

QuoteOk ive set character view under the room settings interations, but it says under it 'Release character view to release it' how do i do that......or do i have to use SetIdle Animation to start the loop running ?

Idle animations are automatically triggered if a character does nothing for a specified period of time (default 20 sec).
Better start a normal animation and have it repeat. I see that option is not available from the interaction editor, so you have to use scripting. Don't worry, it's not difficult:

Say you want to continously animate character LADY putting flowers in a vase when the player enters the room.

Room interaction editor -> Player enters screen (before fadein) -> "Run script" ->

Code: ags

SetCharacterView(LADY, 3); // view 3 is the view with the animation
AnimateCharacter(LADY, 0, 0, 1); // continously animate LADY using loop 0 of her current view (3)

(Modify the names and numbers to your needs and check the manual for the parameters you can use.)

This way, the lady is continously putting flowers in the vase in the background while the player can walk around the room.
Use "Character - Release character view" or the ReleaseCharacterView function to stop the animation.

Now, if you don't want to adjust the frame widths, use SetCharacterViewEx instead of SetCharacterView to align the frames to a particular side. Check the manual!

Edit:

Thinking about it, using the idle view is a good idea. Adjust the frame widths and use an idle delay of 0 to have her animate continously when she's not doing anything else.
#1994
If you have frames of different width, each one will be centered across the character's x coordinate.
You could make each frame of the animation the same width or align all frames to one side. Use SetCharacterViewEx for this.
#1995
General Discussion / Re: midi converter
Thu 09/12/2004 13:59:41
Quote from: jetxl on Thu 09/12/2004 09:35:22
How about a s3m to mod/xm converter since s3m doesn't work in ags anymore.

My Google search came up with "Scream Tracker". Have you tried that?
#1996
Quoteis there around a gui file like this?

You may find something here:
http://www.freewebs.com/skimbleshanks/templates.htm
Put the .agt files in your AGS editor directory and start a new game.

Quotehow can i define a hotkey?

Check the on_key_press function in the global script (Script -> on_key_press) and the manual for keycodes (Reference -> ASCII code table).
#1997
QuoteI still can't stop the text appearing in it's default place before being moved.

Why don't you put the first MoveOverlay line in the DamageChar function then?
#1998
QuoteThe way it works now, option 2 in topic 2 shows up from the start of the conversation.

Remove topic 2 option 2's "Show" checkbox...

Edit:

Yeah, do as Einoo says or use GlobalInts:

Code: ags

// dialog script file for topic 1
@1 // How are you?
char1: I'm fine but...
return
@2 // But what?
char1: Well, my goldfish died. And I'm sad.
set-globalint 333 1
return
//...


Code: ags

// dialog script file for topic 2
@1 // Hello character2
char2: Hi.  Whats new?
run-script 77
return
@2 //Character1's goldfish died. He's sad.
char2: ...
return
//...


Code: ags

// main global script

function dialog_request (int parameter) {
  if (parameter == 77) { // run-script 77 used from dialog script
    if (GetGlobalInt(333)) { // if talked to char1
      SetDialogOption(2, 2, 1); // turn on dialog option 2 in topic 2
    }
  }
}
#1999
Yes, at the moment you would have to use the dialog_request function:

Code: ags

// dialog script file for topic 1
@1 // How are you?
char1: I'm fine but...
return
@2 // But what?
char1: Well, my goldfish died. And I'm sad.
run-script 77 // turn on dialog option 2 in topic 2
return
//...


Code: ags

// main global script

function dialog_request (int parameter) {
  if (parameter == 77) { // run-script 77 used from dialog script
    SetDialogOption(2, 2, 1); // turn on dialog option 2 in topic 2
  }
}


There's already a tracker entry to do this from the dialog script directly.
#2000
Do you mean you want to disable diagonal walking completely?
If so, it's on the tracker.
SMF spam blocked by CleanTalk