kristus Posted February 17, 2011 So. I have this area of a map where I give a text clue to find something that I want the player to find. In this case a key. Now once that key is picked up. I don't want the player to keep activating the message. But I don't know how that works in Hexen/ACS. In FS I had to check the life of the item (usually over and over with a loop). And once it disappeared, the game considered it dead and the script would change. But I think ACS got something more eloquent in store for this. But I dunno how to do it and I am not sure where I can find a good example that I can look at. 0 Share this post Link to post
printz Posted February 17, 2011 IIRC and understand what you're asking for (a "you need to do that" message only until you retrieve the item): Make the key activate a script on pick-up (by giving the thing an ACS_Execute special) that sets a global variable to 1 (it will be 0 on map startup). Make the message-triggering script check if that global variable is set, and only display the message if the variable is cleared. If the key and the puzzle-door are in different maps of the hub, you'll need to use a 'world' variable instead. I don't remember how it's done exactly, but I guess it's about adding variables to an included ACS file that comes shipped with ACC. Hopefully the Hexen Specs covers this feature. 0 Share this post Link to post
Gez Posted February 17, 2011 What Printz says (put special 80 on the key to make it trigger a script) would work. Alternatively, you may use a FraggleScript-like approach by using ThingCount (looking at the Hexen source code, it should work just like explained on the ZDoom wiki). The Hexen keys have spawn numbers in the 85-94 range, depending on type. printz said:If the key and the puzzle-door are in different maps of the hub, you'll need to use a 'world' variable instead. I don't remember how it's done exactly, but I guess it's about adding variables to an included ACS file that comes shipped with ACC. Hopefully the Hexen Specs covers this feature. World scope is explained on the ZDoom wiki. I'm pretty sure it's the same system in vanilla Hexen, the only difference here would be that I think global scope is a ZDoom addition. 0 Share this post Link to post
EarthQuake Posted February 17, 2011 If the object is a key, it makes more sense to use CheckInventory() rather than ThingCount(). Is the message triggered in the map, say when crossing a linedef, or does it always stay on screen until you pick up the key? If it's the former, it's as simple as: Script 1 (void) { If(!CheckInventory("RedCard")) Print(s:"Clue about red key here."); }One line of code. 0 Share this post Link to post
printz Posted February 17, 2011 Having checked the hexen specs now, I can say that Gez is right concerning world variables, but it's also a good idea to define them in the central WVARS.ACS included file, so that every script can use them. Also, as an erratum, I meant "map" scope in my post, not "global" scope which is ZDoom-exclusive. I was using general programming wording there. I couldn't find 'CheckInventory' in the Hexen Specs, so I assume it doesn't exist in Hexen. 0 Share this post Link to post