aaronhance 1 Posted July 24, 2013 When I run the script there are no errors, but the variable values are not in the hint. Thanks in advance for any help. _str = parseText format [" <t color='#38DB0F' size='1.2'>Money: %1</t> <br/> <tsize='0.2'></t> <br/> <br/> <t color='#D9B398' size='1.5'>Inventory: </t> <br/> %4 <br/> <t color='#38DB0F' size='1.2'>Space Used: %2/%3</t> <br/> ", (player getVariable "money"), (player getVariable "usedInvSpace"), (player getVariable "maxInvSpace"), hasOrange ]; hint _str; Share this post Link to post Share on other sites
kylania 546 Posted July 24, 2013 Worked as written for me in the editor. To be honest I was a little sad I didn't have Orange. Share this post Link to post Share on other sites
aaronhance 1 Posted July 24, 2013 Worked as written for me in the editor. To be honest I was a little sad I didn't have Orange. I don't get the values. so it would say "Money:" instead of "Money: 1200" Share this post Link to post Share on other sites
kylania 546 Posted July 24, 2013 You're sure that those values are set properly on whatever player you're checking? For my test I had to manually set the values before running it. Share this post Link to post Share on other sites
aaronhance 1 Posted July 24, 2013 You're sure that those values are set properly on whatever player you're checking? For my test I had to manually set the values before running it. yeah, I set them on my player init script. money = 0; maxInvSpace = 20; usedInvSpace = 0; itemOrange = 1; invAction = player addAction["Inventory", "inventory.sqf"]; //getOrangeAction = player addAction[]; Share this post Link to post Share on other sites
kylania 546 Posted July 24, 2013 Can you upload your mission somewhere maybe? Like I said, I just copied your code, changed _str to str1 (so i could paste into the debug console) and did a few setVariables and it worked just fine for me. Share this post Link to post Share on other sites
aaronhance 1 Posted July 24, 2013 Can you upload your mission somewhere maybe? Like I said, I just copied your code, changed _str to str1 (so i could paste into the debug console) and did a few setVariables and it worked just fine for me. http://www.sendspace.com/file/sibpzh Share this post Link to post Share on other sites
kylania 546 Posted July 24, 2013 You're setting global variables in "playerinit.sqf" but as global variables, not set variables on the player object, which is how you're reading them in your hint. So change playerinit.sqf to: player setVariable ["money", 0]; player setVariable ["maxInvSpace", 20]; player setVariable ["usedInvSpace", 0]; player setVariable ["itemOrange", 1]; Share this post Link to post Share on other sites
aaronhance 1 Posted July 24, 2013 You're setting global variables in "playerinit.sqf" but as global variables, not set variables on the player object, which is how you're reading them in your hint.So change playerinit.sqf to: player setVariable ["money", 0]; player setVariable ["maxInvSpace", 20]; player setVariable ["usedInvSpace", 0]; player setVariable ["itemOrange", 1]; OK, thanks for your help. Share this post Link to post Share on other sites
kylania 546 Posted July 24, 2013 Happy to help. :) Make sure your shop sets them the same way when you implement them. Share this post Link to post Share on other sites