Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Narehop on Sat 07/04/2018 17:06:21

Title: [MODULE] Custom WindowsText GUI (i can't run it)
Post by: Narehop on Sat 07/04/2018 17:06:21
Hi everyone, at the first, sorry for my bad english. I'm going to try to explain me as well i can.

Today I found this module that it can custome our WindowsText Gui and maybe this is what I need to do my speech bubbles on my game.
--> Topic to download this module <-- (http://adventuregamestudio.fr-bb.com/t2637-windows-gui-texte)

But I've a problem with the code. When i install the scripts and run the game, it breaks. I'm so newbie coding anything but i've this problems to solve:
(https://i.gyazo.com/96f5b4d149785916270188791807f220.png)

here i copy the original CODE:

Code (ags) Select

// new module script

function Parler(this Character*,int Longueur,int Nb,  String TexteGui) {
if ((this.x>=0)&&(this.x<=400)&&(this.y>=0)&&(this.y<=300)) {
    Droite=this.x;
    Haut=this.y+30;
}
if ((this.y>=301)&&(this.y<=600)&&(this.x>=0)&&(this.x<=400)) {
    Droite=this.x;
    Haut=this.y-280;
}
if ((this.x>=401)&&(this.x<=800)&&(this.y>=0)&&(this.y<=300)) {
    Droite=this.x-100;
    Haut=this.y+30;
}
if ((this.x>=401)&&(this.x<=800)&&(this.y>=301)&&(this.y<=600)) {
    Droite=this.x-100;
    Haut=this.y-280;
}

    SetTextWindowGUI(Nb);
    DisplayAt(Droite, Haut, Longueur,TexteGui);
}


is this code working? i never see "droite" and "haut" in ags and i don't know what the f*** is (laugh)(laugh)

anyone can help me to make works this module? Thank you so much.
Title: Re: [MODULE] Custom WindowsText GUI (i can't run it)
Post by: Crimson Wizard on Sat 07/04/2018 17:13:14
This is french. "Droit" is "right", "Haut" is... "up" I think.

Just put this in the beginning of Parler function:
Code (ags) Select

int Droite;
int Haut;


Anyway, the module is so tiny... one small function and two GUIs you can import. Not sure what it supposed to do.

EDIT: Oh, its just a way to switch between different GUIs to let each character has a separate one...

BTW, I honestly did not know there is function SetTextWindowGUI in AGS.

EDIT2: And it has hardcoded screen coordinates! And character's coordinates are not converted from room coords into viewport ones! Which means that module won't work in scrolling room.
I would not use it without doing some rewrite first.
Title: Re: [MODULE] Custom WindowsText GUI (i can't run it)
Post by: Narehop on Sat 07/04/2018 17:29:52
Quote from: Crimson Wizard on Sat 07/04/2018 17:13:14
This is french. "Droit" is "right", "Haut" is... "up" I think.

Just put this in the beginning of Parler function:
Code (ags) Select

int Droite;
int Haut;


Anyway, the module is so tiny... one small function and two GUIs you can import. Not sure what it supposed to do.

EDIT: Oh, its just a way to switch between different GUIs to let each character has a separate one...

BTW, I honestly did not know there is function SetTextWindowGUI in AGS.

EDIT2: And it has hardcoded screen coordinates! And character's coordinates are not converted from room coords into viewport ones! Which means that module won't work in scrolling room.
I would not use it without doing some rewrite first.

i want to do this:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=52225.msg636583822#msg636583822

but i don't want to disturb Snarky so much... maybe he's busy to program some code for help me
Title: Re: [MODULE] Custom WindowsText GUI (i can't run it)
Post by: Snarky on Sat 07/04/2018 18:14:45
Hey Narehop, don't worry about disturbing me. I haven't had time to work on it during the week, but I've given it some thought, and I'll make a custom version of the module for you tomorrow.