A_CheckFlag

Moderator: GZDoom Developers

User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

Re: A_CheckFlag

Post by FDARI »

If you're not familiar with C++ concepts, I think it might be a little hard to grasp. I think it was my lack of experience at work.

I defined a macro "#define niftyword(param, param2, param3)" and used it almost, but not quite, like a function. What I forgot was that if I use the same symbol for param and param2, they will be exactly the same, rather than two copies of the same value, or two pointers to the same location. Thus, when I assigned NULL to param2 and then tried to read data contained in the first parameter (param), the first parameter was NULL and could not be used; zdoom.exe crash.

Fixed.

By the way, I have a complete build of all my modifications ready. It only differs from existing suggestions in some A_JumpIfTargetInLOS details:
* JLOSF_NOTEAMNOJUMP is removed. All monsters on teams have FRIENDLY, so you can use A_CheckFlag for that.
* JLOSF_COMBATANTONLY is added. Using this will prevent jump for actors that aren't either players or monsters (ISMONSTER).

I'd post it, but by this time I'm not sure where. It encompasses all 3 suggestions I have made, contains an improvement that depends on all 3 submissions being accepted (excluding NOTEAMNOJUMP) and has a Strife weapons mod for demonstration and entertainment. Only two weapons properly use the new features, though.

Punch dagger
Fire: Regular attack
Altfire: Slow double damage attack. If you manage to stay on a bleeding monster that doesn't catch you in its field of view, you deal 5x damage.
(Damage increase is achieved through multiple 0-tic calls to A_JabDagger)

Missile launcher
Fire: Regular attack
Altfire: Try to find a target within field of view or perfect aim and make adjust course for it after a few tics. Semi-seeking missile. Cool, and not always better than a straight shot, but often much easier to get your target. Reduces the impact of low accuracy early in game.

I'll post the lot here for now, just to let people have a look and feel at it.
Spoiler: Weapons overview
EDIT: Files removed. Preferred patch: http://forum.zdoom.org/viewtopic.php?f=34&t=29364
Last edited by FDARI on Thu Apr 07, 2011 4:53 pm, edited 1 time in total.
User avatar
Major Cooke
Posts: 8209
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: A_CheckFlag

Post by Major Cooke »

I'd say an entirely new thread. Ask for the mods to delete the old ones and start fresh new. Anyway I'm downloading this now and going to implement it on my end.

About teams, I would suggest leaving that in. Due to the fact that there's the DesignatedTeam property, this can radically change things around, so say if you want three factions fighting one another then this would be used to say... heal fellows around them by chance.
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

Re: A_CheckFlag

Post by FDARI »

To check if somebody is on your team, use JLOSF_ALLYNOJUMP.
Previously you could also check if neither actor was without friends by adding JLOSF_NOTEAMNOJUMP.

What that check actually did is duplicated by
A_CheckFlag("FRIENDLY", "IHaveATeam")
A_CheckFlag("FRIENDLY", "IHaveATeam", AAPTR_TARGET|AAPTR_PLAYER_GETTARGET)

Checking that either actor is friendly. There may be a more detailed team-check possible, to find out if a friendly monster has not been assigned to a team, but that has not actually existed in any code I have written, and so it is for the better that NOTEAMNOJUMP does not exist. Perhaps when I learn even more of this engine, I can add that feature, or determine that it is not required at all.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”