October 15, 2018, 04:08:16 PMLatest Member: Bazard90

Author Topic: Learning Lua:  (Read 8199 times)

0 Members and 1 Guest are viewing this topic.

Lego3

  • Project Owner
  • *****
  • Posts: 398
    • View Profile
Re: Learning Lua:
« Reply #15 on: April 03, 2011, 12:12:54 PM »
It doesn't understand what rooms_description is. One could say that there are two ways in which variables exist. Either they are passed along in an argument list, like "Class:getDescription(rooms_description)" or they are declared inside the function as "local rooms_description".
For the end of the world spell, press Control, Alt, Delete.

Ben Dyson

  • Registered member
  • *
  • Posts: 27
    • View Profile
Re: Learning Lua:
« Reply #16 on: April 03, 2011, 12:39:38 PM »
Hey, Im so sorry but i don't understand what I have to do

Lego3

  • Project Owner
  • *****
  • Posts: 398
    • View Profile
Re: Learning Lua:
« Reply #17 on: April 03, 2011, 01:17:51 PM »
It doesn't understand what rooms_description is. One could say that there are two ways in which variables exist. Either they are passed along in an argument list, like "Class:getDescription(rooms_description)" or they are declared inside the function as "local rooms_description".

In other words you need to let your variable be one of those two. Evidently it didn't come in an argument list because then it would've worked, so that leaves the second option. Declare it using "local".
For the end of the world spell, press Control, Alt, Delete.

Ben Dyson

  • Registered member
  • *
  • Posts: 27
    • View Profile
Re: Learning Lua:
« Reply #18 on: April 03, 2011, 01:32:18 PM »
Back to a long error again :(, when I click finish, here is the error
Code: [Select]
Notice: LuaJIT not being used.
Consider replacing Lua with LuaJIT to improve performance. Note that there is no
t currently a 64 bit version of LuaJIT.
Error loading rooms\cafe.lua:
Non-existant string: cafe
An error has occured while running the buttonup handler.
A stack trace is included below, and the handler has been disconnected.
Non-existant string: empty
stack traceback:
        [C]: in function 'error'
        C:\Program Files\CorsixTH\Lua\strings.lua:139: in function <C:\Program F
iles\CorsixTH\Lua\strings.lua:131>
        [C]: ?
        C:\Program Files\CorsixTH\Lua\room.lua:482: in function 'roomFinished'
        C:\Program Files\CorsixTH\Lua\world.lua:580: in function 'markRoomAsBuil
t'
        C:\Program Files\CorsixTH\Lua\dialogs\edit_room.lua:228: in function 'ca
llback'
        C:\Program Files\CorsixTH\Lua\window.lua:590: in function 'handleClick'
        C:\Program Files\CorsixTH\Lua\window.lua:1287: in function 'onMouseUp'
        ...Program Files\CorsixTH\Lua\dialogs\place_objects.lua:440: in function
 <...Program Files\CorsixTH\Lua\dialogs\place_objects.lua:439>
        (tail call): ?
        C:\Program Files\CorsixTH\Lua\window.lua:1271: in function 'onMouseUp'
        C:\Program Files\CorsixTH\Lua\ui.lua:632: in function <C:\Program Files\
CorsixTH\Lua\ui.lua:619>
        (tail call): ?
        (tail call): ?
        (tail call): ?
        C:\Program Files\CorsixTH\Lua\app.lua:578: in function <C:\Program Files
\CorsixTH\Lua\app.lua:573>

I Have looked at the error and it seems to be button up again

Ben Dyson

  • Registered member
  • *
  • Posts: 27
    • View Profile
Re: Learning Lua:
« Reply #19 on: April 03, 2011, 01:43:46 PM »
Yay, I have gotten it to work, In room.lua I have deleted line 482 which is
Code: [Select]
self.world.ui:addWindow(UIInformation(self.world.ui, _S.room_descriptions[self.room_info.id]))And it works, although I don't know if this will cause more problems.