ur not far off. The problem is that ur treating the global/local varibles, as the same thing as the varibles within a script, they are not the same thing.
the name argument, is not a varible, its a string.
i dont know if u know what a hash table is, but thats basically how the global varibles work.
a hash table stores data to specific strings.
ie, you have a string "string1" and assign a value to it.
then when you want to use that again, it searchs for "string1" and returns the stored value.
to change then ame argument from a varible to a string, for both set and get. IE,
Code: Select all
$wave = get global varible, name = 'plugin.wave'
althou, as a convention, i would add the name of the script as well, its not required, its just a convention
say the script is called khaak invasion, u could have something like
Code: Select all
$wave = get global varible, name = 'khaakinvasion.wave'
$wave = get global varible, name = 'plugin.khaakinvasion.wave'
$wave = get global varible, name = 'khaak.wave'
$wave = get global varible, name = 'plugin.khaak.wave'
some authors add thier initials as well, this just makes it so no other users will user the same varible causing the problems, this is very rare, but it is possible.
the problem your having, is that when you get or set the varible, what happens is the varible "$plugin.wave" will return null, as will $plugin.x, and $plugin.y
which means, that when all your varible calls basically end up looking like this
Code: Select all
$wave = get global varible, name = NULL
as they are all null, they are all effectivly the same varible, so they will replace each other, so, the value that it returns, will be the last one that was set.
say u have this
Code: Select all
set global varible, name = $plugin.wave, value = 1
set global varible, name = $plugin.x, value = 2
set global varible, name = $plugin.y, value = 3
and u call them back again
Code: Select all
$wave = $get global varible, name = $plugin.wave
$x = $get global varible, name = $plugin.x
$y = $get global varible, name = $plugin.y
u would expect them to be, $ware = 1, $x = 2, $y = 3.
but what you actually get is, $ware = 3, $x = 3, $y = 3.
which is most likly where your problems first arrise
hopefully that made abit of sense