Dynamically updating gumps.

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Dynamically updating gumps.

Post by Yukiko »

Any way to script those?

You know, like the skill gump that changes as your skills increase or the small status gump with the "thermometer" gauges or the large status gump with the numbers that update dynamically.
neizarr
Neophyte Poster
Posts: 30
Joined: Thu Dec 07, 2006 11:33 pm

Post by neizarr »

Yes and no? :)

The Yes : If you get the script PID for the script running the gump then you have some degree of control over the gump. Here is the sequence you would have to follow. This assumes you are using a custom skill gump like I am. I think the default OSI skill gump automatically updates dynamically as long as you send the right packets to the client.

1) When player presses alt-K for skills, store the PID of the script to a #cprop.
2) Detach the script
3) When a skill update happens.
a) Look for that cprop, if it exists, send a kill gump packet to the client with the script's PID. Have the packet give a return value that lets your script realize it isn't the player cancelling the gump but rather a skill update.
b) Have the script running the gump be in a loop that when the player cancels the gump it drops out of, but when the script is cancelling the gump, it simply gets the skills again, rebuilds the gump and sends it again.
4) When the player cancels the gump, delete the cprop before quitting the script.

It will all happen fast enough that the player will sometimes not even see a flicker, and other times will see a flicker, but not much more.

You can use some similar method to do a thermometer if you have enough gumps in your art that stepwise fill the thermometer, though that is a waste of space in your art IMHO.

The No : Obviously the above is faking it. :) But faking it is often good enough in gumps(and more?). There is no way to truly do dynamic changes in gumps that I am aware of at least.

Hope it helped some. If you have questions about the Yes part, feel free to ask and I'll try to give examples, the sequence may be off too, it has been a while since I looked at those stance scripts.
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Post by Yukiko »

Thanks.

I figured that was probably the way it would have to be done.
MuadDib
Former Developer
Posts: 1091
Joined: Sun Feb 12, 2006 9:50 pm

Post by MuadDib »

Correct, that is the way to handle it. Via the kill gump packet and using those methods more or less.

And yes, the skill window is done via update packets dynamically for the client one.
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Post by Austin »

In the 097 distro there are functions in the gumps package to auto-close a gump. gumps_ex.inc

GFCloseGump() and GFCloseGumpTimed()
Yukiko
Distro Developer
Posts: 2826
Joined: Thu Feb 02, 2006 1:41 pm

Post by Yukiko »

Yes. I have seen those Austin and since I am using a marriage between POL 0.97 and converted POL 0.95 I have incorporated your gumps system (along with the old one for compatibility until I get all converted) into my scriptbase.

I'll have to play around with them.
Post Reply