[Weapon] Strife dagger with backstabbing

Sprites, textures, sounds, code, and other resources belong here. Share and share-alike!
Forum rules
Before posting your Resource, please make sure you can answer YES to any of the following questions:
  • Is the resource ENTIRELY my own work?
  • If no to the previous one, do I have permission from the original author?
  • If no to the previous one, did I put a reasonable amount of work into the resource myself, such that the changes are noticeably different from the source that I could take credit for them?
If you answered no to all three, maybe you should consider taking your stuff somewhere other than the Resources forum.

Consult the Resource/Request Posting Guidelines for more information.

Please don't put requests here! They have their own forum --> here. Thank you!
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

[Weapon] Strife dagger with backstabbing

Post by FDARI »

There are three versions of this (two in this post), of which one uses features present in the latest SVN-version of ZDoom. For use with latest SVN, download ACS-BACKSTAB.pk3. For a demonstration of the same feature without any ACS, check the code-submission and demo: http://forum.zdoom.org/viewtopic.php?f= ... 45#p558445

Single weapon for strife, inheriting from PunchDagger.

Class name: PunchDaggerSneakAttack.

Description:

The normal firing mode of this dagger is unmodified; the dagger is still generally weak. However, if you have an enemy's back in sight and some time on your hands, you can press and hold altfire at close range. Highly complex decorate is used to make sure you keep locked on target, and that the target is not facing you. If you manage to keep the target in sight for a few tics, the attack is triggered. The attack itself, is slightly accelerated, and does damage 5 times in a single tic. All damage is dealt with the A_JabDagger code pointer, which means that stamina increases should automatically be taken into account.

Initially it is fit for slaying peasants (kill or wound [kill slowly]) in a single move, or as a first blow against an idle acolyte. As weapon power increases throughout the plot, it'll be a guaranteed one hit kill for normal acolytes.

Tip: After attempting/completing a sneak attack, the weapon is ready for a normal attack before it is ready for another sneak attack. You might want to switch firing button immediately after executing the sneak attack.

Issues:

Can't check field of view of the attacking player properly (using A_JumpIfInTargetLOS from the targeted actor): Viable feature suggestion may fix this.
Can't perform reliable target control when the target is another player: No feature suggestion more viable than Doomscript. (Unless you have ideas.)

Supported version: r3167 + http://forum.zdoom.org/viewtopic.php?f= ... 71#p554571

Workaround:
Using pointer juggling (A_RearrangePointers, svn feature) to check tracer-inventory with A_JumpIfInTargetInventory.
Using ACS to check player fov.
Prepackaged with a playerclass that uses the backstabber instead of standard punch dagger.

Workaround compatibility: 3167, no additions required.

Bonus:
Contains a function for precise calculation of vector angles based on fixed point or integer vectors. Returns byte angles.
You do not have the required permissions to view the files attached to this post.
Last edited by FDARI on Thu Apr 07, 2011 5:14 pm, edited 7 times in total.
User avatar
wildweasel
Moderator Team Lead
Posts: 21504
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10, 21H1
Graphics Processor: nVidia with Vulkan support

Re: [Weapon] Strife dagger with backstabbing

Post by wildweasel »

Can you use ACS to compare the player's facing angle to the actor's, or would that require TID's to be set up ahead of time?
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

Re: [Weapon] Strife dagger with backstabbing

Post by FDARI »

I need to compare one actor's angle to the angle of the vector from that actor to another, and the reverse. Decorate supports one of these, ACS is highly extensible, but has no direct support of this that I know. VectorAngle, last time I used it, was so imprecise that I had to write my own function. (Some ages old advanced pathfinding with ACS/decorate and no objects in the map; they couldn't keep a straight aim on the target, because the required angle was not one of thise VectorAngle would ever return.)

However, it can be done. It takes a library, a script, a populated table of angles and a function.

I'll try to rewrite one version of this weapon to be supported by r3167 using ACS to determine the missing LOS-value.
Additionally, I'll probably make a code submission to expand A_JumpIfTargetInLOS and deprecate A_JumpIfInTargetLOS, which would allow me to achieve the same in a far more efficient manner, without any risk of clashing with other modders' ACS.
User avatar
Major Cooke
Posts: 8084
Joined: Sun Jan 28, 2007 3:55 pm

Re: [Weapon] Strife dagger with backstabbing

Post by Major Cooke »

I made a request about checking the target's angle in comparison to the player's here. I don't know if it's entirely possible...
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

Re: [Weapon] Strife dagger with backstabbing

Post by FDARI »

If you want to know whether two actors are facing the same direction, comparing angles is useful. If you want to check that one actor is within another actor's field of view, you need the vector from the observing actor to the observed actor, and the angle of the observing actor, but not the angle of the observed actor. The difference between the angle of the observation vector and the observing actor's actual angle tells you how far off center the observed actor is.

I am quite certain that a comparison between the angles of the two actors themselves is not what I require. It would return the same regardless of relative position: If they both face the same direction, that check would not differentiate between them standing next to eachother, observer in front, or observed in front.

You seem to be working on something similar to what I've posted here. Are you sure you have requested what you actually need?

EDIT: Well; maybe I read your wording a bit too strictly. You want to check whether an actor is facing another, or looking away, but I think the method almost/partially available in A_JumpIfTargetInLOS is what you require for that.
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

Re: [Weapon] Strife dagger with backstabbing

Post by FDARI »

I've managed a functional version (ACS-Backstab.pk3).
I have also made a set of feature suggestions (or summed up a few existing ones): http://forum.zdoom.org/viewtopic.php?f=34&t=29292

A dagger-demo is included in the feature suggestion.
The 3. patch in patchpack.zip contains all changes necessary to run the dagger-demo.

StrifeDaggerSneakAttack.zip is less relevant now.

Return to “Resources”