Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8193731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:34:58+00:00 2026-06-07T04:34:58+00:00

So I was doing work in lua to make an object that essentially controlled

  • 0

So I was doing work in lua to make an object that essentially controlled and moved subobjects, and I was wondering if to reduce lines of code, I could increment multiple values in one statement. This is the entire function:

function ElephantEarC:SetOffset(x, y)
    local oiX, oiY -- Offset increase X/Y
    for i, stem in pairs(self.stems) do
        oiX, oiY = stem.low:GetOffset()
        oiX, oiY += x, y
    end
end

I was wondering if this line was valid:

oiX, oiY += x, y

A bit of information about this code

  • self.stems is an array of the subobjects.
  • GetOffset() returns two values– x and y.
  • Each ‘stem’ has three subobjects that are grouped together– low, high and leaf (I just haven’t written them in yet).

If anything else is vague, or this question’s already been answered and I couldn’t find it, please tell me…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T04:35:01+00:00Added an answer on June 7, 2026 at 4:35 am

    I do not think the syntax on the line with += is valid. This will perform the additions on a single line correctly, though:

    oiX, oiY = oiX+x, oiY+y
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a file of about 19500+ lines of code. I am doing work
Actually We are doing thesis work where we need to make 10 voip phones
I'm doing maintenance work on a Rails site that's deployed using Phusion Passenger .
I am doing work for school, I'm supposed to write a function that accepts
I am doing work for a client that has a server on his domain.
I am doing work for a client who has lost the source code for
I'm doing work for college and I have to determine, which of the three
I'm doing some work with grades and the desire2learn Valence API. In the context
I am doing some work to track down a perceived bug in a git
I'm doing some work with Ukkonen's algorithm for building suffix trees, but I'm not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.