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

#961
1.) Yes, both.
Check out the "Speech style", "Dialog options go upwards on GUI" and "Dialog options on GUI" settings in the General settings.

2.) I've played around with it, but it's pretty slow since RawDraw functions have to be used. The plugin is able to draw on the screen directly every game cycle. So it's possible, but very slow. The speed issues have been discussed here.

Here's an excerpt from a private discussion I had with the plugin's author, Scorpiorus, more than a year ago:

Quote from: Scorpiorus
QuoteI was wondering if it is possible to code rain without using a plugin?
Yes, the only limitation is that you can draw only onto background. :P

QuoteI don't know anything about how the plugin system works. Do you use AGS built-in function to draw the raindrops on the screen?
The plugin uses Allegro library and draws ontop of the screen.

QuoteI've done a simple test moving a single raindrop with repeatedly_execute and RawDrawImage. Is it worth pursuing or shouldn't I bother?

Maybe you could give some hints on how you move all those raindrops?
Sure, here is  the basic script code. I used RawDrawLine() but it can be RawDrawImage() as well

// room script file

//the max number of drops:
#define DROPS_MAX 100

// Drop struct
struct TDrop {
  int x;   // x co-ordinate
  int y;   // y co-ordinate
  int speedX;   // x-speed
  int speedY;   // y-speed
  int baseline;   // drop baseline
};

// declaring an array of drops:
TDrop Drops[DROPS_MAX];

//initialization:
function Drops_Initializate() {
  int i=0;
  while (i<DROPS_MAX) {
    
    Drops.x =  Random(320);   // set them along the screen width and...
    Drops.y = -Random(500);   // ...off top of the screen
    Drops.speedX = 0;    // let it be 0
    Drops.speedY = Random(7); // falling speed 0-7
    Drops.baseline = 180+Random(20); // baseline 180-200
    
    i++;
  }
}


// for repeatedly execute
function Rain_RE() {
  
  //clear screen:
  RawRestoreScreen();
  
  int i=0;
  while (i<DROPS_MAX) {
    
    // move drop:
    Drops.y += Drops.speedY;
    // if drop has just landed reinit it's y-coordinate (off the screen)
    if (Drops.y > Drops.baseline) Drops.y = -Random(500);
        
    // set color
    RawSetColor(15);
    // draw drop
    RawDrawLine(Drops.x, Drops.y, Drops.x, Drops.y + 5);
        
    i++;
  }
    
}



function room_*() {
  // script for room: Repeatedly execute
    
  Rain_RE();
}

function room_*() {
  // script for room: Player enters screen (after fadein)
  
  RawSaveScreen();
  Drops_Initializate();
  
}



QuoteI suppose you've used a struct & an array too to store and retrieve each raindrops properties?
But I still haven't got the mechanics quite right. Which properties do I need and how do I incorporate wind and the like? Could you give me the formulas you've used or give me a link to a tutorial?
Yeah, basically you have a struct with all the properties you need. To add a wind effect you can adjust speedX variable. Snowflakes drifting is a bit harder as the plugin uses floating point numbers and appropriate sin() and cos() functions to handle that sort of thing.

For example the drifting formula is:

Drop.X = Drop.x0 + DriftRange * Sin(DriftSpeed * Drop.y);


Drop.x - result X coordinate
Drop.x0 - init x coordinate (should be set once and not modified later)
DriftRange - well, just an amplitude of drifting
DriftSpeed - frequency of drifting
Drop.y - current Y-coordinate (can be replace with some timer variable).

Just to get you started. :)
#962
AGS Beginners FAQ

Edit: Updated link
#963
Sorry for the bump.

Quote from: Pumaman on Wed 03/08/2005 18:12:33
Ok, well how would people like volume control to work?

I just wanted to say that I hope you won't drop the idea because of lack of feedback. Your solution sounds good to me and I'm sure most people agree.

Anyway, I have updated the tracker entry with your comments.
#964
Would it be possible to make mouse.SaveCursorUntilItLeaves also restore the mouse cursor when leaving a GUI?
It would simplify things like changing the mouse cursor over a GUI so we could do something like

Code: ags

function repeatedly_execute() {

  if (GUI.GetAtScreenXY(mouse.x, mouse.y) == gSomegui) {
    mouse.SaveCursorUntilItLeaves();
    mouse.Mode = eModePointer;
  }

}
#966
Cool! You're welcome. :)
#967
What do you mean? The example above is for a click on a GUI, not a GUI Control.

For GUI Control click functions, the first parameter is the pointer to the GUI Control that was clicked, true.
#968
Advanced Technical Forum / Re: AGS 3D
Thu 01/09/2005 06:24:05
I'm not a big fan of #defines, so I would probably do

enum Ags3d_Filters {
  eAgs3d_Filter_Visible = 1,
  eAgs3d_Filter_Solid = 2,
  eAgs3d_Filter_Ground = 4,
  eAgs3d_Filter_All = 7
};

instead of

#define AGS3D_FILTER_VISIBLE 1
#define AGS3D_FILTER_SOLID 2
#define AGS3D_FILTER_GROUND 4
#define AGS3D_FILTER_ALL 7

Works better with the autocomplete, too.

Also, I think you should name the function parameters better, since they're the ones that the autocomplete shows:

  import static function SetCharacterPosition(int i, float x, float y, float z);

becomes

  import static function SetCharacterPosition(int charid, float x, float y, float z);

But I would even suggest making it a character pointer instead:

  import static function SetCharacterPosition(Character *thechar, float x, float y, float z);

since they're used primarily throughout the new AGS scripting style. (And you can still access the char's number in the function with the .ID property.)
This way users don't get confused that they suddenly have to use MIKA instead of cMika.

Edit:

And the doc still shows AGS 2.7 as minimum requirement. Isn't it v2.71?

Edit 2:

Btw, if you go the enum route, changing "int filter" in the parameter list to "Ags3d_Filters filter" pops up the autocomplete list the moment you enter the comma. More convenient methinks.
#969
This game is pretty old. Several bugs might have been fixed in AGS since.

Do other AGS games work normally? How about other games and applications?

Possible solutions:

- Change sound devices via the game setup
- (Re-)Install (newer) sound card drivers
- (Re-)Install (newer) DirectX
- Run the game using a later AGS version (see also this and this)

Edit:

To see what AGS can do, take a look at some recent AGS award winners.
#971
I always wait for the next beta and its features before adding anything to the tracker so I totally forgot about these:

Quote from: Pumaman on Thu 16/06/2005 20:07:24
Quote2.) Is there currently a way to determine if an object has "Use walkable area scaling" enabled or not? If not, may I suggest Object.IgnoreScaling.

Not currently, but it would make sense to add that property so that it's consistent with characters.

Tracker'd: http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=526

Quote from: Pumaman on Sun 17/07/2005 13:20:23
QuoteSo, I was wondering, would it be possible to add an option to remove the alpha channel when creating the dynamic sprite (thus downgrading it from 32 to 24 bit)?

Sounds reasonable to me.

Tracker'd: http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=527

Quote from: Pumaman on Thu 21/07/2005 20:06:12
Quote from: monkey_05_06 on Tue 19/07/2005 06:08:14I love the new String functionality...but...I think while you're working on it you should make them capable of being implemented in structs.

I'd like to allow pointers in structs, we'll have to see what else comes up.

Tracker'd: http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=528
#972
Glad I could help. :)
#973
Oops, my bad, it's eEventGUIMouseDown. :)

Btw, these events can be found in the manual under Reference -> Scripting event reference.
#974
The Rumpus Room / Re: Abandonware
Wed 31/08/2005 23:35:03
Lure Of The Temptress comes to mind.

As for legal abandonware in general, here's a nice forum thread at Neowin.net listing a lot of free stuff: http://www.neowin.net/forum/index.php?showtopic=65246
#975
(The tutorial mentioned is here.)

In AGS v2.7 each GUI button can have its own event function, so you don't have to put everything into the interface_click function.

Just double-click the button to edit the button's script (you may have to give the button a name first) and enter
gYourguiname.Visible = false;
to turn the GUI off and
gYourguiname.Visible = true;
for the other button to turn the GUI on.
#976
What's the problem? Do you get an error message? Which one?

There's no need to "set up" anything, just copy the above script into the module script and change the btnMyButton/btnMyOtherButton names to your GUI button names.
#977
Hey, nice broken sword icon! Is that part 3?
Could you make a good-quality screenshot or even send me the exe with the icon in it so I can extract it? I'd like a prettier one for my part 1. :)
#978
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=20249

If you really need the text to be displayed on a GUI label, try this (AGS v2.7):

Code: ags

// global script

function SaySpecial(Character *thechar, string message) {
  YourGUILabelName.TextColor = thechar.SpeechColor;
  YourGUILabelName.SetText(message);
  thechar.SayAt(0, 0, 0, message); // say text but hidden (width 0), so voice speech plays
  YourGUILabelName.SetText("");
}


Code: ags

// script header

import function SaySpecial(Character *thechar, string message); // make function useable in room scripts as well


Code: ags

  // some interaction script

  SaySpecial(cSomelady, "&1 Hello sir!");
#979
If I understand you correctly, you could try using the on_event function:

Code: ags

// module script

function on_event(EventType event, int data) {

  if (event == eEventGUIMouseDown) { // if a mouse button has been pressed down
    GUIControl *thecontrol = GUIControl.GetAtScreenXY(mouse.x, mouse.y); // get GUI control under mouse cursor
    if (thecontrol != null) { // if a GUI control is there

      if (thecontrol.AsButton == btnMyButton) { // if it's this button
        // do your stuff
      }
//    else if (thecontrol.AsButton == btnMyOtherButton) { // if it's that button
        // do some other stuff
//    }
      // and so on

    }
  }

}


Edit: eEventMouseDown -> eEventGUIMouseDown
#980
The function header looks like this:

function gGuiname_Click(GUI *theGui, MouseButton button) {

Unless you want to call it manually, you don't have to pass any parameters.
The function is called by AGS in the event that the GUI is clicked, and the parameters are passed to it automatically:

The first parameter is a pointer to the GUI that was clicked (that the function belongs to) so you can access it from within this function. For example:

  theGui.Visible = false;

The second parameter holds which mouse button has been clicked on the GUI. So you could do for example:

  if (button == eMouseRight) theGui.Visible = false;

--

If you really must call this function manually (not recommended), you have to pass proper parameters like this:

gGuiname_Click(gGuiname, eMouseRight);

Keep in mind that a called function must be positioned in the script before the line where you call it.

While calling these in-built functions directly works fine, it is not recommended, so better do it like this:

Code: ags

function DoMyStuff() {
  Display("The stuff!");
}

function gGuiname_Click(GUI *theGui, MouseButton button) {
  DoMyStuff();
}

function SomeOtherFunction() {
  DoMyStuff(); // instead of calling the _Click function above
}
SMF spam blocked by CleanTalk