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

Topics - Monsieur OUXX

#241
Hi all,

According to the manual :
Quoteon_mouse_click (MouseButton button)
Called when the player clicks a mouse button. BUTTON is either LEFT, RIGHT or MIDDLE, depending on which button was clicked. The "mouse.x" and "mouse.y" global variables contain the mouse's position.

It doesn't say anything specific about GUIs.
Yet, when I click on a GUI (it's "on" and "clickable"), then on_mouse_click is not called. When i click outside, it's called.
I don't understand why. As a workaround I call "IsButtonDown" in repeatedly_execute_always.
#242
What does it do?
- This allows to create small windows, as if you were in your favorite OS.
- They have a title bar
- They are skinned (borders+background) -- in the screenshot, Dennis is a window with a transparent shape. You can create as many styles as you want.
- you can do drag&drop to move them and resize them
- the window with the focus is on top of the others (z-buffer)

Why not just use built-in AGS GUIs?
This allows you to do things similar with playing with GUIs (moving them around, using Z-order, etc.), except all the windows here are drawn to a surface of your choice. For example you can have all your small windows drawn to the background of a GUI, or to the room's background.
This lets you have more control over what you draw and where you draw it.
Also this is an open door to infinite refinements if you decide to expand the code (frames, new controls, etc.).
Finally, you can have hundreds of windows (if you used GUIs you'd be blocked by AGS built-in GUIs and Controls upper limit)

No, seriously, why not just use built-in AGS GUIs?
Do as you like.

Is this module any good?
No. Performance-wise, it probably doesn't scale up well. Also the code is not optimized at all, and probably badly written in some places.
But this is still a nice little piece of script if you needed a primitive windowing system (to simulate a computer screen, etc.) but were too lazy to create it.


DOWNLOAD (version 1.0)


Manual
See "Windows.Test()" for the most simple code snippet in the universe.

Compatibility: Made with AGS 3.2.1
#243
Hi,

In my 32-bit game,  created two GUIs with those features:
GUI #1 :
  - background color: 0
  - background color number: 0;0;0
  - background image: 666 (this is a picture that's entirely transparent -- it's all pink)

GUI #2:
  - background color: 0
  - background color number: 0;0;0
  - background image: 777 (this is a picture that is almost entirely transparent, with just a few colored pixels in the top-left corner)

Note: In the code, I have a variable _renderingGui that can point to either GUI#1 or GUI#2 depending on the needs of the test.

At the very beginning of the game execution, I do this once, to take a screenshot of the GUI background:
Code: AGS

   DynamicSprite* bgSnapshot; //global variable, used later

  DynamicSprite* sprite = DynamicSprite.CreateFromExistingSprite(_renderingGui.BackgroundGraphic);
  DrawingSurface *surface = sprite.GetDrawingSurface();
  if (bgSnapshot == null) { //very first time
    bgSnapshot =        DynamicSprite.CreateFromDrawingSurface(
                          surface, 0, 0,
                          surface.Width,  surface.Height
                          );
  }


Then, in repeatedly_execute_always, I do this:
Code: AGS

    DynamicSprite* sprite; //global variable

    ...

    sprite = DynamicSprite.CreateFromExistingSprite(_renderingGui.BackgroundGraphic);
    DrawingSurface *surface = sprite.GetDrawingSurface();

    redrawBackground(surface); //this draws [i]bgSnapshot[/i] back into [i]surface[/i]
    DrawStuff(surface); //this draws shapes and stuff onto [i]surface[/i]

   surface.Release();
   _renderingGui.BackgroundGraphic = sprite.Graphic;


I observe a very weird behaviour that I can't explain:

- When I run this code with _renderingGui being GUI#1, then I can see all the stuff that gets drawn in DrawStuff(); Apparently, the fact that the background image of the GUI is completely transparent has something to do with it: I'm almost certain that nothing gets drawn during redrawBackground(), because when I draw more and more stuff in DrawStuff() at each loop, the stuff drawn in the previous loop is still visible below.
- When I run this code with _renderingGui being GUI#2, then I can only see the background image of the gui. All the stuff that gets drawn on top of it in DrawStuff() does not appear.


Anybody has an idea?


#244
It's now possible to do this in AGS.

Isn't technology wonderful?




And AGS now being cross-platform, finally this is an answer to that old paradigm :

#245
I'm trying to script this behaviour:
1) you click on an object with any action cursor
2) the character starts walking there
3) On its way it steps on a walking area that has a "standing on" event.
4) I want that the character immediately starts walking back, and doesn't do any of the things he'd have done if he had reached the object.

I'm almost there.
But after the character comes back, he still performs the actions queued by the interaction attached to the object.
In particular, if I use "look at", then he starts walking, then stops when he hits the special walk area, then walks back then he DOES say "that object has nothing special about it".

How do I dump all queued actions as soon as the character walks on the trigger walk area?
#246
Hi everybody,

Here is an "indiana Jones in suit" walk cycle.

I'd like to know your opinion.
But first, please read this:
- The anti-aliasing doesn't matter. There's no need for fancy shading.
- It's normal that the head is a bit big; there is a slight cartoony aspect to that Indy. It's an artistic choice.

So, if you see something really wrong with the walking animation, or if you have an idea for enhancing Indy's face, please let me know.





Note: if you decide to do a paintover, you must know that the sprite was scaled up 3 times. Yes, I'm aware of the Imgzoom tag, but it's all blurry on Firefox. Please don't start a flamewar about that.
#247
The title says it all : I intend on dumping all FoA character sprites into image files, and then make big tiles of them, to be able to browse through them quickly.

I've already done Indy and Sophia (below).

My process:
1) Find and download the small "LucasRipper" utility from the web
2) Make sure you are a legal owner fo FoA (floppy disk version -- LucasRipper has trouble with the talkie version)
3) Export all sprites using the tool
4) Do a bit of cleaning/sorting into subfolders
5) Download and install ImageMagick 6
6) Run this command in the folder containing the png files: montage -geometry +4+4 *.png output.png

[imgzoom]http://img593.imageshack.us/img593/3832/outputh.png[/imgzoom]
[imgzoom]http://img341.imageshack.us/img341/8587/outputx.png[/imgzoom]
#248
Hi everybody!

Take a good look at that logo :
[imgzoom]http://img850.imageshack.us/img850/6941/croppedt.png[/imgzoom]


It's a perfectly fine logo.
Yet, it's missing something to make it stand out. It looks a bit dull. I can't quite put my finger on it: is it the reflection effect that looks too artificial? Is it the contrast? I don't know.
Any advice to make it look really cool and catchy without changing the concept of it is welcome.
#249
I just read this "making of" FoA: http://newsradiofanfic.angelfire.com/Making_Fate.html

Here is an excerpt :
QuoteGeorge has established a criterion for Indiana Jones adventures, and it's basically that he should only find things that actually existedâ€"or at least could have existed.

Isn't it amazingly ironic and funny with regard to the finale of Kingdom of the Crystal Skulls?
#250
No big deal, but just in case it's a bug on the forum : I used to have 2 "awards badges" under my avatar on the forums (one for participation Technobabylon 3, and one, I believe, for helping with Nelly Cootalot).

They've disappeared for a few months now. Just sayin'.

#251
Hi,

I recall there was a module meant for managing that kind of displays :




...but I've been searching the forums and I can't find it anywhere. Anybody remembers what's its name or where it is?

#252
This is a microwave, DOTT-style.
Let me know what you think.

Overall, I really like it, but the drawing is a bit dirty in some places.

(resizable picture)
[imgzoom]http://img443.imageshack.us/img443/7765/microwave01.png[/imgzoom]
#253

...No exception

#254
Quick quesiton. Here is an excerpt of a regular .agf file :

Code: AGS

      <Dialog>
        <ID>0</ID>
        <Name>dMulbray1</Name>
        <ShowTextParser>False</ShowTextParser>
        <Script><![CDATA[// Dialog script file
@S  // Dialog startup entry point
return
...
@8
mulbray: Goodbye.
stop
]]></Script>


What does that stand for:
Code: AGS
<![CDATA[ ... ]]

I'm confused by the single opening bracket and the double closing bracket as well. And the exclamation mark.
#255
I usually hate having to create the characters in the Editor, because I realize views never end up being used like I thought they would.
And that's what's happening again, to my great distress :)
How do you use the blinking view?
At the moment I have :
- a normal view, which is only one single loop with one single sprite( it's for a completely static character)
- a blinking view, which is only one loop with one sprite (the sprite with the eyes closed)

I thought the blinking view would be called once in a while, but I'm probably mistaken on how it works.
I've read somewhere it's only for Sierra-style speech. Is that still true?
Maybe I should use the idle view instead? In that case, could you tell me how I can increase how often it's triggered? At the moment it happens very rarely.
#256
Hi all,

I'm scripting the following feature : When the player enters a room for the first time, the corresponding cutscene (yes, there is a one-time cutscene in that room) will be played or not, depending on a variable set in advance.

Completely skipping the cutscene (that is, not calling the cutscene instructions at all) is not the best solution, because then, I'd have to manually set up the room (variables, characters positions,etc.) to look exactly like it would look if the cutscene had been played.

I think the best way to do it is to play the cutscene but force-skip it as soon as it starts, by script.
The thing is, I don't know how to trigger a key press  :-D (*shame*) I couldn't find it in the manual (even though I remember having stumbled on the relevant article one billion times, when I didn't need it).

So how do I make my game press Escape 'by itself'?
#257
Hi all,

Here is a fragment of code from my global script. I didn't write it :

Code: AGS

function on_key_press(int keycode) {
     
  if (IsGamePaused() == 1) {
    keycode=0; // game paused, so don't react to keypresses
  }
  
  if ((   keycode==eKeyCtrlQ ) 
      || (keycode==317)//ALT-Q
      || (keycode==eKeyCtrlC ))
  {  
    if (IsGamePaused()==0) {
      PauseGame();
      DisableInterface();
      Mouse.Visible = false;
    } else {
      UnPauseGame();
      EnableInterface();
      Mouse.Visible = true;
    }
  }

  ...
}




I have two questions :

  • I don't understand what is this half-baked "pause" triggered with weird shortcuts such as "Ctrl+C", etc. Could it be that it was originally something else (e.g. an "Exit" shortcut) and the developer removed some bits of the code?
  • When I use those shortcuts during the game, it pauses the game: The cursor disappears and everything is paused. However when I press them again it doesn't exit the pause. Am I missing something? Aren't shirtcuts like Ctrl+C ro Alt+Q also "system shortcuts" that make the window lose the focus or something? If not, can you imagine any reason why the pause wouldn't be interrupted?


EDIT
Haha, silly me. That chopped-down version of the function put the answer right in my face: When the game is paused, keystrokes are dumped by the very first "if"...
Solved!
#258
Almost every single element in AGS (hotspots, characters, etc.) has the event "any click on" (related function: '_anyClick')available for scripting.

That event can replace every other event put together with one single function.

However, Inventory Items only have event "other click on inventory item" (related function: '_otherClick'). That event is triggered only when the player uses a cursor mode that is NOT interact,lookat,talk to or use on.

That doesn't seem very consistent and forces to split the script into all the built-in functions (_Talk, _UseInv, etc.).

Is there a way to circumvent this limitation? That is, to intercept any action on an inventory item?
#259
Hi,

I'm having a look at a script I didn't write myself. The game is a 9-verb game with a "Use" action and a "Give" action.

- When the scripter wants to test what object the player is about to "use" on another object (to update the status bar), he checks the value of player.ActiveInventory.ID.
- However when he wants to test what object the player is about to "give" to a NPC, he checks the value of 'game.inv_activated'.

I don't get why he doesn't always check the value of player.ActiveInventory.ID. Is there a fundamental difference between Using and Giving?
#260
Hello everyone, young and old, tall and small.



I made a little module to help you manage all the doors in your game. Since it relies on custom properties, I also provided a template so that you don't have to type them manually into the Editor.

You're gonna say: "managing doors is easy, why would I need a module?"
Yes. But there are tricky things with doors :

First of all, a door is not as straightforward as it sounds. Think of all the things you might need for one single door:
- that boolean used to save the door's state (open/closed)
- the two images (open door, closed door)
- you might want to change the baseline of the door when it's open or closed, so that the character can walk behind it (see the video)
- the door might need to have walkable areas enabled or disabled when it gets opened or closed
- you need to play the open/close sounds
- you want to character to walk to the door before he interacts with it (you'll need a pair of coordinates)
- you want him to face the correct direction
- you want to have default sentences ready to say when the player does something stupid (e.g. pick up the door)
- you want the character to change room when he enters the door, and you want him to appear at the correct coordinates.

Phew.

Also, you might have requirements coming from your development process:

- You might want to separate as much as possible the scripting from the room's design (imagine you ask your artist to script the doors of the room he/she just drew. There's a 50% chance he/she'll insert a non-trivial bug that will be discovered 6 months later in the final release).
This module allows him/her to manage a door entirely with only 3 lines of code.

- You might want to avoid copy and paste as much as possible to avoid cluttering your room scripts.

This module allows you to manage a door entirely with only 3 lines of code.

You'll notice that its design is a bit similar to the design of the 9-verb template, but it is much more thorough in implementing all the properties required for doors.

Video tutorial - part 1
Video tutorial - part 2

Download 1.0
The download includes :
- the demo game sources
- the compiled demo game
- the template (and the modules files if you want to go the manual way)
- the manual
SMF spam blocked by CleanTalk