[r4185]Bug:GetLineUDMFInt dysfunctional? Attached Example.

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
xtkaythen
Posts: 20
Joined: Mon Apr 06, 2009 12:16 pm
Contact:

[r4185]Bug:GetLineUDMFInt dysfunctional? Attached Example.

Post by xtkaythen »

GetLineUDMFInt don't work. Attached example wad is two sectors, one inside the other. One linedef (not sidedef) of the inner sector has the custom user key (called property in DB2) named "triggertype", an integer, with the value of 15. Said line is tagged 3. This same line, onuse, repeatableaction, will execute script 01.

Scriptlump is simply as follows:

Code: Select all

#include "zcommon.acs"

script 01 (void)
{
  log(i:GetLineUDMFInt(3, "triggertype")); //int lineid, string fieldname
}
For all intents and purposes, the player should see 15 in the console and upper left corner, correct? 'Fraid not.

Regardless of tag number, field name, field value, direct usage or preloading in a variable in a script, it returns 0. It also returns 0 if triggertype is not defined. that's totally unexpected behavior for a really big error like that.

You can even open it up in SLADE3 and scroll to line 118 - 131 to look at the linedef def ( :lol: ) ; triggertype is defined.

tl;dr GetLineUDMFInt seems to always = 0; even when acting on invalid targets.
Attachments
GetLineUDMFIntDontWork.wad
(2.96 KiB) Downloaded 22 times
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [r4185]Bug:GetLineUDMFInt dysfunctional? Attached Exampl

Post by Graf Zahl »

From the UDMF specs:
For purposes of forward compatibility, user-defined fields are restricted to
beginning with the string "user_", but are otherwise normal identifiers.
Implementing editors should not restrict the entry of custom field names to
those beginning with "user_", however, in order to avoid problems with
out-of-date configurations.
It is fully intentional that other keys cannot be queried. The UDMF specification explicitly prohibits it.
xtkaythen
Posts: 20
Joined: Mon Apr 06, 2009 12:16 pm
Contact:

Re: [r4185]Bug:GetLineUDMFInt dysfunctional? Attached Exampl

Post by xtkaythen »

/le-dumb

is there a reason that invalid targets don't produce at least a warning? i imagine logging a "warning: field not found" couldn't hurt foward compatibility
Post Reply

Return to “Closed Bugs [GZDoom]”