Page 95 of 97

Re: "How do I ZScript?"

PostPosted: Mon Oct 30, 2017 12:16 pm
by ZippeyKeys12
Changing the height of an actor in ZScript only affect actor-to-actor collisions, correct?
If so, does that mean I have to morph an actor into another actor to change the height of collision with level architecture?

Also, bump:
ZippeyKeys12 wrote:Is it possible to detect multiple simultaneous key-presses inside of InputProcess?

Also is it possible to register an EventHandler while the game is running? I recall seeing ZZYZX mention this, but I can't seem to figure it out. :?

Any help would be appreciated :)

EDIT: Also, is it not possible to put a constant array in a struct?
EDIT 5: Can I access a variable in an EventHandler from my StatusBar?

Please let me know if I'm not supposed to do ^

Re: "How do I ZScript?"

PostPosted: Mon Oct 30, 2017 12:50 pm
by Gutawer
You can detect simulataneous key pressed with an EventHandler by keeping track of the keys you need to track as booleans (or a bitfield, if you have a very large amount of them), and testing if both of the booleans are true. The event handler should simply set and unset the booleans. You need to do this since an event handler doesn't give you which keys are pressed currently, only that they've been pressed or released.

Re: "How do I ZScript?"

PostPosted: Mon Oct 30, 2017 1:36 pm
by Rip and Tear
Hmm, I see. However, I still fail to understand what the actual applications of this would be. Predicable randomness seems to be missing the point.

Re: "How do I ZScript?"

PostPosted: Tue Oct 31, 2017 5:10 am
by Apeirogon
How make monster dont shoot if between monster and his target stand some actor? Like, chaingunner dont shooting if between him and player walk another former human.

Re: "How do I ZScript?"

PostPosted: Tue Oct 31, 2017 6:43 am
by Blue Shadow
It looks like you want A_CheckLOF.

Re: "How do I ZScript?"

PostPosted: Tue Oct 31, 2017 7:29 am
by Apeirogon
And if i want actor thet prevent shooting, if it block line of sight of any monster?
Like, i want to smoke grenade. And i want to make it into PWAD to play with guncaster/high noon driver/demonsteel/etc. or custom monsters pack. And I too lazy and stupid to edit every actor, that potentialy can shoot me, with a_checkLOF.

Re: "How do I ZScript?"

PostPosted: Wed Nov 01, 2017 4:34 am
by Gutawer
What's the cleanest way to send out a hitscan from a position in 3d space? Spawning an actor to send out the hitscan seems to work nicely, but I can't figure out how to make it transfer the target to the actor that is "supposed" to have sent out the hitscan.

Re: "How do I ZScript?"

PostPosted: Wed Nov 01, 2017 10:39 am
by ZzZombo
Isn't P_AimLineAttack() and/or related stuff exposed?

Re: "How do I ZScript?"

PostPosted: Wed Nov 01, 2017 2:23 pm
by Apeirogon
In definition of CanCollideWith write (Actor other, bool passive)
So if I wish make "false" to all projectile and hitscan in game, it means that must write check for all projectile/hitscan by name? Llike

Code: Select allExpand view
class some_thing: actor
{
    override bool CanCollideWith (Actor other, bool passive)
    {
        if(actor.imp_fireball)
        {
            false;
        }

        if(actor.chainguy_hitscan_puff)
        {
            false;
        }
        if...
       ...
       ...
       ...
       and so on
    }
}

Re: "How do I ZScript?"

PostPosted: Wed Nov 01, 2017 10:06 pm
by ZippeyKeys12
Code: Select allExpand view
if(other.bMissile)
    return false;

Of course if there's an entirely reasonable chance of projectiles not using the +Missile flag. Also I'm not sure how to access flags so I just guessed.

For hitscans IDK.

Re: "How do I ZScript?"

PostPosted: Thu Nov 02, 2017 8:24 am
by Apeirogon
Yes, it can look at the flag of collide actor.
About hitscan...Im just add to actor spectral flag and add check dont collide with projectile with spectral flag.

Re: "How do I ZScript?"

PostPosted: Thu Nov 02, 2017 1:47 pm
by Apeirogon
SpecialMissileHit used as ripper expansion?

Re: "How do I ZScript?"

PostPosted: Thu Nov 02, 2017 7:27 pm
by ZippeyKeys12
Apeirogon wrote:SpecialMissileHit used as ripper expansion?

Umm, excuse me? :?

Re: "How do I ZScript?"

PostPosted: Fri Nov 03, 2017 4:38 am
by Apeirogon
int SpecialMissileHit (Actor victim)

Called when a missile impacts an actor. Returning 1 tells the missile to keep going instead of exploding, while -1 signifies the missile to die.

When return 1 it means "pierce/fly through actor"?

Re: "How do I ZScript?"

PostPosted: Fri Nov 03, 2017 9:09 am
by Major Cooke
Apeirogon wrote:When return 1 it means "pierce/fly through actor"?

Yes.