ID:793790
 
Keywords: error, image, step_x, step_y
BYOND Version:494
Operating System:Windows 7 Pro 64-bit
Web Browser:Firefox 12.0
Applies to:Dream Maker
Status: Deferred

This issue may be low priority or very difficult to fix, and has been put on the back burner for the time being.
Descriptive Problem Summary:
You can make an image object and attempt to access the step_x and step_y variables, and the code compiles without error. However, during runtime, an 'undefined var' error is given.

Numbered Steps to Reproduce Problem:
  1. In code, access the step_x or step_y vars of an image.
  2. Compile and run the code.
  3. Notice the 'undefined var' error during runtime.


Code Snippet (if applicable) to Reproduce Problem:
var/image/I = new
I.step_x = 5 //Undefined variable /var/step_x


Expected Results:
The code won't compile, or it will work during runtime the same as pixel_x and pixel_y.

Actual Results:
The code compiles, but doesn't run.

Does the problem occur:
Every time? Or how often? Always.
In other games? Yes.
In other user accounts? Yes.
On other computers? I haven't tested.

When does the problem NOT occur?
Always does.

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? I'm using 494.1135 and I haven't tested any other versions.

Workarounds:
Use pixel_x or pixel_y instead.
It's not so much of a bug...just...something overlooked, I'd say.

all variables natively defined under /atom apply to /image, and can compile just fine. Their actual usage, though, is non-existent.
In response to Super Saiyan X
Well, I just find it a bit strange and confusing.
The actual code I was using was something like this:
obj
proc
imageProc()
var/image/I = new
I.step_x = step_x

I wasn't sure which step_x the code was actually referring to, and I was pretty confused. At the very least, shouldn't this not compile to not be so confusing?
edit: research:

by default, these are the initial values of an image's variables, variables that can work during runtime (some /atom/movable variables are missing, which work during compile, but not during runtime):
//using
mob/verb/test()
var/image/i = new
for(var/x in i.vars)
world << "[x] = [i.vars[x]]"
//
animate_movement = 1
loc =
x = 0
y = 0
z = 0
screen_loc =
pixel_step_size = 0
glide_size = 0
type = /image
parent_type = /datum
tag =
name =
desc =
suffix =
text =
icon =
icon_state =
overlays = /list
underlays = /list
dir = 2
visibility = 1
luminosity = 0
opacity = 0
density = 0
layer = -1
gender = neuter
mouse_over_pointer =
mouse_drag_pointer =
mouse_drop_pointer = 1
mouse_drop_zone = 0
verbs = /list
vars = /list
contents = /list
invisibility = 0
infra_luminosity = 0
pixel_x = 0
pixel_y = 0
mouse_opacity = 1
pixel_z = 0
override = 0
maptext =
maptext_width = 32
maptext_height = 32

Why does /image need contents? verbs? vars? gender?
It seems like everything is inherited from /atom/movable at compile time, but at runtime, some things are excluded, specifically bounds locs step_x step_y step_size bound_x bound_y bound_width bound_height found via;
mob/verb/test()
var/image/i = new
var/atom/movable/b = new
for(var/x in b.vars-i.vars)
world << x


pixel movement related stuff is not inherited, it seems.
Lummox JR changed status to 'Deferred'