A_CheckSightOrRange (GZDoom-r741)

Posted by Rachael on 17 February 2010 at 02:02.
Download (Note: Updated to r742)

This build adds a new DECORATE action function, nothing more.

A_CheckSightOrRange (int distance, str state)
A_CheckSightOrRange (int distance, int offset)

This function performs two checks on all active players in the game:

--> First, it does exactly the same as A_CheckSight does - if the player can see the actor, it will not jump.
--> Secondly, it will also check each player to see if they are in range specified by distance, and will also not jump if they are.

This means that each player has to simultaneously be out of range and out of view of the actor, in order for the jump to occur. Note that this check will only check the player's camera, not the player himself.

This is most useful for actor-heavy special effects, where if you are close enough to it you don't want it stopping simply because the player hid behind a railing or a raised sector momentarily.

Diff patch here for GZDoom-r741.

GZDoom with (hopefully) a workaround for the sprite bug

Posted by Gez on 10 January 2010 at 11:00.

If you have an old ATI or Intel chipset, you might have suffered from this bug. In this thread, Graf says it's caused by the sprite trimming feature. In this custom build, you will find in Options->OpenGL Options->Textures Options something to turn sprite trimming off.

Additionally, it updates GZDoom to r2113 of ZDoom. Full details can be seen in the included patch file if you're curious.

Anyway, please report if it now works when you turn gl_trimsprites off.

GZDoom/MBF (wip), based on ZDoom r1817 and GZDoom r450

Posted by Gez on 13 September 2009 at 16:00.
Okay, the experimental and community builds have been dormant for a little while so I figured I'd share the current state of my custom build, which contains a lot of stuff.

What is in it:
- Other experimental features which already have their own threads
- A lot of DeHackEd-related code to increase compatibility with MBF
- A tiny amount of code to increase compatibility with Vavoom

Here are my notes in the same style as rh-log (read from the bottom up):

- Added compatibility option to let friendly monsters pass through lines that
block monsters. MBF lets them do so, and you need go no farther than MAP01
to understand why it can be a good idea.
- Tried to load some Vavoom mods for testing modified Sector_SetContents
handling. Added support for Vavoom skyboxes and a couple of aliases in
MAPINFO for compatibility. Tweaked resourcefile a bit as well. Spent time
trying to understand why all the textures are rotated 180° instead of testing
the handling of Sector_SetContents... But it seems to work correctly anyway.
- Modified the code for handling Sector_SetContents to reflect the Vavoom wiki,
which showed this was changed in August 2008. (Vavoom's SVN history shows
actually that it was in October 2006, with r1783. Not sure why a page created
in June 2008 would have been so with obsolete content.)
- Added SMMU's NailBomb as two additional parameters for A_Explode. No code
was taken from SMMU or its successors, it was only based on documentation.
- Restored A_Turn as I couldn't successfully create on the fly the
"member variable angle + constant parameter" expression needed to fully
aliase it to A_SetAngle, and A_LineEffect because it's too soon for xlat.
- Added a renaming mechanism to dehacked, so A_Spawn is interpreted as
A_SpawnItem, and so on. This allowed to eliminate all "new" codepointers!
- Added remaining MBF functions: A_Spawn, A_Turn, A_Face, A_Scratch, etc.
- Fixed various problems in dehacked parameter code. That part is full of
traps. Moved the function to be run at the end of the dehacked loop, so as
to be sure all the states with the relevant code pointers have had their
misc1 and misc2 set. This required a new array to temporarily store them.
- Added hrange and vrange parameters to A_Mushroom, replacing the misc1 and
misc2 values. Created a function to interpret such MBF dehacked parameters
correctly and transform them into normal parameters.
- Added "param" console command to debug ZDoom's codepointer parameters.
- Added compatibility option for corpses being crushed into gibs, instead of
being replaced by gibs. This lets arch-viles resurrect gibs. Added hidden
compatibility flag for ghost monsters, and listed all levels that make use
of it in compatibility.txt.
- Updated custom bouncetypes to Randy's bounceflags. I had made sorta the same
thing, but not in the exact same way.
- Ported custom code from ZDoom to GZDoom.
- Fixed DeHackEd incompatibility with MUSHROOM.DEH, and submitted patch.
- Added as compatibility options the MBF pseudo-torque effect and the
possibility to have monsters affected by terrain effects such as pushers and
pullers. MBFEDIT!.WAD can now work at 100%.
- Changed gravity computation from P_ZMovement() into a macro. With MBF
bouncers, it is used in more places, so it's simpler that way. Tweaked
behavior of MBF-specific parts of the bouncing code so that DOGFLY.DEH works.
- Changed Graf's hack of Misc1 to signal a state was dehacked by one that
affects the state's defineflags. Implemented MBF-type params for A_Mushroom.
- Tweaked detection and treatment of MBF grenades by changing their rockettrail
to a grenadetrail and giving them the NOBLOOD flag. It was odd to see them
leaving blood decals, and leaving gibs if they exploded under a closed door.
- Fixed a dehacked bug when playing Artica: one of the items was dehacked to
have only the TRANSLUCENT flag. Since ZDoom didn't treat translucency as
being one of the flags from the first array, that meant the first array was
left untouched, and therefore did not clear the SOLID flag. Solved the
problem by reinstating the TRANSLUCENT flag at its proper place in DEHSUPP.
- Added stealth/friend hack so that the conflicting flag is interpreted
correctly. Fortunately, ZDoom blocked the upper bits so as to force use of
the mnemonics, allowing to be 100% sure when a monster is stealthy and when
it is friendly. Removed upper bit block for MBF compatibility.
- Added "info" console command to list an actor's flags and various other
variables that linetarget did not tell. Tweaked P_AimLineAttack() to let it
optionally check even non-shootable actors.
- Enhanced DeHackEd so that it could translate MBF's three new flags.
- Added MBF bounce types to the ZDoom bounce system, changed bouncetype in a
bitflag system. Added checks for bouncetype & BOUNCE_MBF at various places
where MBF has checks for flags & MF_BOUNCES.
- Implemented MBF "doom beta" codepointers, states and classes. Updated
DEHSUPP accordingly.
- Added A_SetVar and an array of ten variables that are usable in DECORATE.
This allows some rudimentary forms of scripting much more efficiently than
with inventory tokens, and no risk of collision with other stuff, contrarily
to A_SetArg.
- Added A_Log and A_PrintBold to DECORATE. Great for testing and debugging
- vcproject and svnrevision.h nitpicks.

Other features, like the ScriptedEffect powerups, the activationtype property and more predate this log, and they have their own threads anyway. Oh, and as always, there's a patch in the archive.

GL camera texture issues

Posted by Isle on 17 July 2009 at 14:30.
first, sprites viewed by the camera are billboarded based on the player, not the camera. second, camertextures on the floor are upside down compared to software/other flats. demo wad showing both attached

gzdoom - r1711-base

Posted by Rachael on 6 July 2009 at 09:20.
This is GZDoom's unmodified source updated to ZDoom r1711.

GZDoom - r1701

Posted by Rachael on 2 July 2009 at 11:52.
This updates GZDoom's codebase to r1701. Untested.

P.S. whoever invented joysticks needs to be SHOT! I don't even know if they'll work in this build. I'd be surprised if it did. I'd also be surprised if the Linux version compiles. Either way, good luck guys. :)

Of course, the main purpose for doing this was to apply community changes to GZDoom. Stay tuned. ;)

ScriptedEffect experimental builds

Posted by Gez on 8 June 2009 at 10:43.
What is it about? It's a new type of powerups which let you define their effects through DECORATE, to the extent of what you can do with DECORATE anyway.

Here is how it works: you define a powerup that inherits from PowerScriptedEffect. The script then takes place in four base states:

Similarly to the Pickup: or Use: states of a CustomInventory, the calls from a ScriptInit: are executed in just one tic. This can be used to set up things that the PowerUp does from the start.

Same as above, but this state is instead executed if you pick up another scripted powerup of the same type.

The same thing as ScriptInit, but on the other end of the chain: those are executed when the powerup expires or is otherwise removed.

The meat and bone of this new type of Powerup. While the powerup is in a player's inventory, it will iterate through its states at the normal speed (be sure to make this state last at least one tic!). Very powerful effects are possible: you can use the various A_Checks and A_Jumps, you can A_Give/TakeInventory, you can A_SpawnWhatever things, you can A_Set and A_Unset, and so on.

With this, you can do a lot of types of powerups. They can be pretty simple, or quite elaborate.

Here is a pretty simple example. This powerup generates rockets. You'll get a total of 12 rockets: one every five seconds for one minute.

CODE: Select all

Actor PowerRocketGenerator : PowerScriptedEffect
	Powerup.Duration -60
		// 35 * 5 = 175, so one rocket every 5 seconds
		TNT1 A 175 A_GiveInventory("RocketAmmo")

Actor RocketGenerator : PowerupGiver
	Inventory.MaxAmount 0
	Inventory.PickupMessage "Picked-up a portable rocket generator"
	Powerup.Type "RocketGenerator"
		BPAK A -1

Now here is a more complicated powerup. You can see how it uses many custom states, several inventory tokens, and a lot of A_Jump* checks to achieve its effects.

These combat stims will make you fast and strong, and give you a healing factor. You'll even regenerate above 100% health! However, if you're hurt, your metabolism will no longer sustain some of these effects. If your health goes below 90, you lose the "rage rune" effect. If it falls below 80, you will no longer regenerate above 100. If it falls below 50, you will lose the berserk effect. And if it falls below 25, you will lose all of these boosts entirely, but instead you get speed so that you can run away very quickly! After 30 seconds, the speed boost goes away too. If during your flight you pickup another of these powerups, the stims are back in full force but you lose the speed boost.

CODE: Select all

// Special effects
Actor PowerBerserkFiringSpeed : PowerDoubleFiringSpeed { Powerup.Duration 0x7FFFFFFF }
Actor PowerBerserkSpeed : PowerSpeed { Powerup.Duration 0x7FFFFFFF }
Actor BerserkDepletionToken : Inventory {}
Actor BerserkResetToken : Inventory {}
Actor BerserkTicToken : Inventory { Inventory.MaxAmount 1050 }

// The Super Berserk!
Actor PowerSuperBerserk : PowerScriptedEffect
		TNT1 A 0 A_GiveInventory("BerserkResetToken")
		// Fall through to ScriptInit
		TNT1 A 0 A_TakeInventory("BerserkDepletionToken", 255)
		TNT1 A 0 A_GiveInventory("PowerStrength")
		TNT1 A 0 A_GiveInventory("PowerBerserkFiringSpeed")
		TNT1 A 0 HealThing(100, 0)
		TNT1 A 0 A_SelectWeapon("Fist")
		TNT1 A 0 A_TakeInventory("BerserkResetToken", 255)
		TNT1 A 0 A_TakeInventory("PowerBerserkSpeed", 255)
		// Fall through to Script
		TNT1 A 1 A_GiveInventory("BerserkTicToken")
		TNT1 A 0 A_JumpIfHealthLower(25, "Yipe")
		TNT1 A 0 A_JumpIfInventory("PowerStrength", 1, "StrengthHealthCheck")
		TNT1 A 0 A_JumpIfHealthLower(80, "RegenTokenCheck")
		TNT1 A 0 A_JumpIfInventory("PowerBerserkFiringSpeed", 1, "SpeedHealthCheck")
		TNT1 A 0 A_JumpIfInventory("BerserkTicToken", 105, "RegenCheck")
		TNT1 A 0 A_TakeInventory("BerserkTicToken", 1050)
		TNT1 A 0 A_JumpIfHealthLower(100, "LesserRegen")
		TNT1 A 0 A_JumpIfHealthLower(120, "GreaterRegen")
		Goto Script
		TNT1 A 0 A_JumpIfInventory("BerserkDepletionToken", 1, "Script") // No regen for you!
		TNT1 A 0 A_GiveInventory("HealthBonus") // Gain +1 health to a maximum of 120
		Goto Script
		TNT1 A 0 A_GiveInventory("HealthBonus") // Gain +1 health to a maximum of 100
		Goto Script
		TNT1 A 0 A_JumpIfHealthLower(90, "SpeedLoss")
		Goto Script +5
	SpeedLoss: // Sorry, you took too much damage to sustain your super attack speed!
		TNT1 A 0 A_Print("Your attacks are no longer accelerated")
		TNT1 A 0 A_TakeInventory("PowerBerserkFiringSpeed", 255)
		Goto Script +5
		TNT1 A 0 A_JumpIfInventory("BerserkDepletionToken", 1, "RegenLoss")
		Goto Script+4
	RegenLoss: // Sorry, but you are hurt and can no longer regen above human limits
		TNT1 A 0 A_Print("Your regen is weakened")
		TNT1 A 0 A_GiveInventory("BerserkDepletionToken")
		Goto Script+4
		TNT1 A 0 A_JumpIfHealthLower(50, "StrengthLoss")
		Goto Script +3
	StrengthLoss: // Sorry, you took too much damage to sustain your super strength!
		TNT1 A 0 A_Print("Your punches are no longer superhumanly strong")
		TNT1 A 0 A_TakeInventory("PowerStrength", 255)
		Goto Script +3
	Yipe: // A last adrenalin surge that helps running away very quickly!
		TNT1 A 0 A_Print("Run away!")
		TNT1 A 0 A_GiveInventory("PowerBerserkSpeed")
		TNT1 A 0 A_TakeInventory("BerserkTicToken", 1050)
		// fall through to YipeLoop
		TNT1 A 1 A_GiveInventory("BerserkTicToken")
		TNT1 A 0 A_JumpIfInventory("BerserkResetToken", 1, "ScriptReset")
		TNT1 A 0 A_JumpIfInventory("BerserkTicToken", 1050, "YipeEnd")
		TNT1 A 0 A_Print("Adrenalin fading out!")
		Stop // This removes the powerup
	ScriptExit: // Cleanup!
		TNT1 A 0 A_TakeInventory("BerserkTicToken", 1050)
		TNT1 A 0 A_TakeInventory("PowerBerserkFiringSpeed", 255)
		TNT1 A 0 A_TakeInventory("BerserkDepletionToken", 255)
		TNT1 A 0 A_TakeInventory("BerserkResetToken", 255)
		TNT1 A 0 A_TakeInventory("PowerBerserkSpeed", 255)
		TNT1 A 0 A_TakeInventory("PowerStrength", 255)

Actor SuperBerserk : PowerupGiver replaces Berserk
	Game Doom
	SpawnID 134
	Inventory.MaxAmount 0
	Inventory.PickupMessage "Combat stims!"
	Inventory.PickupSound "misc/p_pkup"
	Powerup.Type "SuperBerserk"
		PSTR A -1

Now, try those, use them and abuse them to see if you can get them to break. I'd like to be sure they work flawlessly when I'll move them to Code Submission. Oh, and as always, a patch is included in the zip.

Note about gzdoom-r336m_(zdoom-r1631).zip

Posted by Gez on 3 June 2009 at 04:29.
Doomsday-style hires textures are broken. It uses a switch on an enum that is no longer used by ZDoom, and I took the lazy way out and commented out the code to get it to compile. After all, it's not an official version, it's just for the people who want to try out some of the new ZDoom features in GZDoom (I'm thinking of Cutman's impings for example).

STCompat experimental builds

Posted by Gez on 31 May 2009 at 10:45.
ST Compat is a work-in-progress effort to implement in ZDoom a few Skulltag features. Currently included are:
  • The NOAUTOAIM flag, though it is deliberately restricted to affect only missile attacks
  • The Grenade Launcher's function, in a parameterized form
  • The RandomPowerup effect, in a generalized and parameterized form
  • The Rune system, but using normal powerups rather than runes -- so you'll want to use Powerup.Type instead of Rune.Type.
  • The BUMPSPECIAL flag.
  • The red armor's protection against fire.
Some of these features are a bit hacky, other are unfinished. Feel free to download and test. A patch is included if you want to look at the code. Right now, I don't deem it ready for submission on the ZDoom feature suggestion forum, but there's enough stuff that some feedback would be appreciated. The stcompat.7z file can be loaded as a wad file to obtain the available Skulltag actors. (It's really a pk3, but compressed as a 7z to make it smaller.)

Skulltag features not implemented:
  • The "max health" increase through bonus items.
  • Spread, reflection and prosperity runes. My assumption is that they would have been added long ago if they were wanted.
  • All gamemode items -- skull pillars, flags, and so on; but also the Terminator and Possession Stone.
  • The FloatyIcon used for medals and other messages. Not needed for ZDoom, obviously.
  • The EXPLODEONDEATH flag. I don't know what it does and I handle it as a dummy flag.
  • Hissy. Doesn't seem useful.
  • The path nodes. Used by Skulltag's bots I suppose, which aren't the same as ZDoom's, which are deprecated anyway.
  • PowerTranslucency -- instead, the invisibility sphere is made to use PowerShadow.