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

#441
Good evening to all AGSer.

I'd like to ask you if there is a way to run a video in a 'windowed' mode ?
or better to say, there is a way to have an interface like Phantasmagoria 1 in Ags ?
I'd like to run a video but keep the interface at the bottom of the screen constantly.. (roll)
Some of you know how to do that ?
I notice that when you play a video it take all the screen (anyway) to play it  (roll)
#442
Quote from: Crimson Wizard on Thu 28/04/2016 12:06:54
There is, it is a new command added to 3.4.0: http://www.adventuregamestudio.co.uk/forums/index.php?topic=51050.0

Yes, it is one of the latest functions added on the very newest version I believe (roll)
Because I didn't found this function on 3.4.0.3 :(

Quote from: Crimson Wizard on Thu 28/04/2016 12:06:54
As a workaround, you could remember which light level you assign to the character yourself in a global variable, and then use it as a reference.

This is however the best workaround that I could image in this case :)
#443
Ciao rmonic79, as far as I know.. there isn't any "Setlightlevel()" :)
I have just done to make a quickly test inside 3.4, the only thing that you should have to do is to draw normally your region inside the room, suddenly, you should only change the value "LightLevel" from the editor panel (let's say for example 50) And it just work as it should be (roll)

If you need to get the variable from the light level region you should use "region.LightLevel"
#444
I am glad to hear that you've solved it. :)
#445
Hi, I am not sure if this could be helpful but you could try to check the particle transparency so far.

Code: ags

PS.emitter_set_transparency (s, 100, 100); 



Code: ags

PS.action_set_transparency_evolution (s, 100, 5); 


I hope it helps :)
#446
Ciao Wyz. :)
I am gladly happy to say that the function doesn't crash anymore and the axes have their own reaction now. :)
I much appreciate the fantastic work that you have done. Thank you very much. :)

I hope you don't mind if I ask you another question. :-[

I think that there's a underlying issue that I hope is fixable.
When the axis is pressed there's no waiting actually. :(
Instead, when a button is pressed it works fantastically as it should be.

There is a way to wait for the axis to be pressed again to return with the script ?
(eg: as it happens with the buttons ?)
#447
Greetings Dualnames, thank you very much for your suggestion. :)
After further retested with the noloopcheck generates the same error.
It is strange because it hung even if I press a button instead of axes.
In both cases (with or without noloopcheck) the function crashes. :(
#448
Greetings Wyz, I would like to thank you very much for taking the time looking into this.
I have thoroughly enjoyed, thank you very much :)

I tried to test your new function but unfortunately it give me a persistent error.
Even change the value of our constant JOY_THRESHOLD it give the same error.
The script appears to be hung (a while loop ran 150001 times) the problem may be in a calling function.
Here is the line which generates the error :

Code: ags

#define JOY_THRESHOLD 8192

function WaitMouseKeyJoyAxes(int time, Joystick *j)
{
  int buttons = j.buttons;
  int p[] = new int [j.AxesCount];
  
  int i = j.AxesCount;
  while (i > 0)
  {
    i--;
    p[i] = j.GetAxis(i);
  }
  
  while (time)
  {
    if ((j.buttons ^ buttons) & j.buttons)
      return (1);
    else
      buttons = j.buttons;
    
    i = j.AxesCount;
    while (i > 0)
    {
      i--;
      
      int axis = j.GetAxis(i);
      int disp = axis - p[i];
      
      if (disp < 0)
        disp = 0 - disp;
      
      p[i] = axis;
      
      if (disp >= JOY_THRESHOLD)
        return (1);
      
      i++;
    }                              // <---------------------------- hung stuck
    
    if (WaitMouseKey(1))
      return (1);
    
    if (time > 0)
      time--;
  }
  
  return (0);
}



I tried it and perform the noloopcheck keyword between the function but in vain :)
I would be very glad if you can have the time to look into it.
Many thanks Wyz in advance, again. :)
#449
Hi guys, I'm sorry for this dumb question.

I'm trying to find an alternative to the standard function (WaitMouseKey) since it does not react any buttons with the controller.
I'm using the fantastic function that Wyz suggested to do, since it works perfectly. (WaitMouseKeyJoy)
The only little issue that I can not understand is why if I press the Axis they are not counted as buttons pressed in the function. :-\
So I was interested to ask you if there is a way to include the Axis as Buttons pressed somehow.

Code: ags

function WaitMouseKeyJoy(int time, Joystick *j)
{
  int buttons = j.buttons;
  
  while (time)
  {
    if ((j.buttons ^ buttons) & j.buttons) 
      return (1);
    else
      buttons = j.buttons;
    
    if (WaitMouseKey(1))
      return (1);
    
    if (time > 0)
      time--;
  }
  
  return (0);
}


Any kind of help is very welcome, many thanks guys in advance.
#450
This game looks completely fantastic ! 8-0
I look forward to play it. :-[

Many thanks Dualnames and Aprilskies for this amazing release <3
#451
I can't understand easily what do you want to achieve :(
However I believe there's a type mistake in the code..
Code: ags

function cCharacter_Talk()
int gettransparency = cCharacter.GetPixel(mouse.x, mouse.y);
{


It should be in this way
Code: ags

function cCharacter_Talk()
{
int gettransparency = cCharacter.GetPixel(mouse.x, mouse.y);
...



I am not sure if this could be helpful somehow but you could try to check GetLocationType or GetAtScreenXY (character)
example
Code: ags

if (GetLocationType(mouse.x,mouse.y) == eLocationCharacter)
    cCharacter.Clickable = false;



NOTE: Any characters with the "Clickable" property set to false will not be seen by this function.
Code: ags

if (Character.GetAtScreenXY(mouse.x, mouse.y) == cEgo) 
{
  Display("The mouse is over the main character");
}
#452
I think you can do it in several ways..
For example, let's say that the pointer is an object.

Code: ags

function repeatedly_execute()
{
  if (Object.GetAtScreenXY(211, 145) == oRock) // and mouse button is pressed
  {
    mouse.SaveCursorUntilItLeaves();
    mouse.Mode = eModeTalk;
  }
}


I think that Mouse.SaveCursorUntilItLeaves() maybe it could be useful in this case..
This allows you to temporarily change the mouse cursor when the mouse moves over a hotspot, object or character and have it automatically change back to the old cursor when the player moves the mouse away.

#453
Even if it's just been told by Crimson Wizard.

Global Variables :
The Global Variables pane allows you to easily add variables to your game which can then be accessed from all your scripts.

// for room A
bool door_on_the_left_side_A_open // initial value false
bool door_on_the_right_side_A_open // initial value false

// for room B
bool door_on_the_left_side_B_open // initial value false
bool door_on_the_right_side_B_open // initial value false


You could do something like this for example...

// room script (B)
Code: ags

function hLeftDoor_WalkOn() // hotspot open left side door
{
   if (!door_on_the_left_side_B_open) // if the door is closed
   {
      door_on_the_left_side_B_open = true
      player.ChangeRoom(2); // room A
   }

   else // the door is open
   {
       
   }
}


function room_Load()
{
   if (player.PreviousRoom == 2) // room A
   {
      door_on_the_right_side_A_open = false; 
      door_on_the_left_side_B_open = true

      oDoor_left_side_B.Graphic = OPEN_DOOR_SPRITE;
   }
}


function room_AfterFadeIn()
{
   if (door_on_the_left_side_B_open)
   {
     player.Walk(/*x*/, /*y*/, eBlock, eWalkableAreas);
     cCharacter1.SetAsPlayer();
   }
}




// room script (A)
Code: ags

function room_Load()
{
   if (player.PreviousRoom == 1) // from room B
   {
      door_on_the_left_side_B_open = false; 
      door_on_the_right_side_A_open = true; 

      oDoor_right_side_A.Graphic = OPEN_DOOR_SPRITE;
   }
}


function room_AfterFadeIn()
{
   if (door_on_the_right_side_A_open)
   {
     player.Walk(/*x*/, /*y*/, eBlock, eWalkableAreas);
     cCharacter2.SetAsPlayer();
   }
}
#454
Hi Khris, I am sorry for the late reply.
I had to change some things inside the function to make sure that your idea worked well.
I would like to thank you for your help because it was useful.
Especially use the DrawingSurface String and land the result in the background of the gui.
Bravo, Grazie mille :)
#455
Hi Khris, is a glad to hear from you.
Thanks so much for suggesting the best approach to do something like this.
Your help was very greatly appreciated.
I meant to add a new parameter or two in my function, which can optionally change color for that char(in that specific text).
But I find difficulties to execute your idea in my script.
I wish I could show you and I hope you can help me again.

Code: ags

function _Say (this Character*, String txt, int speed, int color)
{
   String text = GetTranslation(txt);
   if (!color) color = chars_setup[this.ID].SpeechColor;
   lblboard.TextColor = color;
   
   // display char
   String temp = "";
   int text_length = text.Length;
   int i = 0;
   char current_char;
   bool abort = false;
   bool speaking = false;
   while (i < text_length && !abort)
   {
      current_char = text.Chars[i];
      temp = temp.AppendChar(current_char);
      lblboard.Text = temp;
      if (current_char == eKeyPeriod)
      {
         // do stuff
         speaking = false;
      }
      
      else if (!speaking)
      {
         // do stuff
         speaking = true;
      }
     
     abort = WaitMouseKey(6);
     i++;
   }

   lblboard.Text = text;
   // do stuff
   if  (abort)
   WaitMouseKey(2 * (text_length - i) + 50);
   else
   WaitMouseKey(50);
}




I had to start by doing something like so :

Code: ags

// outside
DynamicSprite*text_box;


function game_start()
{
   text_box = DynamicSprite.Create(gSpeechbox.Width, gSpeechbox.Height); // ?
}



Then I should write something like this but I can't figure it out how can I make this to work inside my function..

Code: ags

DrawingSurface*sur = text_box.GetDrawingSurface();
sur.DrawingColor = 14;
sur.DrawString(0, 0, Game.NormalFont, "%s", text); // text regarding the one inside the function...
gSpeechbox.BackgroundGraphic = text_box.Graphic;
sur.Release();
#456
Beginners' Technical Questions / Char color
Tue 24/11/2015 12:34:47
Good evening to all AGSer !!!

Since there is not a section below the beginning area, I will post it here.
I would like to ask you if there is a way to choose a single char from a label text and being able to change its single color.

Example :
Code: ags

String text = "This is a String text"; 


I would love to get all the 't' or all the 'i' to be in a different color in that text.
Any of you know the right approach to use to get this to work ?

Grazie mille in advance.
#457
AGS Games in Production / Re: Rabbit Hill
Mon 09/11/2015 14:36:40
I already love this game from the screenshots.
Horror and FMV, nothing more 8-)
I look so foward to play this game.
#458
Quote from: Vincent on Fri 06/11/2015 18:30:02
Should not be that hard to guess :D

This was a humorous saying about the context unclear.
My intention was not to offend you or anything else.
I'm sorry you did misinterpreted it.

Quote from: MiteWiseacreLives! on Sat 07/11/2015 16:34:31
I can make pretty good guesses too, Vincent

Stupot+ should arranges the next tournament because I'd like to challenge you (jokes) :)

#459
Quote from: Snarky on Sat 07/11/2015 10:29:03
Yes, I assumed (after the first couple of rounds of confused questions) that his immediate problem was that he'd defined myHotspot as a String instead of a Hotspot*, but changing that wouldn't be enough if the method in the GlobalScript expected a String. Which is why a fuller explanation of his process was necessary. I don't see how defining a global String variable would solve this problem anyway, so I'm actually skeptical that he has fixed the problem correctly.

Yes, I think so too indeed.
A fuller explanation of the process that you are intended to achieve is compulsory.
In this way you allows people in the community to help you properly.
Also, this would avoid as well someone that have your same problem to collapse in a no achievement thread.
Because the goal to be achieved is not clear.
#460
:offtopic:

I'm not encouraging anyone to a bad behaviour as you claim.
Rather, I support all of you who say that need to be clear as well when you are intended to ask a question.
I want only to make you understand that what you asked could be answered shortly.

Because
Quote from: Martyn on Thu 05/11/2015 22:35:04
Right now i pick up the name like this in a string!
Code: ags
location = Game.GetLocationName(mouse.x, mouse.y); 


After he probably added a new global variable String called 'myHotspot'
Quote from: Martyn on Fri 06/11/2015 16:35:01
Code: ags
myHotspot = Game.GetLocationName(mouse.x, mouse.y);

This works almost the way i want.


Quote from: Martyn on Fri 06/11/2015 16:35:01
Code: ags
myHotspot = Hotspot.GetAtScreenXY(mouse.x, mouse.y);

This get error, can not convert hotspot* to int or string! ???

Actually, Im not wonder what 'myHotspot' is, except the clarity of his intentions.
SMF spam blocked by CleanTalk