A question about How touse Cliloc in GUMP

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.

Moderator: POL Developer

Post Reply
flamewing
Neophyte Poster
Posts: 31
Joined: Thu Dec 04, 2008 6:10 am

A question about How touse Cliloc in GUMP

Post by flamewing » Mon Jun 05, 2017 10:31 pm

I found Gump texts have many scripts
like
GFTextEntry(gump, 360, 133, 250, 25, 35, "Text Entry #1");
or
GFTextLine(gump, 25, 25, 1153, "Standard text");
or
GFTextMid(gump, 15, 100, 610, 1153, "whatever");
or some like
Var mygump := {
"Page 0",
"ReSizePic 350 220 3600 150 120",
"Text 390 240 2494 0",
"Button 370 242 2118 2117 1 0 1",
"Text 390 260 2494 1",
"Button 370 262 2118 2117 1 0 2",
"Text 390 280 2494 2",
"Button 370 282 2118 2117 1 0 3",
"Text 390 300 2494 3",
"Button 370 302 2118 2117 1 0 4"
};

Var mygumptext := {
"A",
"b",
"C",
"D"
};

Var Effect := SendDialogGump( who, mygump, mygumptext );
I feel confused.
How could I use cliloc in GUMP

Could some one make a sample for me?

Thx.

ThisIsMe
Distro Developer
Posts: 68
Joined: Sun Jul 17, 2016 1:29 am
Contact:

Re: A question about How touse Cliloc in GUMP

Post by ThisIsMe » Tue Jun 06, 2017 9:59 am

I love Gump's and have been trying to use clilocs when and where ever possible, with that said I only know of one way to utilize clilocs and that is through an html gump element. Below are two example Gump's, well they're not just throw away, I put them in my boat pkg to replace the character direction facing to determine how a ship is facing when it is used. In them you'll see the use of cliloc numbers, the second is a replacement drydock gump, which I like better than just the yesno that was being used.

Code: Select all

function ForShipFacing( mobile )
	var gump := GFCreateGump();

	GFClosable(gump, 0);
	GFDisposable(gump, 0);
	GFPage(gump, 0);
	GFResizePic(gump, 15, 15, 9200, 220, 180);
	GFResizePic(gump, 25, 25, 3000, 200, 160);
	GFResizePic(gump, 35, 35, 3000, 180, 80);
	GFAddButton(gump, 35, 120, 4005, 4007, GF_CLOSE_BTN, 1);
	GFAddButton(gump, 130, 120, 4005, 4007, GF_CLOSE_BTN, 2);
	GFAddButton(gump, 35, 150, 4005, 4007, GF_CLOSE_BTN, 3);
	GFAddButton(gump, 130, 150, 4005, 4007, GF_CLOSE_BTN, 4);
	GFAddHTMLLocalized(gump, 39, 39, 170, 70, 1116329);
	GFTextLine(gump, 70, 120, 0, "WEST");
	GFTextLine(gump, 165, 120, 0, "NORTH");
	GFTextLine(gump, 70, 150, 0, "SOUTH");
	GFTextLine(gump, 165, 150, 0, "EAST");

	var input := GFSendGump(mobile, gump);
	
	var flag;
	input := input[0];
	
		case( CInt( input ))
				1:      flag := CRMULTI_FACING_WEST;
						break;
				2:      flag := CRMULTI_FACING_NORTH;
						break;
				3:      flag := CRMULTI_FACING_SOUTH;
						break;
				4:      flag := CRMULTI_FACING_EAST;
						break;
			Default:	SendSysMessage(mobile, "Cancelled.");
						break;
		endcase
	return flag;
endfunction

function ConfirmDryDock( mobile )
	var gump := GFCreateGump();
	
	GFPage(gump, 0);
	GFResizePic(gump, 15, 15, 5054, 220, 170);
	GFResizePic(gump, 25, 25, 3000, 200, 150);
	GFAddHTMLLocalized(gump, 35, 35, 180, 80, 1018319, 1, 0); //Do you wish to dry dock this boat?
	GFAddButton(gump, 35, 115, 4005, 4007, GF_CLOSE_BTN, 1);
	GFAddButton(gump, 35, 140, 4005, 4007, GF_CLOSE_BTN, -1);
	GFAddHTMLLocalized(gump, 70, 115, 140, 25, 1011011); //CONTINUE
	GFAddHTMLLocalized(gump, 70, 140, 140, 25, 1011012); //CANCEL

	var input := GFSendGump(mobile, gump);
	
	if( !input )
		SendSysMessage( mobile, "Canceled." );
	return 0;
	endif	
	
	var response;
	input := input[0];
	case( CInt( input ))
			1:      response := 1;
					break;
			2:      response := 0;
					break;
	endcase

        return response;
endfunction

ThisIsMe
Distro Developer
Posts: 68
Joined: Sun Jul 17, 2016 1:29 am
Contact:

Re: A question about How touse Cliloc in GUMP

Post by ThisIsMe » Tue Jun 06, 2017 10:07 am

Forgot to mention, it's pretty clear looking at it but if you missed it, this is what you use to utilize cliloc texts:

GFAddHTMLLocalized(gump, <X>, <Y>, <Width>, <Height>, <Cliloc Number>);

You can also color the text which will add additional parameters to the this and will look like this:

GFAddHTMLLocalized(gump, 280, 410, 120, 20, 1060675, 0, 0, LabelColor);

Where the 0's following the cliloc entry is whether to show the background and/or scroll bar and LabelColor in this instance as I ripped it out of an active project equals 0x7FFF.

flamewing
Neophyte Poster
Posts: 31
Joined: Thu Dec 04, 2008 6:10 am

Re: A question about How touse Cliloc in GUMP

Post by flamewing » Tue Jun 06, 2017 5:45 pm

ThisIsMe wrote:
Tue Jun 06, 2017 10:07 am
Forgot to mention, it's pretty clear looking at it but if you missed it, this is what you use to utilize cliloc texts:

GFAddHTMLLocalized(gump, <X>, <Y>, <Width>, <Height>, <Cliloc Number>);

You can also color the text which will add additional parameters to the this and will look like this:

GFAddHTMLLocalized(gump, 280, 410, 120, 20, 1060675, 0, 0, LabelColor);

Where the 0's following the cliloc entry is whether to show the background and/or scroll bar and LabelColor in this instance as I ripped it out of an active project equals 0x7FFF.
HI~thanks for your help~

how about the last one like arrays list?

I don't know how to use this way.

ThisIsMe
Distro Developer
Posts: 68
Joined: Sun Jul 17, 2016 1:29 am
Contact:

Re: A question about How touse Cliloc in GUMP

Post by ThisIsMe » Tue Jun 06, 2017 9:46 pm

For localized text, I am not sure to be honest, I know it is possible, I would suggest grabbing a copy of gump studio and putting together a test gump and exporting as both a bare gump style and distro gump pkg style. The distro gump pkg which is the following style layout I find to be much easier to read and uses the bare style to build the gumps, in a more convenient manner in my humble opinion, though I am possibly biased, I got used to looking at RunUO scripts to see how things are done over there and their gump stuff is very similar in layout to the distro gump pkg style.

Distro Gump Style:
GFAddHTMLLocalized(gump, <X>, <Y>, <Width>, <Height>, <Cliloc Number>);

Bare Style(called as such in Gump Studio so that is how I will refer to it):
"xmfhtmlgump <X> <Y> <Width> <Height> <Cliloc Number> 0 0"

the two 0's at the end pertain to the scroll bar and background I am just not sure which is which. I would advise if you are planning on putting new gumps together to use the Distro Gump Style, it is easier to read and keep track of what is going on, also and I cannot recommend this enough, use comments to describe what each line you are using clilocs on are, unless you're a memory machine and can remember every cliloc entry and their corresponding number, you will get lost if let's say you plan to put together a large gump that deals with the guild system or housing stuff.

flamewing
Neophyte Poster
Posts: 31
Joined: Thu Dec 04, 2008 6:10 am

Re: A question about How touse Cliloc in GUMP

Post by flamewing » Wed Jun 07, 2017 4:12 am

ThisIsMe wrote:
Tue Jun 06, 2017 9:46 pm
For localized text, I am not sure to be honest, I know it is possible, I would suggest grabbing a copy of gump studio and putting together a test gump and exporting as both a bare gump style and distro gump pkg style. The distro gump pkg which is the following style layout I find to be much easier to read and uses the bare style to build the gumps, in a more convenient manner in my humble opinion, though I am possibly biased, I got used to looking at RunUO scripts to see how things are done over there and their gump stuff is very similar in layout to the distro gump pkg style.

Distro Gump Style:
GFAddHTMLLocalized(gump, <X>, <Y>, <Width>, <Height>, <Cliloc Number>);

Bare Style(called as such in Gump Studio so that is how I will refer to it):
"xmfhtmlgump <X> <Y> <Width> <Height> <Cliloc Number> 0 0"

the two 0's at the end pertain to the scroll bar and background I am just not sure which is which. I would advise if you are planning on putting new gumps together to use the Distro Gump Style, it is easier to read and keep track of what is going on, also and I cannot recommend this enough, use comments to describe what each line you are using clilocs on are, unless you're a memory machine and can remember every cliloc entry and their corresponding number, you will get lost if let's say you plan to put together a large gump that deals with the guild system or housing stuff.
you mean POL GUMP seems like RUNUO GUMP? :o

Turley
POL Developer
Posts: 645
Joined: Sun Feb 05, 2006 4:45 am

Re: A question about How touse Cliloc in GUMP

Post by Turley » Thu Jun 08, 2017 10:07 am

It not only seems to be same it is the same, since this is 100% of how the client gets the gump send.
I personally prefere the raw style to build a gump instead of using eg the distro functions. I don't get why I should call a function which simply joins all arguments ;)

ThisIsMe
Distro Developer
Posts: 68
Joined: Sun Jul 17, 2016 1:29 am
Contact:

Re: A question about How touse Cliloc in GUMP

Post by ThisIsMe » Thu Jun 08, 2017 10:49 am

Turley wrote:
Thu Jun 08, 2017 10:07 am
It not only seems to be same it is the same, since this is 100% of how the client gets the gump send.
I personally prefere the raw style to build a gump instead of using eg the distro functions. I don't get why I should call a function which simply joins all arguments ;)
I can see that argument, personally I just find it easier with the distro style to read for me personally is all and without GS I probably would do a lot less stuff with gumps, I'm a menu person so I'm very glad that tool and Nando's plugin for it is around! :)

Yukiko
Distro Developer
Posts: 2524
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: A question about How touse Cliloc in GUMP

Post by Yukiko » Thu Jun 08, 2017 2:55 pm

Gumps have always been frustrating for me to create manually, Distro style or otherwise. Gump Studio has been a great help. I used it to create the simple gumps I added to the banker AI in the Distro-Alt but it can be used for complex multi-page gumps too. If anyone knows where or if the source code for it is available please post a link. There are some things that need updated with it.
Sincerely,
Yukiko

I would tell you a UDP joke but you might not get it.

Titus 2:13

flamewing
Neophyte Poster
Posts: 31
Joined: Thu Dec 04, 2008 6:10 am

Re: A question about How touse Cliloc in GUMP

Post by flamewing » Thu Jun 08, 2017 5:06 pm

Thanks everyone that replied this post.
My "Chinesization" project is in progress.
It's all with your help!
:bacondance:
Thanks again!

Post Reply