Fletcher` Posted November 10, 2004 int mapvar0; script 8 (void) { mapvar0++; } script 9 OPEN { hudmessage(s:"score: ", i:"mapvar0", s:" points"; HUDMSG_PLAIN, 0, CR_UNTRANSLATED, 1.0, 0.0, 0); } For some reason mapvar0 in script 9 is completely unaffected by script 8. I'm trying to set up a simple score system. 0 Share this post Link to post
Graf Zahl Posted November 10, 2004 You have to write i:mapvar0 instead of i:"mapvar0". In this case "mapvar0" is just a normal string which in ACS gets converted into an index in the string table (let's say index 1). So your code says hudmessage(..., i:1, ...); and will happily print out the 1 (or whatever index it gets assigned to.) 0 Share this post Link to post
boris Posted November 11, 2004 I think you have to call hudmessage again after changing the value. 0 Share this post Link to post
The Ultimate DooMer Posted November 11, 2004 That's correct, as the hudmessage won't change until you tell it to. Try this: script 9 OPEN { hudmessage(s:"score: ", i:"mapvar0", s:" points"; HUDMSG_PLAIN, 0, CR_UNTRANSLATED, 1.0, 0.0, 0); delay(1); Restart; } 0 Share this post Link to post
Graf Zahl Posted November 11, 2004 The Ultimate DooMer said:That's correct, as the hudmessage won't change until you tell it to. Try this: script 9 OPEN { hudmessage(s:"score: ", i:"mapvar0", s:" points"; HUDMSG_PLAIN, 0, CR_UNTRANSLATED, 1.0, 0.0, 0); delay(1); Restart; } Better try: script 9 OPEN { hudmessage(s:"score: ", i:mapvar0, s:" points"; HUDMSG_PLAIN, 0, CR_UNTRANSLATED, 1.0, 0.0, 0); delay(1); Restart; } unless you want the index of the string "mapvar0" to be printed. 0 Share this post Link to post
Fletcher` Posted November 11, 2004 I tried putting it into a loop yesterday, and it still does nothing. 0 Share this post Link to post
The Ultimate DooMer Posted November 11, 2004 Ok, try this instead: script 9 OPEN { hudmessage(s:"score: ", d:mapvar0, s:" points"; HUDMSG_PLAIN, 0, CR_UNTRANSLATED, 1.0, 0.0, 0); delay(1); Restart; } That's what I use in my scoring system, so it should work. 0 Share this post Link to post
Graf Zahl Posted November 11, 2004 Arrgh. Now I see that it is an OPEN script. OPEN scripts don't belong to any actor in the game and thus the message isn't printed. Either use hudmessagebold to display your message or use an ENTER script. 0 Share this post Link to post
Fletcher` Posted November 12, 2004 int mapvar0; script 8 (void) { mapvar0++; } script 9 ENTER { hudmessagebold(s:"score: ", i:mapvar0, s:" points"; HUDMSG_PLAIN, 0, CR_UNTRANSLATED, 1.0, 0.0, 0); delay(1); restart; } It's still not working. 0 Share this post Link to post