generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Odd variable issue

Previous Thread :: Next Thread 
BLUEwaffleBERRY is not online. BLUEwaffleBERRY
Joined: 29 Jun 2013
Total Posts: 18
02 Jul 2013 11:28 PM
I'm a better coder than all of you, but I request some assistance on something that most of you are incompetent to do. For some reason, running
a,a=1,5
leaves a holding a value of 1. Why is this? I'd assume it's a simple explanation if any of you are able to comprehend a question of mine, so go ahead and tell me.
Report Abuse
BLUEwaffleBERRY is not online. BLUEwaffleBERRY
Joined: 29 Jun 2013
Total Posts: 18
02 Jul 2013 11:29 PM
Whoops, forgot to enable siggy after calling C&G dumb

~1waffle1
Report Abuse
dekkonot is not online. dekkonot
Joined: 22 Dec 2010
Total Posts: 6685
02 Jul 2013 11:30 PM
I'm just going to stop now. :/
Report Abuse
BLUEwaffleBERRY is not online. BLUEwaffleBERRY
Joined: 29 Jun 2013
Total Posts: 18
02 Jul 2013 11:31 PM
Hurry up, you slow morons.

~1waffle1
Report Abuse
dekkonot is not online. dekkonot
Joined: 22 Dec 2010
Total Posts: 6685
02 Jul 2013 11:33 PM
Number one, Waffle doesn't talk to people like that.
Report Abuse
BLUEwaffleBERRY is not online. BLUEwaffleBERRY
Joined: 29 Jun 2013
Total Posts: 18
02 Jul 2013 11:34 PM
It's a joke over exaggerating the superfluity of 1waffle1's personality. I don't expect ANYONE to believe it's him - he's much more respectful than this.
Report Abuse
dekkonot is not online. dekkonot
Joined: 22 Dec 2010
Total Posts: 6685
02 Jul 2013 11:36 PM
As for the variable issue, I have no clue! I suppose it relates to it trying to set an entry in the environment twice at the same moment, and the first takes an override...
Report Abuse
Oysi is not online. Oysi
Joined: 06 Jul 2009
Total Posts: 9058
02 Jul 2013 11:38 PM
[ Content Deleted ]
Report Abuse
1waffle1 is not online. 1waffle1
Joined: 16 Oct 2007
Total Posts: 16381
02 Jul 2013 11:40 PM
It is not an exaggeration of my personality, it is an exaggerated misinterpretation of my personality directed towards the wrong people. As for the problem;

    t={}
    setmetatable(t,{__newindex=function(a,b,c)print(c)end})
    t[1],t[1],t[1]=1,2,3

Report Abuse
LuaWeaver is not online. LuaWeaver
Joined: 28 Jun 2013
Total Posts: 213
02 Jul 2013 11:40 PM
Using ChunkSpy interactive mode:

>a,a=1,5
; source chunk: (interactive mode)
; x86 standard (32-bit, little endian, doubles)

; function [0] definition (level 1)
; 0 upvalues, 0 params, 2 stacks
.function 0 0 2 2
.const "a" ; 0
.const 1 ; 1
.const 5 ; 2
[1] loadk 0 1 ; 1
[2] loadk 1 2 ; 5
[3] setglobal 1 0 ; a
[4] setglobal 0 0 ; a
[5] return 0 1
; end of function

They seem to get compiled in opposite order.
Report Abuse
NecroBumpist is not online. NecroBumpist
Joined: 12 Sep 2010
Total Posts: 4198
03 Jul 2013 12:29 AM
@LuaWeaver:
>They seem to get compiled in opposite order.

This is because Lua allocates registers like a stack. Last in, first out.
The actual expressions are compiled in the order you would expect, first push 1 and then 5 onto the stack, but then the actual destinations are compiled in reverse as the values 5 and 1 are popped off of the stack.
Report Abuse
LuaWeaver is not online. LuaWeaver
Joined: 28 Jun 2013
Total Posts: 213
03 Jul 2013 01:11 AM
@NecroBumpist

I figured that out. I've been reading "A No-Frills Introduction to the Lua VM".
Great read.

while obamacare() do benefitMiddleClass() end --LuaWeaver
Report Abuse
NecroBumpist is not online. NecroBumpist
Joined: 12 Sep 2010
Total Posts: 4198
03 Jul 2013 01:23 AM
@LuaWeaver:
A very informative read indeed.
I wonder how long it took to research and put the entire paper together.
Anyway, keep up your work with Lua bytecode :3 It's very interesting.
Report Abuse
LuaWeaver is not online. LuaWeaver
Joined: 28 Jun 2013
Total Posts: 213
03 Jul 2013 03:55 AM
@NecroBumpist:
I wrote my own bytecode schema. ;)

\3\1\1\15\2\0\0\1\10\2\0

Is the same as:

tiny int arg0=15;
add arg0,10
out top of stack

while obamacare() do benefitMiddleClass() end --LuaWeaver
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image