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

#421
This is another report to do so far.
I suppose that if the object's property is available in the editor, it should be available in script too.

Actually, you can change the border color of a list box only inside the editor.
You can change the background color of a GUI only inside the editor.
#422
I'm very much happy to see the emergence of this topic.
To bless this newest thread I have a report to do just now.

Currently the buttons lack about these essential properties :

A) readonly bool Button.Animating
B) int Button.Frame
C) int Button.Loop
#423
Editor Development / Re: Buttons animate
Wed 18/01/2017 15:07:48
Quote from: Crimson Wizard on Wed 18/01/2017 14:55:51
Yes, of course they should be implemented.

Crimson Wizard, you are the man that could do that properly. :)
It would be simply fantastic to have those commands for buttons in a newest version of AGS.
In my first post I forget to mention the property "Loop" as well too.

So, at the moment, these are the commands that missing for the button so far...

A) readonly bool Button.Animating
B) int Button.Frame
C) int Button.Loop
#424
Editor Development / Re: Buttons animate
Wed 18/01/2017 14:48:33
Sure, I noticed that as well.
I'm sorry for my rhetorical questions so far.
But it would be great to implement these commands for buttons too.
I'm sure that would make the job less frustrating.
Also because I do not see the reason why the buttons do not have these properties...
Because from what I explained would make perfect sense.
#425
Editor Development / Buttons animate
Wed 18/01/2017 14:26:54
Hello, good evening to all AGSer.

I am not sure if this is the right place where I should post this pseudo question.
I don't understand why (Characters and Objects) have the "Animating" command since they could use the command "Animate"
And buttons doesn't have any "Animating" command... since they could use the command "Animate" like Characters and Objects ? So my main question is why buttons doesn't have this property ?
How to check exactly if a button is animating ?
Also, why buttons doesn't have the "Frame" property ?
This is very frustrating anytime.

I'm sorry in advance if these questions have already been asked.
#426
Quote from: Crimson Wizard on Sun 08/01/2017 17:42:17
You change script font size with Ctrl + Mouse Wheel.

I discovered how to do this just now. :)
Often it happens to me that accidentally change the size of the font by using this combination.
#427
Well I don't know if this somehow may find useful, but while you put SetBackgroundFrame you could check back the specific background by GetBackgroundFrame.

Code: ags

if (GetBackgroundFrame() == 4)
// SetBackgroundFrame(0);
// stop animating
#428
Quote from: Crimson Wizard on Fri 02/12/2016 15:51:12
Ah, I was trying to remember how that module was called.
Ahah this is funny because I was looking for the module link and I could not find it. :)
Nowaday it's still working just fine. :)
#429
You could even try the module made by Monkey0506 "StringPlus" because it has some really great functions on there. :)
#430
Okay CW, it's all working like a charm !!! :D
I really much appreciate for your help, really. :)

Now the file.tra can translate String inside an array as well.
I only had to change :
Code: ags

LabelMsg1.Say(String.Format("%s", MessageToSay[0])); 


to this : (by always keeping the translation in the file text)
Code: ags

String translated_message = GetTranslation(MessageToSay[0]);
LabelMsg1.Say(String.Format("%s", translated_message)); 


Both of the way I run the game (English or not) the String get read just properly fine.

Anyhow, I still have to revisit all of scipts in this way.
But I don't care because I am really much HAPPY that I got it to work, finally. :)
With this approach it will save me a lot of time for sure.

Many thanks again CW :)
#431
Thank you CW for the quickly answer.
I must need to try this further now, then I will be right back here again and let you know. :)
#432
Good evening to all AGSer.

This is much interesting to know.
I didn't knew (since a couple of minute ago) that the file.tra doesn't translate any String inside an array. (roll)
In other hand, I should revisit all of my scripts and to do something like this.

Code: ags

if (Game.TranslationFilename != "English") {MessageToSay[0] = "Ciao, come stai ?";}
else {MessageToSay[0] = "Hello, how are you ?";}


I wish I could ask you for confirmation on this issue before changing further the source code.
Thanks in advance.
#433
Many thanks guys for the help was very much appreciated.

Previously, I forget to mention that I am using the module "Alt Keyboard Movement" to keep track on how many steps the player has performed, in this way.

Code: ags
void AdvanceFrame(int xa, int ya, int l) 
{    
  int sca = GetScalingAt(player.x, player.y);
  
  int sgn;
  if (player.ScaleMoveSpeed) 
  {
    sgn = Sgn(xa);
    xa = (xa*sca)/100; if (xa == 0) xa = sgn;
    sgn = Sgn(ya);
    ya = (ya*sca)/100; if (ya == 0) ya = sgn;
  }

  bool free = PathFree(player.x - GetViewportX(), player.y - GetViewportY(), xa, ya);
  int x = player.x + xfree;
  int y = player.y + yfree;
    
  int pf = player.Frame;
  int pl = player.Loop;
  
  // advance frame
  pf++;
  
  // roll around
  if (pf >= Game.GetFrameCountForLoop(player.View, pl)) pf = 1;
  if (l != pl) //player changes loop
  {
    // translate frame to new loop
    // frame is 1-x
    // old last frame and new last frame
    int olf = Game.GetFrameCountForLoop(player.View, pl)-1;
    int nlf = Game.GetFrameCountForLoop(player.View, l)-1;
    if (olf != 1) pf = (pf*(nlf-1))/(olf-1);
    if (pf == 0) pf = 1;
  }
  
  // change loop
  if (free || TurnIfBlocked) { player.Loop = l; }
  
  // advance frame
  Animating = false;
  if (free || AnimateAtEdge) 
  {
    steps ++; // <------------------------------------------------------------- that represents a full step
    Animating = true;
    player.Frame = pf;
  }
  else player.Frame = 0;
  
  // move player
  Moving = false;
  if (free) 
  {
    Moving = true;
    player.x = x;
    player.y = y;
  }
}


So I am going to do something like this because it's working just as I wish :
Quote from: Snarky on Sat 30/07/2016 22:18:47
You can incorporate the animation speed into the calculation if necessary. Another approach would be to check the character's animation frame, and increment the step counter each time it reaches the frame (or frames) that represents a full step.


Quote from: Snarky on Sat 30/07/2016 22:18:47
Then you simply multiply the number of steps with the step length to get the distance.

I am not sure if I still could do that with my roughly script ?
Code: ags
function TrackingSteps()
{
   if (steps >= steps_counter) // steps value has just reach his (new) goal 
   {
      AddValue( ); // simply multiply the number of steps with the step length to get the distance.


Then I am not sure how do I should keep track properly of the 'steps_counter' and lately how do I can convert it to the appropriate unit ? (roll)
Many thanks guys again for your replies and supports.
#434
Advanced Technical Forum / Walking distance
Sat 30/07/2016 15:35:04
Good Evening to all AGSer.

I am trying to build a statistic which refers to how much distance the player walks in the game.
I'd like to show you how roughly might seem the script but I hope someone can suggest me what is the best way to achieve something like this (roll)
Code: ags
//GLOBAL VARIABLES
String measure, dis;

int /*float*/ steps, // use for tracking the steps performed
              steps_counter; // use for tracking the next goal


function AddValue (int value) {steps_counter += value;} // ...


function TrackingSteps()
{
   if (steps >= steps_counter) // steps value has just reach his goal
   {
      AddValue( ); // might be a costant one...
      

      // check measure to display 
      if (steps < 1250) {measure = "Meters";}
      else 
      {
        if (steps < 2000) {measure = "Km";}
        else {measure = "Miles";}
      }
   }   

  dis = String.Format("Walking Distance : %d %s", steps, measure); 
}


Thank you in advance for the time held to read :)
Somehow, I am not sure why this is posted in the Advanced Tech :)
#435
Thank you a lot Mandle :)
I figure out what you said in the message and it is just working good :)
Also, the 'HasInventory' command did the trick as well, thanks again for the support :)
#436
Good Evening to all AGSer :)

I'm trying to write something approximately simple but I'm having some difficulty.
I hope someone can help me out in the free time.

I love how AGS handle the selected inventory graphic for the mouse cursor anytime you click on a item.
I have an InventoryWindow with some little boxes where is placed the items that you collect.

This is what I'd like to do :

A) Anytime you click the item, the cursor graphic change to the current item graphic that you select.
B) After you select that item the box will look empty
C) If you click on the empty box the item return to the box and the mouse cursor change to the default one

Do you know what is the best way to do that ?

Thank you very much in advance :)
#437
Thank you very much :)
#438
Thank you very much, Khris for the explanation :)

I didn't thought that the plugin was only for *.ogv format, sorry. :(
Anyway, I have another small video on my comp it has *.ogv format, I have try to test this new video..
But I keep get the same error anytime.. :(
So, I am doing something like this :

Code: ags

Theora*video;

function room_Load()
{
  mouse.Mode = eModeInteract;
  
  video = Theora.Open("Intro.ogv"); // this should call the rep_exe event...
}

function room_RepExec()
{
  // all of this doesn't run...
  if (video)
  {
    Display("ok"); // <---- doesn't show
    video.Draw(DsBackground, 0, 260, RtScreen); // nothing
    video.NextFrame(); // nothing
  }
}

/*If I simply do something like this, I will get the error in the same way (NPE)*/

function room_RepExec()
{
  Display("ok"); 
  video.Draw(DsBackground, 0, 260, RtScreen);
  video.NextFrame();
}


Do you think there is something wrong with the video or I am simply doing it in the wrong way ?
Also, what do you mean about 'You need to manually advance and draw the video frames' ?
It is something that do the plugin by calling (Draw, DrawEx) ?



:EDIT: I am sorry Khris, I have return here to say that it's all working very much good now !!!! :)
The new video in *.ogv format was not running because it was placed in the wrong folder...
Thank you very much again for your support !!! :)
#439
I owe you one Khris, thank you very much :)

Hi guys I am trying to use the plugin as well but I am not really sure how to get it to work properly...
I have try to follow the code examples but I am getting the same error anytime (null pointer reference)

I have imported a graphic interface to keep constantly at the bottom of the screen within a Gui.
I would like to know how do I can play the video with the plugin ?
This is how my code look now but I don't understand how to get it to work..

Code: ags

Theora * video;

function room_Load()
{
  mouse.Mode = eModeInteract;
  
  video = Theora.Open("SEQUENZA_2.avi");
}

function hHotspot1_Interact()
{
  hHotspot1.Enabled = false;
  //PlayVideo("SEQUENZA_2.avi", eVideoSkipAnyKeyOrMouse, 11);

  // Here is were I get the null pointer error when I try to use the plugin commands
  // Still, not sure what to do exactly...
  // Here is were the video should run...

  hHotspot2.Enabled = true;
}
#440
This is really nice to hear Mandle, thank you very much for the quickly reply :)
I must have to check this out tomorrow and see how the plugin work properly :)
Thank you a lot again :)
SMF spam blocked by CleanTalk