[LZDoom 3.86a] TICRATE const is inaccessible from Object

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
m8f
 
 
Posts: 1445
Joined: Fri Dec 29, 2017 4:15 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Manjaro Linux
Location: Siberia (UTC+7)
Contact:

[LZDoom 3.86a] TICRATE const is inaccessible from Object

Post by m8f »

Steps to reproduce:
  1. Load consts.pk3.
    consts.pk3
    (337 Bytes) Downloaded 19 times
  2. Start a new game.
  3. Summon ConstsTest.
Expected result: console prints "TICRATE: 35". This is the result given by GZDoom 4.4.2.
Actual result: after step 1, Fatal error:

Code: Select all

Script error, "consts.pk3:zscript.zs" line 5:
Unknown identifier 'TICRATE'
Consts.pk3 contents: zscript.zs:

Code: Select all

version "4.0"

class MyObject play
{
  int getTicrate() { return TICRATE; }
}

class ConstsTest : DoomImp
{
  override void BeginPlay()
  {
    let o = new("MyObject");
    Console.Printf("TICRATE: %d", o.getTicrate());
  }
}
Line 5 has "return TICRATE".

Severity: mods that access TICRATE directly cannot be loaded in LZDoom 3.86a.

Workaround: specify TICRATE as Thinker.TICRATE. Then the console output is the same as in GZDoom 4.4.2.
Note that Object.TICRATE gives the same fatal error.

Or maybe TICRATE isn't supposed to be accessed like that? It's defined like this:

Code: Select all

class Object native
{
	const TICRATE = 35;
and I thought that it will be always accessible inside any class, as all classes are implicitly derived from Object.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49073
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [LZDoom 3.86a] TICRATE const is inaccessible from Object

Post by Graf Zahl »

This was a recent change, TICRATE once was a member of Thinker. Apparently LZDoom hasn't updated that part of the code.
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3141
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: [LZDoom 3.86a] TICRATE const is inaccessible from Object

Post by drfrag »

I thought this was something for the future "GameInfo defined tic rate" and i didn't mess with it. Is this really important now? Fixed anyway.
User avatar
m8f
 
 
Posts: 1445
Joined: Fri Dec 29, 2017 4:15 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Manjaro Linux
Location: Siberia (UTC+7)
Contact:

Re: [LZDoom 3.86a] TICRATE const is inaccessible from Object

Post by m8f »

Graf Zahl, thanks for the explanation, and drfrag, thanks for the fix!
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3141
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: [LZDoom 3.86a] TICRATE const is inaccessible from Object

Post by drfrag »

Yeah but i doubt there will be a 3.86b release unless a major bug arises.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49073
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [LZDoom 3.86a] TICRATE const is inaccessible from Object

Post by Graf Zahl »

drfrag wrote:I thought this was something for the future "GameInfo defined tic rate" and i didn't mess with it. Is this really important now? Fixed anyway.
Not important, but it could make some recent mods error out when taking the new location for granted.
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3141
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: [LZDoom 3.86a] TICRATE const is inaccessible from Object

Post by drfrag »

Okay, thanks.
Post Reply

Return to “Closed Bugs [GZDoom]”