ZScript deprecated functions.

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
sinaptica
Posts: 19
Joined: Tue Jan 31, 2017 5:41 am

ZScript deprecated functions.

Post by sinaptica »

I'm working on a PR for SLADE to improve the function call tips on the text editor.
It's now possible for the call tip, not only to warn the user if the function is deprecated and since what version, but also to suggest another function to use instead.

I've searched all relevant files inside gzdoom.pk3 to get the list of all the functions that have been deprecated. Then I've searched each function in the wiki to see if there's a suggested replacement function for each one.

There are some for which I have not been able to find a suggested replacement.

If someone with knowledge of zscript can help and tell me which function to recommend (if any) for each function on the following list, it would be much appreciated. <3

I don't know nothing about zscript, but I suspect the ones with an asterisk do not need a replacement.

Code: Select all

// 'base.txt'

DrawHUDTexture
LastIndexOf

// 'actor.txt'

A_FaceConsolePlayer
A_BulletAttack
* A_ChangeFlag
* A_SetUserVar
* A_SetUserArray
* A_SetUserVarFloat
* A_SetUserArrayFloat

// 'actor_checks.txt'

* A_CheckFlag


// 'compatibility.txt'

GameType
C_MidPrint

// 'stateprovider.txt'

A_GunFlash
A_Lower
A_Raise
A_CheckReload
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ZScript deprecated functions.

Post by Graf Zahl »

Some comments:
  • DrawHUDTexture is just a redirect to statusBar.DrawTexture. Comment in the code: This is a leftover of the abandoned Inventory.DrawPowerup method.
  • LastIndexOf: Use RightIndexOf. LastIndexOf contains a bug but couldn't be fixed because we knew already that some code depended on that bug.
  • A_FaceConsolePlayer is a no-op. This only exists to let old Zandronum mods run without aborting.
  • A_BulletAttack: One of the first generation attack functions that quickly got superseded by something better.
  • A_ChangeFlag: Flags are just variables in ZScript. You do not need a costly function call to change them.
  • A_SetUserVar: Pointless in ZScript because variables are directly accessible
  • A_SetUserArray: same
  • A_SetUserVarFloat: same
  • A_SetUserArrayFloat: same
  • A_CheckFlag: same as A_ChangeFlag
  • GameType: The underlying variable 'gameinfo.gametype' can be used directly.
  • C_MidPrint: Superseded by Console.MidPrint.
  • A_GunFlash, A_Lower, A_Raise, A_CheckReload: These were originally defined in the wrong class for DECORATE. The placeholders are only there so that old mods accidentally referencing them in a non-working context continue to load.
User avatar
sinaptica
Posts: 19
Joined: Tue Jan 31, 2017 5:41 am

Re: ZScript deprecated functions.

Post by sinaptica »

Thank you!
Post Reply

Return to “Scripting”