|
Genmiltiad Newbie
Joined: 04 Jun 2010 Posts: 4
|
Posted: Fri Jun 04, 2010 6:09 pm
Trying to setup global variables in a second module |
Im trying to use variables from the main Achea window in multiple windows. I am testing using the health guage in another window at the moment. What I did as mentioned below is setup another module outside the others and set it to a global package. I then defined global version of my hp variables @hpg and @maxhpg and assigned them
@hpg = @hp
@maxhpg = @maxhp
referencing the hp/maxhp vars from the Achea module to the global variables.
The vars hpg and maxhpg seem to get the value from the hp and maxhp variables.... but the guage wont update dynamically like the guage does in the main window. Any tips here? I know they have the current values because if I just redo the guage it shows the current valies in hp and maxhp but it wont update by itself. |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Fri Jun 04, 2010 8:37 pm |
It won't work. Variables defined within a window will not be seen outside of that window. To make a variable seen by other windows or modules, you must put the variable into a module, not a window.
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Jun 04, 2010 8:47 pm |
Pretty sure you misread something there, Rahab. He's having trouble getting his buttons to recognize the variables in the module, not the other way around.
My guess is that perhaps he forgot to update his button so that it's using the hpg variables. My suggestion is to do away with the hpg nonsense and move his hp variables and whatever triggers populate those variables out to the module.
It's quite possible that this is just a really old bug that got fixed a long time ago in the current beta cycle. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Sat Jun 05, 2010 1:22 pm |
Oops, you're right. I thought the variables were in window.
|
|
|
|
|
|