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 - Gurok

#1681
The Rumpus Room / Re: *Guess the Movie Title*
Sat 15/03/2014 15:47:15
Quote from: Tibatonk on Sat 15/03/2014 15:35:41
The Cars That Ate Paris

Yep! You got it. Directed by Peter Weir who went on to do Dead Poets Society and The Truman Show. Okay, your turn Tibatonk!
#1682
The Rumpus Room / Re: *Guess the Movie Title*
Sat 15/03/2014 14:16:03
Quote from: Crimson Wizard on Sat 15/03/2014 12:57:55
I did not know they filmed "Carmageddon" :).

Close, but it's not the exact plot line :D

Quote from: Gribbler on Sat 15/03/2014 14:09:42
Escape from New York?

I like that movie, but that's not it. Here's a hint: The director is the only big name in the movie credits.
#1683
The Rumpus Room / Re: *Guess the Movie Title*
Sat 15/03/2014 01:05:28
It's not Mad Max. You got the country right though.
#1684
The Rumpus Room / Re: *Guess the Movie Title*
Fri 14/03/2014 19:21:59
Sweet! I get to perplex you all with this one now:

#1685
The Rumpus Room / Re: *Guess the Movie Title*
Fri 14/03/2014 02:50:29
Sleeping Beauty. A movie from my homeland.
#1686
Quote from: Crimson Wizard on Thu 13/03/2014 11:12:08
I think "Active" is the one selected (highlighted).
I am not sure about "Topic" word. Other functions use "Option" (compare with Dialog.GetOptionText, Dialog.GetOptionState etc).

Yeah, that's what worries me. As far as I remember, dialogs run without really having the concept of a selection. They only have a mouseover state. Unless he means "choose this choice for the player" like how the 0-9 keys behave currently.
#1687
Quote from: abstauber on Thu 13/03/2014 10:14:11
Only these two functions are missing to make dialogs completely controllable via keyboard which is what I'd like to do:
Code: ags

    Dialog.SetActiveTopic(int option)
    Dialog.StartTopic(int option)


Raise a bug tracker suggestion for these.

I understand Dialog.StartTopic() as I've run into that limitation myself. What would SetActiveTopic be for?

I raised a suggestion for the scripting changes I think I'll be able to do (not closures or function pointers or outlandish stuff like that). In some ways, I think this topic was a bit of a mistake, but it's been good to gather feedback.

I think your second function is doable at some point, abstauber. I don't know about the first.
#1688
I am thinking of possibly allowing an empty statement, i.e.:
;
As a valid AGS Script statement. How do people feel about this? At the moment, the compiler rejects it.
Pros:
    - More C-like
    - Allows for neat for/while loops that repeatedly call an iteration function
    - A good placeholder when you need to fill in the if() part of an if/else later on
Cons:
    - Allows users to possibly make errors by accidentally terminating a for/while loop with a ;
#1689
I actually thought this was strange too. All I did was make the behaviour consistent across types of editors (scripting, dialogue), but it seems a bit counter-intuitive to me. Some editors I've used select the line momentarily so that it flashes and then return the cursor to the start of the line. Perhaps it's a semi-implemented version of that.
#1690
Quote from: Ryan Timoothy on Wed 12/03/2014 20:32:05
Has anyone thought of adding a do while loop? Not that it's an important addition (neither was the for loop though), it would just be nice to have.

That's on my list after switch...case and passing structs as params.
#1691
Quote from: monkey_05_06 on Wed 12/03/2014 14:58:33
Quote from: Gurok on Wed 12/03/2014 12:59:21I'm too used to writing it the "proper" way ( while(i-- > 0) )

Hmm, that's funny. I've never heard anyone refer to the postfix operator as being "proper" (even if it is an aggregate type in a language with no prefix operator). :cool:


Hrm... not sure what you mean. Are you saying this because when a postfix operator is used with an aggregate type, it means creating a temporary copy? For the case of ints, --i and i-- generate identical opcodes, just in a different order as far as I know. So for that case, there's no reason to consider the i-- operator as being bad. I primarily use the postfix operator because I am lazy, hence the quotes around the term proper. In C and Javascript (which is my day job), you can get away with: while(i--) which saves keystrokes.
#1692
Umm... I just want to stress that this is still a collaborative effort. I appreciate the thanks and kind words from people, but Crimson Wizard and Tzachs have been contributing for a lot longer than me and are also contributing to this release. Audio Clips and some of the Draconian porting is CW's work. The undo history + editor crash fixes are Tzachs'.

I have a feeling that we won't get any feedback about the new scripting stuff until someone finds a bug. Regardless, it would be nice to read a "I tried the new version and it ran a for loop fine" from someone so I know that I didn't completely mess things up :).
#1693
Quote from: DoorKnobHandle on Wed 12/03/2014 12:21:31
This is really nitpicking but I think there's an error in this example. It halts the loop when a match is found (but it doesn't check the first element in the page[] array) or end up with i being 0 (not -1) if there was no match, right? What you probably wanted is >= instead of > in the second line.

Good work though, can't wait to try this! The for/break/continue stuff is neat but the audio clips are really useful to me as well!

Yes, you're right. I'm too used to writing it the "proper" way ( while(i-- > 0) ) which AGS doesn't support yet. I'll update the example. Sorry about that! :-[
#1694
Quote from: Marygold on Wed 12/03/2014 11:02:16
Hi everyone!

I am a AGS forum newbie from Finland, 24 years old, currently writing my master thesis in area of neuroscience and brain studies. I've been a big lover of adventure games and the whole genre since my childhood, and been always toying with the idea of making the one myself someday. The last couple of months I've been working on a little story-driven point & click game with AGS, kinda one-woman project, based on a short story I've written.

I've been reading the forum for a half of a year now, but now decided to get the courage to register and introduce myself, since I though it cold be more helpful to have a change to discuss with you guys, than work in my own little cave... :-D

Hello Marygold!

I can't believe you waited half a year to join the forums. Your game based on a short story seems like a great idea and I hope we'll see it in AGS Games in Production when it's ready (two screens minimum).

Don't be shy about asking for scripting help in the scripting forums either. If you have a coding problem, it can be a whole lot easier than trying to piece together a solution from examples strewn around the web.

I also live in a cave. They are great for insulation but humid in the summer and sometimes I worry about the radiation from the rocks.
#1695
Re: Audio Clips API

I can't say terribly much about this because I don't have much experience with audio clips. It returns a flattened version of the audio clips tree. That's as much as I know. I would hazard a guess that there's no special numbering going on, but maybe Crimson Wizard can chime in as he'll know more.
#1696
The Rumpus Room / Re: *Guess the Movie Title*
Tue 11/03/2014 23:21:44
Mission Impossible?
#1697
Okay, updated. Thanks, CW.
#1698
Hello all,

I invite you to try...

AGS 3.3.1 Alpha 2

Download 3.3.1 alpha 2 as a .zip archive

Previous alphas:
Spoiler

ACHTUNG!
This is an early version of AGS 3.3.1.
Use at your own risk. Please back up any games before opening them in this version of AGS.
New settings in this version may make your project files unusable in 3.3.0 after saving with this version.

Last updated: 1st of August, 2014



Engine

Full Screen VSync for Direct3D

This feature was previously available (but always on) in Draconian editions of AGS. With AGS 3.3.1, it has been integrated into the mainline builds. It's now possible to toggle VSync using the "Vertical sync" checkbox in Winsetup.exe. If it's checked, the game starts with vertical sync turned ON. In DirectX 5 mode, you can still toggle this by setting System.VSync to true/false. In DirectX 9 mode, the System.VSync property is now read-only (as opposed to being useless previously).

Bug Fixes

  • The engine now moves the portrait with the speaking character when using BasedOnCharacterPosition if the speaking character moves between calls to Say
  • Fixed internal handling of defaults when they can't be read from the config file
  • Fixed precision loss when getting/setting a transparency value, e.g. player.Transparency
  • Fixed occasional pathfinding failure on straight lines with complex walkable areas (reported here)
  • Printing [ no longer consumes all of the backslashes before it (e.g. "\\[" should now print \[ as expected)



Scripting

For statement

In addition to a while loop, you can now use a for loop in AGS script. The syntax is:
Code: ags
for([initialisation];[condition];[increment])
{
    [loop body]
}

Example:
Code: ags
for(player.x = 0; player.x < 100; player.x++)
    Wait(1);

Important: You cannot declare a variable inside a for loop's initialisation section. For instance, "for(x = 0; ..." is fine, but "for(int x = 0; ..." is not valid. It might be valid someday.

Break statement

You can now break out of loops using the break statement. For example:
Code: ags
i = length - 1;
while(i >= 0)
{
    if(page[i] == target)
        break;
    i--;
}

Will halt the loop when a match is found or leave i as -1 if there was no match.

Continue statement

You can now continue to the next iteration of a loop using the continue statement. For example:
Code: ags
for(x = 0; x < 100; x++)
{
    if(x % 2 == 0)
        continue;
    Display("%d", x);
}

Will display only odd numbers between 0 and 100.

Do...While loops

The Do...While loop construct is now supported. For example:
Code: ags
x = 1;
do
{
    x++;
    Display("%d", x);
} while(x < 1);

Unlike While, Do...While runs the loop iteration *before* evaluating the condition. The loop above will run once.

Dynamic Arrays in Structs

Dynamic arrays are now permitted inside structs. You can declare a struct like so:
Code: ags

struct DieRoll
{
    int BaseModifier;
    int DieCount;
    int Dice[ ];
    import function GetTotalValueOfRoll();
};

function PrepareDice()
{
    DieRoll a;

    a.DieCount = 3;
    a.Dice = new int[a.DieCount];
    a.Dice[0] = 6; // d6
    a.Dice[1] = 6; // d6
    a.Dice[2] = 8; // d8
    ...
}

And the dynamic array "Dice" can be initialised and used like any other dynamic array.

Managed User Structs

In AGS parlance, a managed struct is a struct that can be created dynamically. You must use pointers to refer to them (similar to built-in types like Region or Hotspot). You declare them with the keyword "managed" and construct new instances with "new", like so:
Code: ags

managed struct Point
{
    int X;
    int Y;
};

Point *GetPosition()
{
    Point *result;

    result = new Point;
    result.X = 30;
    result.Y = 40;

    return result;
}

Important: Managed structs are currently VERY limited in that they can't contain pointers (including dynamic arrays). It is hoped that this restriction will be lifted in the future.

#define Improvements

#define can now refer to other #define'd constants. Like VC++, #define symbol expansion only needs to make sense at the time of reference. Also like VC++, the order of previously defined constants isn't important, making stuff like this possible:
Code: ags

#define RED    GREEN
#define BLUE   456
#define GREEN  BLUE
Display("%d", RED); // Prints 456
#undef BLUE
#define BLUE  123
Display("%d", RED); // Prints 123

Note: To prevent circular references, a #define cannot refer to itself or anything previously used to expand the #define symbol.

Static extender functions

You can now declare the first parameter of a function as a static identifier that corresponds to a struct, e.g.
Code: ags
function AbsInt(static Maths, int value)
{
    if(value < 0)
        value = 0 - value;
     
    return(value);
}

This works in the same way as the normal extender method syntax (e.g. this Character *) but for static methods. The above code will define a new method in the static Maths called AbsInt. You can then import it in a header:
Code: ags
import function AbsInt(static Maths, int value);

And then use it elsewhere in your code just like it were a built-in Maths function:
Code: ags
int x = Maths.AbsInt(-3);


Extra Assignment Operators

The following C-style assignment operators are now supported:
*=   (Multiply by and assign)
/=   (Divide by and assign)
&=   (Bitwise AND and assign)
|=   (Bitwise OR and assign)
^=   (Bitwise XOR and assign)
<<=  (Bitshift left and assign)
>>=  (Bitshift right and assign)

Direction parameter for Character.ChangeRoom

This feature was previously available Draconian editions of AGS. The Character.ChangeRoom function now looks like this:
Code: ags
Character.ChangeRoom(int room, optional int x, optional int y, optional CharacterDirection direction)

Where CharacterDirection is a new built-in enum defined for facings (eDirectionUp, eDirectionUpLeft and so forth).

Character.DestinationX and Character.DestinationY

Two new read-only properties that can be used to determine where a character is currently heading (via a Walk command). If the character is currently stationary, these values are the same as Character.x and Character.y, respectively.

IsInteractionAvailable() for Other Types

This is another feature from Draconian editions of AGS. The IsInteractionAvailable() method can now be called on Hotspots, Objects and Characters.

Audio Clips API

There are two new properties for dealing with audio clips in this version.
Code: ags
Game.AudioClipCount

Retrieves the number of clips and
Code: ags
Game.AudioClips[n]

Allows you to access a particular audio clip.

Plugin API

There is now a new function that can be used to detect whether a plugin has been loaded:
Code: ags
Game.IsPluginLoaded(const string name)

Where name is the filename of the plugin

Dialog Options

The highlight colour for dialog options (default rendering) is no longer hard coded as yellow (14). You can use:
Code: ags
game.dialog_options_highlight_color = xxx;

And set the dialog options highlight colour to whatever you like. The default is 14.

Code Regions

This was previously available in Draconian editions of AGS. You can define an arbitrary region for code folding in your script like so:
Code: ags
#region MyRegion
do stuff;
do stuff;
do stuff;
#endregion MyRegion

The AGS editor will allow you to fold and unfold this region as though it were a code block. This has no effect on compiled code.

Bug Fixes



Common

Extended WFN Font Support

Support was added for extended characters in WFN fonts (those with codes 128 - 255).



Editor

Padding for Text GUI Windows

Text GUI windows now have a padding property which lets you control how much space appears between the border and the text inside a text GUI window. Previously, this value was hardcoded as 3 pixels. It now defaults to 3 pixels.


Clickable for Objects

The Clickable property of objects is now exposed in the editor so that you can set it at design time. Previously, this value was embedded in the room file format but only toggleable via scripting.


Bug Fixes

  • Undo history will no longer be deleted when a tab changes its docked state
  • Fixed crashes under certain circumstances when a script editor is closed
  • Fixed crash if selecting a character without a normal view in the room designer
  • Ctrl+Tabbing now works the first time when cycling through open editor tabs
  • Go to Line... now goes to the correct line and doesn't select it
  • The project is now completely rebuilt whenever Enable Debug Mode in General Settings differs from the setting used for the last build
  • The sprite editor now highlights drop targets when you drag sprites around
  • Moving folders of scripts around in the Explore Project pane no longer screws up compilation



Please enjoy this build and use responsibly.

Contributors
Crimson Wizard
Tzachs
monkey_05_06
salty-horse
Me
#1699
Quote from: Peder Johnsen+ on Mon 10/03/2014 23:12:45
Spoiler
[close]
*

This.

And also, this is the train-wreckiest "I didn't get the joke" thread I've read in a while.
#1700
Quote from: Crimson Wizard on Mon 10/03/2014 22:56:02
Quote from: Gurok on Mon 10/03/2014 22:16:17
Is it possible for me to close issue 503? http://www.adventuregamestudio.co.uk/forums/index.php?issue=503.0
I don't think it is correct to close issues in AGS tracker before at least some public release is made. But that's my opinion.

Oh right, yes. Sorry. I agree. A bit too hasty by me there.
SMF spam blocked by CleanTalk