Page 1 of 1

How to restart script? Gump loop?

Posted: Sat Nov 03, 2018 3:38 am
by Ciechu
Hi! Easy problem... how I can restart a script by a function, for example when player use a command .start I send a gump by decl. a var := SendGump...then player hit X button, X button have function to target something and then when player make a valid target I want to send this gump with full functianolity one more time.

Is this right that I must use a loop? For example while?

I"m really sorry for my bad English.

Re: How to restart script? Gump loop?

Posted: Sat Nov 03, 2018 1:54 pm
by Harley
I think, the gump have to be in separate function, and you can repeat it with all checks after "X button".

Re: How to restart script? Gump loop?

Posted: Sat Nov 03, 2018 11:33 pm
by Ciechu
It's good idea, it will be good for optimalization? Thank you ;)

Re: How to restart script? Gump loop?

Posted: Sun Nov 04, 2018 7:53 pm
by guialtran
create a function to mount your Gump with the entries that you think necessary.
this function must return a Struct, with the items needed to be called a SendDialogGump.
hints a data structure with layout(array) and textlines(array).
if you have some Fixed Gump, you can create this structure in a variable, and use it in infinite loops.
but when you have to change the values that the gump shows, you have to replace some items in your arrays, so you better mount a new gump by calling its function that rides the screen again.