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

#1
Hello, have you found the solution to this latest questions?

ProcessClick (int x, int y, CursorMode)

If you look in the manual you can find a clear example.

#2
Thank you for your answer.
Unfortunately my case is different because I put the mouse coordinates in the variables at the beginning of my function.
I readjusted the code and now it works fine even with the character that has mirrored the loop.
I think the problem was in a piece of code where the walk of the character was eNoBlock. Calling FaceDirection occurred before the end of the walk then the frame was displayed during the walk and not at the end.
#3
I believe that this problem might depend on the configuration of the PC or the applications installed on the PC.
My AGS Alpha is on portable hard drive and I was able to try it on another PC Windows Seven 64bit dual monitors. The cursor was ok.
On the PC where the cursor is blinking there are installed various development environments like VB, Delphi, Unity, Dreamweaver with webserver and so on, the other pc was much cleaner.
However it is not really a big issue, it works the same.
#4
Quote from: Monsieur OUXX on Tue 17/11/2015 16:10:29
but all he said is that he did create those loops, by mirroring the other ones.

Yes, it is.
However I was not convinced and I created a new base game.
I put in it two characters, one with all the sprites for the eight directions and the other with three loops mirrored.
Then I used FaceDirection for all eight directions and both characters have all of their frames to the right place.
So the problem is in my code ... but it's strange, I'll try to understand.
At the end of the path I simply apply FaceDirection according to the mouse position, anything so complicated ...
Thank you all
#5
I don't know if we can call it bug but by creating a view of the character using "Flip Sprite" FaceDirection not working properly.
It's necessary to use existing sprites for each loop and FaceDirection will be fine.

[edit]
To be precise behavior is strange.
I had the loop Left, Left-Up and Left-Down mirrored.
Asking AGS perform FaceDirection(eDirectionUpRight) (this loop was not mirrored) was displayed eDirectionDownRight...
So I proceeded to mirror all frames manually and import them directly as sprite and assign them to the corresponding loop.
Now all directions work properly.
#6
I believe it is AVG antivirus ... I noticed that the defect increases when I receive emails and AVG scans
#7
By the way, I do not know if it depends on what I do, I find that the Alpha version is quite stable. Moreover, the various implementations make it much more powerful than the current stable version.
If more users begin to use it you could get a lot more feedback and eventual bugs found.
#8
The same thing happens to me, Ver. 3.4.0.6, Seven 64bit and dual monitors.
#9
In fact I took inspiration from several posts found! ;)

For Phylactere, I just downloaded it, at first glance the module does not check the position of the character nor the font size and the bubble leaves the screen and also text, with large fonts, leaves the bubble. Also the tail is always central.
Thanks anyway for the tip, I can get important information by examining the code.
#10
Quote from: Khris on Sun 08/11/2015 21:56:38
Could you post a screenshot that shows the finished product?

Of course.
I tried to use directly Think() with Custom Gui but the result does not satisfy me.

If the character is everywhere on the screen but not too close to the Top, Left and right:

   

if it's too close to the edge of the left or right:

   

if it is too close to the top I use bubble left or right. (If the character is in the first or second half of the screen)

   

In conclusion is possible to create bubbles with maximum width of 450px and maximum height of 4 rows.
I know that I'm using a lot of time for these details.
But this allows me to study well AGS.
Now I was thinking maybe I could use a single rectangular GUI resizable both in length and height and use simple sprite for the rounded corners and the tip of the bubble.
In this way I could avoid the size limitation.
Any suggestion and feedback is welcome.
#11
Thanks for your reply.
I use both functions you mentioned to assemble the GUI final

Code: ags

// begin universal code
gBubbleText.Height = bubbleHeight;
lblBubbleText.Width = tx + 10;
lblBubbleText.Height = lblBubbleHeight;
lblBubbleText.Text = testo;
gBubbleText.Width = tx + 50;
gBubbleText.ZOrder = 200;
// end universal code
if(is_centre) {
    gSideCentre.Width = (tx / 2) - 20;
    gSideCentre.SetPosition(px-10, py);
    px = px - (tx / 2) - 30;
    gSideSx.Width = gSideCentre.X - px; 
    gSideSx.SetPosition(px, py);
    gSideDx.SetPosition((gSideCentre.X + gSideCentre.Width), py);
} else {
    gSideSx.Width = tx;
    if((!is_sx) && (!bubble_out)) {
        gSideDx.SetPosition(px, py);
	gSideSx.SetPosition(gSideDx.X - tx, py);
	gBubbleText.SetPosition(gSideSx.X,  py);			
    } else {
	gSideSx.SetPosition(px, py);
	gSideDx.SetPosition((px + tx), py);
	gBubbleText.SetPosition(px,  py);	
    }
}
gSideSx.Visible = true;
if(is_centre) { gSideCentre.Visible = true; }
gSideDx.Visible = true;
gBubbleText.Visible = true;


Guis that have in their name "dim" are all resizable in width from code when necessary.
Some Gui have rounded corners and also "designs" that deforms by changing the size (are Guis without "dim").
[edit] This is a mistake, in fact, the GUI does not deform but rather it is cut by SetSize ()
The code works well and fast, it does not seem that requires excessive resources but I am happy to receive any suggestions to improve my work.
#12
Can I dynamically create a name for GUI declaration?
I have this code:

Code: ags

short bubbleHeight;
short lblBubbleHeight;

switch(increment)
{
case 1: 
    py = py - GetViewportY()-15-70;
    bubbleHeight = 70;
    lblBubbleHeight = 20;
    break;
case 2: 
    py = py - GetViewportY()-15-90;
    bubbleHeight = 90;
    lblBubbleHeight = 40;
    break;
case 3: 
    py = py - GetViewportY()-15-110;
    bubbleHeight = 110;
    lblBubbleHeight = 60;
    break;
case 4: 
    py = py - GetViewportY()-15-130;
    bubbleHeight = 130;
    lblBubbleHeight = 80;
}
bool bubble_out = (py <= 30);

// three GUIs are declared in the global variables
GUI *gSideSx;
GUI *gSideDx;
GUI *gSideCentre;
bool is_sx = px < (System.ViewportWidth / 2);
bool is_centre = ((!bubble_out) && (px - (tx / 2) > 30) && (px + (tx / 2) < (inv_ScreenResX - 30)));

if(is_centre) {
    if(increment == 1) { 
        gSideSx = gBubble_dim_sx_70; gSideDx = gBubble_dim_dx_70; gSideCentre = gBubble_centre_70;
    } else if(increment == 2) {
	gSideSx = gBubble_dim_sx_90; gSideDx = gBubble_dim_dx_90; gSideCentre = gBubble_centre_90;
    } else if(increment == 3) {
	gSideSx = gBubble_dim_sx_110; gSideDx = gBubble_dim_dx_110; gSideCentre = gBubble_centre_110;
    } else if(increment == 4) {
	gSideSx = gBubble_dim_sx_130; gSideDx = gBubble_dim_dx_130; gSideCentre = gBubble_centre_130;
    }
}
else if(is_sx) {
    if(bubble_out) {
        if(increment == 1) {
	    gSideSx = gBubbleOS_sx_70; gSideDx = gBubble_dim_dx_70;
	} else if(increment == 2) {
	    gSideSx = gBubbleOS_sx_90; gSideDx = gBubble_dim_dx_90;
	} else if(increment == 3) {
	    gSideSx = gBubbleOS_sx_110; gSideDx = gBubble_dim_dx_110;
	} else if(increment == 4) {
	    gSideSx = gBubbleOS_sx_130; gSideDx = gBubble_dim_dx_130;
	}
    [ ... ]


Currently I use a series of IF to assign gSideSx, gSideDx and gSideCentre correct GUI name.

If I could do something like:

Code: ags

String nameGui = "gBubble_dim_sx_";
nameGui = nameGui.Append(bubbleHeight); // bubbleHeight = 70 or 90 or 110 or 130
gSideSx = nameGui;


I could greatly reduce the code.
This above is just an example because of course raises error.

Is there a way to do something similar?
I've read all the manual several times but I haven't found any useful information.
In any case, are there alternative ways?

Valter
#13
Thanks Khris, I like to reduce the code as much as possible.
#14
I had heard about it, the example I had seen was based on the absence of the break at the end of the case.
Who can say that does not work on AGS? ;-D
#15
You mean to say that the code is apparently wrong even if it works or what else? I use break ... I do not understand what you want to suggest me :)
#16
Code: ags

GUI *gSideSx;
GUI *gSideDx;
bool is_sx;
short bubbleHeight;
short lblBubbleHeight;
short dxOffset = 50;
if(px < (System.ViewportWidth / 2)) {
	is_sx = true; 
} else { 
	is_sx = false; 
}
switch(increment)
{
	case 1:
		bubbleHeight = 70;
		lblBubbleHeight = 20;
		if(is_sx) { 
			talk_bubble_id = 1;
			gSideSx = gBubbleOS_sx_sx_row1;
			gSideDx = gBubbleOS_sx_dx_row1;
			px = px + (xScale/2); 
		} else {
			talk_bubble_id = 2;
			gSideSx = gBubbleOS_dx_sx_row1;
			gSideDx = gBubbleOS_dx_dx_row1;
			px = px - (xScale/2) - gSideSx.Width - dxOffset;
		}
		break;
	case 2:
        [...]
}


Thanks Crimson, you understood my question well. I know that one or more constructs can be inserted into other constructs but sometimes with other game scripting languages it was not possible to do everything possible for example in Visual Basic, Delphi ...
The code works fine, I just wanted to make sure I do not have problems later.
#17
Hi, I'm working on version 3.4.0.6.
Are in a "switch" statement allowed to use a construct "if else"?
I tried it and I found that it works fine.
Do you think that might cause unpredictable failures?
Thanks

Valter
#18
Using Say() the text always appears above the character but in this way you can't use the bubble.
Think() has a property, speech_bubble_width, which defines the maximum width of the text. This is set to 100 by default.
If the character is not too close to the edges the text is centered regularly but when it comes close to the right or left the property speech_bubble_width fails text placement.

 
 


Resizing Custom GUI according to the text content you might be able to improve the visual effect but unfortunately if the character is placed at the top of the screen, text appears covering the character giving a bad result graphic.
Then if you want to use the bubble is not convenient to use Custom thought bubble GUI but rather draw their sprite bubble (or use the GUI) and display them with text inside to the proper coordinates.

Valter
#19
Greetings all,
if you want to use in the game Custom thought bubble GUI with Think() it happens that when the character is too close to the left or right, border of the bubble GUI it leaves the screen. The text is instead displayed correctly.
Custom thought bubble GUI can't be moved through code.

Valter

SMF spam blocked by CleanTalk