A Scanner for Specific Actors?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

A Scanner for Specific Actors?

Post by Enjay »

Can anyone think of a good way to make a scanner for specific actors?

What I am looking for is for the player to be able to activate a console/ pick up a powerup/ whatever, and then specific type of actor shows up on the automap and stays there until the item is no longer in the level.

For context, the idea I have is a sort of treasure hunt, where the player has to pick up certain items until they have enough to leave. So I thought that, perhaps, either in a secret, or on easier difficulties, the player could come across something that would reveal the locations of the, as yet uncollected, items.

So, for example, can the Scanner powerup be tailored to only show a specific kind of actor?

The other thing I thought about was maybe hand-cranking it with ACS and map markers but that would probably involve a lot of tids and so on (e.g. each map marker would need an individual tid so that it could be removed when the item it is marking is picked up by the player, and every item would have to run a script to remove its own marker etc etc).
User avatar
nova++
Posts: 177
Joined: Sat Sep 04, 2021 3:13 am

Re: A Scanner for Specific Actors?

Post by nova++ »

ZScript allowable? You could run a slower sort of scan through all things in the level early on and then store an array of actors to reference later. Might work with ACS too.
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: A Scanner for Specific Actors?

Post by Enjay »

Zscript would certainly be allowable, but what you describe is likely to be beyond my ZScript-fu.

(Plus, I seem to have a mental block with arrays. No matter how many times I read about them, or have them explained to me, I just don't get them. Apparently it's very frustrating for a programmer friend of mine because he simply can't understand why something so simple gives me problems. He's explained them to me dozens of times.)
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: A Scanner for Specific Actors?

Post by Blue Shadow »

Enjay wrote:The other thing I thought about was maybe hand-cranking it with ACS and map markers but that would probably involve a lot of tids and so on (e.g. each map marker would need an individual tid so that it could be removed when the item it is marking is picked up by the player, and every item would have to run a script to remove its own marker etc etc).
Unless I'm missing something, I don't see a reason to do all that maintenance work; if the marked item is no longer there in the level, then it won't be marked on the automap.
User avatar
Enjay
 
 
Posts: 26517
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: A Scanner for Specific Actors?

Post by Enjay »

I just re-read the description of map markers. I forgot that they could be linked to an actor's tid by setting the markers args.

So I could just give each collectable item a unique tid, place the map markers and link them to the tids and then only make the markers visible (by deactivating them, because they're weird) using a script if the player finds the device to reveal them.

The tid/arg linking should mean that the markers for any items that have already been collected were removed when the item was picked up and left the map.

I'll have to try that later. It would do exactly what I want reasonably easily as I think all markers could be given the same tid for activation/deactivation I think. Thanks for the suggestion. :)

[edit] And it works like a charm. Thanks again. :thumb: [/edit]
Post Reply

Return to “Scripting”