[Latest (GZDoom pre-605)] Get/SetUserVar/Array not working?

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: [Latest (GZDoom pre-605)] Get/SetUserVar/Array not working?

Re: [Latest (GZDoom pre-605)] Get/SetUserVar/Array not worki

by randi » Sun Mar 06, 2016 10:18 pm

Re: [Latest (GZDoom pre-605)] Get/SetUserVar/Array not worki

by Graf Zahl » Sun Mar 06, 2016 2:29 am

That may be. I debbuged this and it doesn't even seem to find the user variables anymore, so they always return 0.

Re: [Latest (GZDoom pre-605)] Get/SetUserVar/Array not worki

by LilWhiteMouse » Sun Mar 06, 2016 2:08 am

I think this is what's causing my problems. I did my own test, and it seems Get/SetUserArray() does not work. GetUserArray() always seems to return 0 in my tests.

Re: [Latest (GZDoom pre-605)] Get/SetUserVar/Array not worki

by Zhs2 » Thu Mar 03, 2016 11:05 am

Alright. After thinking a little more on how to properly represent this problem without a huge project file, I have smithed together a crude example that reproduces this case. This is the example in question. To reproduce: "pukename userarraytest" in console. In GZDoom 2.1.1 (ZDoom 2.8.1), this example *just works*, meaning it is able to correctly retrieve values stored to the array entries it scans through until it finds an empty position to store another value to, stores it, and stops there. In the latest version (topic title), it seems the value either never gets set or retrieved correctly (probably the former), and thus the script only attempts to store to position 0 of the player's user array.

Relevant code:

Code: Select all

#library "testcasegoboink"
#include "zcommon.acs"

script "UserArrayTest" (void)
{
    int randomvalue = UniqueTID();
    for(int i = 0; i < 999; i++)
    {
        if(GetUserArray(0, "User_TestArray", i))
        {
            continue;
        }
        else
        {
            SetUserArray(0, "User_TestArray", i, randomvalue);
            HUDMessageBold(s:"I stored the value ", i:randomvalue, s:" to User_TestArray at position ", i:i;HUDMSG_FADEOUT|HUDMSG_LOG, 900, CR_GOLD, 0.5, 0.1, 3.0, 0.5);
            break;
        }
    }
}

Re: [Latest (GZDoom pre-605)] Get/SetUserVar/Array not worki

by Graf Zahl » Thu Mar 03, 2016 4:13 am

1. Provide feedback when being asked to verify.
2. Give a version number.
3. Provide something testable.

So far neither of this is present.

Re: [Latest (GZDoom pre-605)] Get/SetUserVar/Array not worki

by Major Cooke » Mon Feb 29, 2016 4:43 pm

I recall a bug closely related to this was fixed a while ago.

[Latest (GZDoom pre-605)] Get/SetUserVar/Array not working?

by Zhs2 » Mon Feb 29, 2016 12:33 pm

As the title says. Currently I have a case set up to reproduce this problem, but the project is rather large and the steps to reproducing are slightly complex, and building the perfect smaller example to reproduce this eludes me for the moment... Either that or I am annoyed by the fact that setting up a reproduction case requires a new player class and thus a MAPINFO, a comprehensive script that reports feedback to the user via HUDMessages, the works. Sorry for complaining, but yeah...

Top