mob
proc
CreateMenu(client/C, x1 as num, x2 as num, y1 as num, y2 as num)
var/B
if(src.MenuStyle == 1) B = /obj/OnScreen/Menus/Back(C)
if(src.MenuStyle == 2) B = /obj/OnScreen/Menus/Back2
B.screen_loc = "[x1],[y1] to [x2],[y2]"
Problem description:
Well I'm stumped. How would I edit the screen_loc variable before the object is created? I've tried doing a for() but it would edit it on the screen, and then would I have to "renew" it? I honestly have no clue. Coding in Byond isn't quite easy after a day of Exam. XD If anyone could point me in the right direction, would be greatly appreciated.
Btw, when creating a proc, would you have to put what each arg would be? like "as num" or "as text"? or can it assume it when the args are sent to it?
It won't work because you can't edit a type path's variables. You have got to create it first. You also didn't display what the data type of B would be.
Technically, you can't edit an object's variables before it's created, but you can do it right after it's created (before it has an impact on anything). Just change the screen loc at the object's New() proc.
For procs, you don't need an "as num" or "as text" setting, though it is needed if it is used as a verb. It's nice to write up comments on what data type the variable for the proc parameters might be.
~~> Unknown Person