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

#261
Hi !

I have a very simple question, I looked for a long time for an answer, but never found any...

I want to use the mouse wheel in a game to allow to scroll a slider up and down (it allows to scroll a label into a GUI to read the whole text that can't be displayed fully in the GUI).

Which functions can I use for that ?

Many thanks !

EDIT : oh sorry, I finally found out the solution... in the tutorial... It's like when I ask for help, help comes by it's own... :D
#262
Hi there !

I have noticed something that could be linked to my past problem (see first message of this thread).

I have a script in the on_keypress function :

if (keycode==eKeyCtrlH) Display("Something");

The thing is that when I hit the "delete" key (the arrow pointing to the left on the keyboard, used to remove characters in a text), this function is called (I see the "Something" message).

Any ideas of why ?
#263
Ow, sad...

Because a BMP can't have any transparency attribute, isn't it ?

My goal is to let the player choose an image for a character. For a better experience, it could be nice that this image can show the character without any blank background or something else.

Any idea to avoid that with the actual functions in AGS ?
#264
Hi there !

I found this thread, and I was asking : is there any way to use PNG files with the CreatFromFile function ? I use AGS 3.5

I hope so :)

Let me know !

Many thanks !
#265
Hi !

Sorry for the delay, I was very busy with other things of life... I didn't take the time to answer.

I finally managed to do that, but it seems my script is a lot heavier than Khris's one, so maybe I'm going to update it. :)

Thanks for your help, and also, sorry for the late answer !!!
#266
Yes it seems I had to sort a smaller array, I managed to solve it.

By the way, I still have problems to script the sorting of my coordinates through the two arrays :S

Anyone has an idea please ?

(sorry for the multiposts...)
#267
It seems I can't sort an array that has a too great size.

So I'm still looking for a solution, if someone has an idea... Many thanks for helping !
#268
OK, so I tried something by using your algorythm EriOo. But when I launch AGS, and try the function, I have an error :

"Stack Overflow" on lines : "_swap(arr, i, j);" in "partition", then in "int p = _partition(arr, lo, hi)" and "_quicksort(arr, p+1, hi)" in "_quicksort".

What does it mean ?

#269
Hmm, the only thing I want to stock is the coordinates (it will help me to automatically place tokens on the map with dedicated functions, just by naming the "number" of the "zone" where I place "which" token).

I have a struct "Cartes", where I could stock these arrays if needed. But I don't understand how it will help to sort the variables ?
#270
When I say from top-left to down-right, I mean : if the map's top left corner has the (0, 0) coordinates, I want my zones to be sorted from the highest line (y=0) to the lowest, and also from left (x=0) to right (y=0). It means : between z1(0, 50), z2(20, 50) and z3(40, 0) , z3 is the first zone (y=0) and z1 is sorted before z2.

Well I'm not sure to understand what you expect me to do with the struct... could you explain me a bit more please ?

Thanks for the help, anyway ! :)
#271
I had a look to your algorythm. Very good job !

My problem is that I need to sort two arrays at the same time.

It would mean that when you find the lowest y-coordinates, you put it in the 1st place of the new array, while putting also the relative x-coordinate to the 1st place of the other new array.
#272
Thanks ErioO ! I edited my post with more precisions (I was doing it when you answered :) )

I'm going to have a look to the links also !
#273
Hi !

I come with a new brain problem.

I have "stocked" some coordinates of objects (tokens for my game) into 3 arrays of int :

TypeZoneExp : indicates the type of the zone (it's an int, but I'm using an enum to not be lost with numbers...)
XZoneExp : the x-coordinate of the zone "i"
YZoneExp : the y-coordinate of the zone "i"

where i can be a number like 30 or 40 max, it depends of the map (the size of the arrays is changing according to the needs).

I want to sort the zones' coordinates from the top left to the down-right. So the first line of zones (YZoneExp = 0, for example), then the seconde line etc...

Is there any built-in function to do that ? Or useful functions ?

If not, I imagine using loops and loops, but maybe it can be done easier :)

EDIT : I just precise the situation :

In a chosen map, I want some tokens to be placed. I stock their coordinates so I can manipulate them later.
For example, five tokens :
t1(0, 100)
t2(0,250)
t3(100,150)
t4(50, 0)
t5(25, 100)

Each coordinate is stocked in an array, so : XZoneExp[0]=0, XZoneExp[1]=0, XZoneExp[2]=100, XZoneExp[3]=50, XZoneExp[4]=25 and YZoneExp[0]=100, YZoneExp[1]=250, YZoneExp[2]=250, YZoneExp[3]=0 and YZoneExp[4]=100;

What I want is to sort the tokens' coordinates from the top-left to the down-right. It would be : t4, t1, t5, t3, t2

And so their values "match" in the two arrays : XZoneExp[0]=50, YZoneExp[0]=0 ; XZoneExp[1]=0, YZoneExp[1]=100 etc...
#274
Advanced Technical Forum / Re: Label limit ?
Thu 01/04/2021 11:29:21
OK, so it is a nice information :)

However, I found that for a script, the GetTextWidth was not "exact" (or I misunderstood something) : I wanted to get a label's width to get this label with only one line. And I had to write :

mylabel.Width = GetTextWidth(mylabel.Text, mylabel.Font) + 1;

This "+1" was needed, without it my text was written in two lines.

Engine problem ?

Maybe it is the same problem for Height ?
#275
Advanced Technical Forum / Label limit ?
Thu 01/04/2021 10:39:28
Hi !

I found other threads about it, but I need to have a confirmation from that year since AGS has been updated. Sorry if I didn't find the answer in an earlier thread, I tried to search, but maybe I didn't see it..?

Well, my question is simple : is there a limit of characters inside a label ? It seems one of my labels is cut just before the end of the text.
#276
Sorry for delay for answering, I got some other people testing this issue, and at the moment I don't know if AGS reacts to a key press when it is ALT TAB, or when someone clicks elsewhere the window mode... I didn't get the issue, another people said it to me. I'm going to inspect it deeper :)
#277
Hi !

I encounter a problem : when in windowed mode, if I click outside the game (so outside the window of the game), it results in an event I scripted in on_key_press : "if (keycode==eKeyS)".

Normally, if I put the S key, it shows a message at the screen (it is like a cheat code for play-testing). And when I click outside of the screen of the game, this message appears.

An idea ?
#278
Hi ! I discover this thread, and what is this plugin about ? What does it do ? Is it for a better quality of sprites ?
#279
Hi there !

So I started the function for a "scrollable label".

It seems to be working with a button and a dynamic sprite and the DrawStringWrapped() function.

BUT the texts is drowed with like a bad quality. The font is not very polished (don't know if it is the english word for that, but in fact, I can see pixels very easily !).

Is there any possibility to have the DrawStringWrapped() in better quality ?

If not, I will maybe think for another solution.
#280
Many thanks Crimson Wizard ! It works now as intended :)

In fact, I got engine error when I put this line under the "s.Release()" line. It said something like "DrawingSurface is intended to be used before".

Everything seems to be working now, thanks you !

And I noticed the UnpauseGame() problem, maybe my script is getting Paused twice, but I will see !
SMF spam blocked by CleanTalk