How Do I Shot Web?

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
xtkaythen
Posts: 20
Joined: Mon Apr 06, 2009 12:16 pm
Contact:

How Do I Shot Web?

Post by xtkaythen »

If web was a door, and the shot was granted exclusive rights to -- you know what?

It's really late where I am, and I have a final due in the morning, so I'm gonna go work on that, and have you childish and idiotic peons work this out for me ask the helpful, lovely community take a look at this if they could:

Is there a way to detect a specific class of projectile, such as, say, a missile or a beam, to trigger a linedef, such as, say, opening a door? The thing is, it must NOT be triggered by other types of projectiles.

Basically, if somebody could get a door to open by the plasma rifle but not by the shotgun or the rocket launcher, I will mail you a post-card saying whatever you want on it.
Blue Shadow
Posts: 5043
Joined: Sun Nov 14, 2010 12:59 am

Re: How Do I Shot Web?

Post by Blue Shadow »

[wiki]CheckWeapon[/wiki] ACS function might do what you want.
User avatar
jpalomo
Posts: 772
Joined: Mon May 17, 2010 9:45 am

Re: How Do I Shot Web?

Post by jpalomo »

The only problem with CheckWeapon you might run into is if the player happens to switch weapons before the projectile connects. I managed to work around this. From Mage's Arsenal:
Spoiler:
There are 2 problems with the above code though. You must have "missilesactivateimpactlines" enabled and I haven't tested it with hitscan attacks (you might be able to do it with the bulletpuff?).
User avatar
Enjay
 
 
Posts: 27115
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: How Do I Shot Web?

Post by Enjay »

jpalomo wrote:The only problem with CheckWeapon you might run into is if the player happens to switch weapons before the projectile connects.
Would it also be a problem if something else (e.g. an enemy) had a stray shot that hit the web while the player just happened to have the correct weapon readied or does CheckWeapon only check the script activator's inventory?
Blue Shadow
Posts: 5043
Joined: Sun Nov 14, 2010 12:59 am

Re: How Do I Shot Web?

Post by Blue Shadow »

According the source code, there's a check for non-player actors:

Code: Select all

        case PCD_CHECKWEAPON:
            if (activator == NULL || activator->player == NULL || // Non-players do not have weapons
                activator->player->ReadyWeapon == NULL)
            {
                STACK(1) = 0;
            }
            else
            {
				STACK(1) = activator->player->ReadyWeapon->GetClass()->TypeName == FName(FBehavior::StaticLookupString (STACK(1)), true);
            }
            break;
User avatar
BloodyAcid
Posts: 372
Joined: Thu Jul 26, 2012 10:28 pm
Location: Canadia

Re: How Do I Shot Web?

Post by BloodyAcid »

Here's my [censored word] solution that doesn't work:
Spoiler:
xtkaythen
Posts: 20
Joined: Mon Apr 06, 2009 12:16 pm
Contact:

Re: How Do I Shot Web?

Post by xtkaythen »

jpalomo wrote:The only problem with CheckWeapon you might run into is if the player happens to switch weapons before the projectile connects. I managed to work around this. From Mage's Arsenal:
Spoiler:
There are 2 problems with the above code though. You must have "missilesactivateimpactlines" enabled and I haven't tested it with hitscan attacks (you might be able to do it with the bulletpuff?).
I just googled your project and this is pretty much EXACTLY what I am going to do xD. The concept for Metroid Prime is the way that Heretic was presented to me. I was dissapointed, and now I want to make a wad to show what I thought Heretic would be.

I'm thinking about making a script that works with HateTarget and manually open the door that way. What do you think? this could only be made more useful by
a.)
not having the bullet target IN the actual doorway or
b.)
somehow making

The setup:
Spoiler:
Locked

Return to “Editing (Archive)”