AGS Awards votes close at 13:59 BST on Wednesday 07 March 2018. You've already voted, so you've got 11 days and 17 hours left to wait before voting closes!

Show Posts

You can view here all posts made by this member. Note that you can only see posts made in areas to which you currently have access.


Messages - tzachs

Pages: 1 ... 51 52 [53] 54
1041
Hi, a little piece of advice regarding your code... When you create an object, you can name it in the designer (to say, "oFlag"), and then you can use the flag object like so:

oFlag.SetView(2);

This way, the code is more readable then if you use object[0], and if you'll look at the code a couple of months from now you'll be able to understand what you did more easily. The object structure is intended to be used if you want to access your object from outside the room you're in (and then you can't use the name of the object since it is only created locally in the room).

1042
Maybe something like this will do the trick (I'm assuming the 60 is to the right of the left edge):

Code: Adventure Game Studio
  1. bool crossedLeftEdge;
  2.  
  3. function room_LeaveLeft()
  4. {
  5.   if (!crossedLeftEdge)
  6.   {
  7.       crossedLeftEdge = true;
  8.       cEgo.Walk(-30,  cEgo.y, eBlock, eAnywhere);
  9.       PlaySound(3);
  10.    
  11.       cEgo.Walk(60 , cEgo.y);
  12.       crossedLeftEdge = false;
  13.   }
  14.  
  15. }
  16.  


1044
Beginners' Technical Questions / Re: If-Else Related Code
« on: 01 Aug 2009, 14:07 »
Also, if you want more than two responses you can use the MultiResponse module by SSH.

1045
Beginners' Technical Questions / Re: Drop and Drag Script
« on: 01 Aug 2009, 13:55 »
I tried it with objects on top of each other and it worked...
I have some thoughts:
1. Try it without the two lines that change the baseline and see if it helps.
2. If it doesn't, you can put a label in the room, and write in it the name of the hotspots&objects that the mouse is pointing at, then you will see which object may be hiding another object...

1046
Beginners' Technical Questions / Re: Drop and Drag Script
« on: 31 Jul 2009, 15:39 »
I tried your script and it worked fine for me (with & without debug and I tried it at least 10 times). I did it on a smaller scale with 3 objects & hotspots, I only had to change the line
Code: Adventure Game Studio
  1. Hotspot *ho = Hotspot.GetAtScreenXY(object.X, object.Y);
  2.  
which doesn't compile, to
Code: Adventure Game Studio
  1. Hotspot *ho = Hotspot.GetAtScreenXY(object[i].X, object[i].Y);
  2.  
But I guess you just pasted it wrong, so my only lead is that maybe some other script is in the way or maybe there is a hostpot/object with a higher baseline that prevents other objects from being clicked...

1047
Maybe it's a driver related issue.
I would try checking if there is a newer version for your sound driver.
Also, I would look at the device manager to see if one of the driver is not working properly, and if so, installing a proper driver for that component.

1048
You can do this easily with the Tween module like this:

Code: Adventure Game Studio
  1. int toX = 50; //Your x here
  2. int toY = 50; //Your y here
  3. float timeInSeconds = 4.5; //Your time here
  4. cCar.TweenPosition(timeInSeconds, toX, toY, eEaseInTween);
  5.  

This will accelerate your car's position from it's current position to 50,50 in 4.5 seconds.
In order to decelerate just replace 'eEaseInTween' with 'eEaseOutTween'.

Also, if you have a driving animation to your car, you can decrease and increase your animation speed together with the position to get a better effect, with this code:
Code: Adventure Game Studio
  1. int toX = 50; //Your x here
  2. int toY = 50; //Your y here
  3. float timeInSeconds = 4.5; //Your time here
  4. cCar.TweenPosition(timeInSeconds, toX, toY, eEaseInTween, eNoBlockTween);
  5. cCar.TweenAnimationSpeed(timeInSeconds,  cCar.AnimationSpeed -20);
  6.  

This will speed up the driving animation for the car to be 20 less than the current animation speed which will give an effect of acceleration (you will probably need to play with the numbers a bit though). Use +20 for deceleration effect.

1049
Beginners' Technical Questions / Re: Parser
« on: 25 Jul 2009, 21:39 »
Try this:

Code: Adventure Game Studio
  1. function on_key_press(eKeyCode keycode)
  2. {
  3.   if ((keycode == eKeyReturn) && (gGui2.Visible == true))
  4.   {
  5.      String input = TextBox1.Text;
  6.      Parser.ParseText(input);
  7.      gGui2.Visible = false;
  8.      if (Parser.Said("look art"))
  9.      {
  10.        Display("A painting that seems to have been supplied by a certain Jacques Chevrier.");
  11.        TextBox1.Text = "";
  12.      }
  13.    }
  14.  }
  15.  

I just moved the Parser.Said call into the first condition because otherwise it will check the parser on every key press and you want to do it only after enter...

1050
Beginners' Technical Questions / Re: Parser
« on: 25 Jul 2009, 19:17 »
I'm guessing that you parse the text in the repeated execute and that's why the action fires before pressing enter. Instead, you should register to the on key event (you've probably already registered in order to raise the gui), and only when the key is enter you should do your parsing...

1051
Modules & Plugins / Added new tweens...
« on: 11 Jul 2009, 17:12 »
Ok, so I went a little crazy here, and I hope it's ok... I went over the ags documentation and found a bunch of new tweens to add to the module (some more useful than others)... So I implemented them all and created an interactive demo to show most of them (and the first ones as well)...

Module
Demo
Source for Demo

There are ~30 new tweens, among them you will find:
TweenPosition and TweenSize were added also for all of gui types...
TweenViewPort, TweenAnimationSpeed for character, TweenImage for object, TweenAreaScaling, TweenColor(for R,G and B respectively) for label, button and textbox, TweenLightLevel for region and more...

A few comments about some of the tweens:
* TweenMasterDigitalVolume will not always work as expected due to AGS bugs, you can see my report here (it's possible that TweenChannel/Sound/Speech volume will suffer from the same bugs, I didn't test it, however TweenMasterMusicVolume doesn't suffer from these bugs).
* TweenTintR/G/B for Region works well for one direction, but not so well to the other due to a weird relationship with the LightLevel for a region in AGS that I didn't fully understand.
* TweenImage for object will require you to pass a second 'dummy' object as a parameter, this is because I didn't find any way to create an object programmatically.
* Some of the tweens will require you to also give a "from" parameter (such as the tweens for volume), this is because I didn't find any functions to get values for those tweens, only to set (for instance, there is no GetMusicMasterVolume).
* There are some tweens that I wanted to create but gave up at the end, I wanted to create a tween for SetWalkSpeed but gave it up since I got an error message that said I can't set a walk speed for a character while he's already walking, and I wanted to create tweens for all of the parameters in the SetAmbientTint function but gave it up since there is no GetAmbientTint and without it the functions require too many parameters...

Edmundito, I just wanted to say that I found the design of the module was excellent and it allowed me to add new tweens in a fairly easy manner, and I will be very happy if you want to take the module extension to the beginning of the thread so everybody will be able to find it...

1052
The wait did not help  :-[ (I tried Wait(100) also just to be sure).
I actually wanted to create a bunch of new functions for the tween module, and I thought a tween for the digital master volume would be nice for fade-out/in effects, I guess I'll just have to wait for the new versions (at least the SetMasterMusicVolume works, although it's not useful in all of the scenarios).
Anyways, thank you for your replies, just be aware of this when creating the new sound system...

1053
Hi, I am using version 3.1.2 SP1, and I think I've found two bugs in SetDigitalMasterVolume...
The only sound I have is an mp3 that plays on loading the room. I call the SetDigitalMasterVolume on the on_Load function of the room.

Bug #1
--------
If I write:

Code: Adventure Game Studio
  1. SetDigitalMasterVolume(100);
  2.  

or:

Code: Adventure Game Studio
  1. SetDigitalMasterVolume(1);
  2. SetDigitalMasterVolume(100);
  3.  

Then everything works fine, I can hear the mp3. However, if I write:

Code: Adventure Game Studio
  1. SetDigitalMasterVolume(0);
  2. SetDigitalMasterVolume(100);
  3.  
Then I don't hear anything... It seems that if I turn the volume to 0, I can't turn it back on  ???

Bug #2 (probably related to #1)
--------
If I write:

Code: Adventure Game Studio
  1. int i=50;
  2.   while (i<100)
  3.   {
  4.     SetDigitalMasterVolume(i);    
  5.     i++;
  6.   }
  7.  
Then I hear the mp3 at volume 100, as expected. Also, if I write:

Code: Adventure Game Studio
  1. int i=100;
  2.   while (i>50)
  3.   {
  4.     SetDigitalMasterVolume(i);    
  5.     i--;
  6.   }
  7.  
or

Code: Adventure Game Studio
  1. int i=50;
  2.   while (i<100)
  3.   {
  4.     SetDigitalMasterVolume(i);    
  5.     i++;
  6.   }
  7. while (i>50)
  8.   {
  9.     SetDigitalMasterVolume(i);    
  10.     i--;
  11.   }
  12.  

Then I hear the mp3 at volume 50, as expected. However, if I write:

Code: Adventure Game Studio
  1. int i = 100;
  2. while (i>50)
  3.   {
  4.     SetDigitalMasterVolume(i);    
  5.     i--;
  6.   }
  7. while (i<100)
  8.   {
  9.     SetDigitalMasterVolume(i);    
  10.     i++;
  11.   }
  12.  
then I hear the mp3 at volume 50, a weird behaviour  :-\....

Any thoughts?



1054
Not even that complicated, Edmundito... have the "to" image behind the "from" image, both opaque and visible, and tween the "from" image's transparency out, leaving the "to" image to be revealed beneath it. Therefore, AGS handles it automatically. :)

This solution might work in some of the cases, but it won't work if the "from" image has transparent parts, thus revealing parts of the "to" image too soon and diminishing from the effect... Edmundito's suggestion covers those scenarios as well...

1055
Sweet! :)
This is a really cool and useful model...
I have a suggestion for another tween, although I don't know if it can be implemented in AGS: The idea is to tween between two images (in the same size, for simplicity), to take the RGB value for each pixel in the first image and to interpolate to the RGB value for its equivalent pixel in the second image... I think it will provide for nice effects...
Anyways, really loved the model (and the demo).

if I get what you mean, it may be possible to do that:
Code: Adventure Game Studio
  1. oFromImage.SetPosition(0, 0);
  2. oToImage.SetPosition(0, 0);
  3.  
  4. oToImage.Transparency = 100;
  5.  
  6. oFromImage.TweenTransparency(1.0, 100, eLinearTween, eNoBlockTween);
  7. oToImage.TweenTransparency(1.0, 0);
  8.  

Thanks for the suggestions so far! For sure I want to make all GUI widgets tweenable so I'll work on that next. And i'll also add the license! Let's just so say that it'll be the module gpl license most likely.

Yes, that's exactly what I wanted! I don't know how missed this...  ???
Thanks...  :)

1056
AGS Games in Production / Re: A twist at the end
« on: 28 Jun 2009, 21:01 »

Thanks Grim! Just curious though, what games do you know that are about hotels? I know games that have a hotel in them, but I was kind of hoping that I was the first... Oh well  :-


Ha ha! There's one I heard of:

http://www.adventuregamestudio.co.uk/yabb/index.php?topic=37767.0

lol !! You do like hotel games, don't you?  ;)
I saw the trailer, and it looks really really interesting with great atmosphere... I'll play the demo when my girlfriend won't be near me (she'll have nightmares...) and I'll write in your thread.

1057
AGS Games in Production / Re: A twist at the end
« on: 27 Jun 2009, 18:08 »
Wow. Very interesting plot....
This looks quite promising. I'll be playing :)

Thanks  paoul :)

Looks good, how did you get the 3D characters to work in AGS?

And thank you too JJ!
About your question, I took the 3D characters, positioned them in my desired angle with the desired animation, captured a video of them and then extracted images from the video, cleaned and edited the images to get exactly what I wanted, and then created the view in AGS. It's a bit tedious, but it turns out nice, I think..

By the way, I created a small software to extract the images from the video. Basically, because the avi file contains too much frames I needed an easy way to extract only the frames that advance the animation a reasonable amount and that's what the software does. I didn't post it anywhere because I didn't see much use to it other than to handle my specific scenario, but if somebody here wants it, I will gladly distribute it (maybe even create a plugin for AGS if there will be demand)...


1058
Sweet! :)
This is a really cool and useful model...
I have a suggestion for another tween, although I don't know if it can be implemented in AGS: The idea is to tween between two images (in the same size, for simplicity), to take the RGB value for each pixel in the first image and to interpolate to the RGB value for its equivalent pixel in the second image... I think it will provide for nice effects...
Anyways, really loved the model (and the demo).

1059
AGS Games in Production / Re: A twist at the end
« on: 26 Jun 2009, 14:20 »
Interesting.... Games about hotels are kinda my thing:) Looking forward to this one!

Thanks Grim! Just curious though, what games do you know that are about hotels? I know games that have a hotel in them, but I was kind of hoping that I was the first... Oh well  :-\

This game seems very interesting.  And I love your graphics - the characters seem almost 3D somehow. 

This being your first game makes it all the more impressive.  Excellent work.   :D

I'm looking forward to playing this one.   ;)


Thanks Frodo, I really like the characters too although I can't take credit for them, I'm taking them from a website (and they are 3D  ;D) ...

1060
AGS Games in Production / Re: A twist at the end
« on: 25 Jun 2009, 21:08 »
Wowee. This is good for a first game, and it sounds like a very good plot indeed. Just a question: what dimensions does it run at? The enlarged pictures wouldn't be supported by any of the available dimensions, or is it just me? Anyway, I expect you'll end up with a game as good as it sounds! :)

Thanks! It means a lot, and 'Wowee' is definitely a good word  :)
The game runs at 640x480, and I'm not quite sure (since I took the screenshots about a week ago), but there's a chance that I resized the pictues before posting, so that might explain your confusion...

Pages: 1 ... 51 52 [53] 54