Streaming game development: https://www.twitch.tv/stabyourself Image

SE bugfixes

Mods, guides how to use and install mods go right in here.
I LÖVE LUA
User avatar
Posts: 170
Joined: 12 Aug 2013, 13:19
Reputation: 21
Contact:

Post » 18 Jun 2017, 02:25

Something that bothers me is that, when I'm on my laptop, I cant type numbers into inputs, so I went and made them use "textinput" instead of "keypressed". The list of the changes done to accomplish this is down below.

  • In main.lua:

    Code: Select all

    function love.textinput(text)
       if _G[gamestate .. "_textinput"] and type(_G[gamestate .. "_textinput"]) == "function" then
          local success, err = pcall(function() _G[gamestate .. "_textinput"](text) end) -- I don't wanna cause a crash
          if not success then print(err) end
       end

       if guielements then
          for _, v in pairs(guielements) do
             v:textinput(text)
          end
       end
    end
  • In gui.lua (Note: you need to replace keypress to avoid weird double input):

    Code: Select all

    function guielement:textinput(text)
       if self.type == "input" and self.inputting then
          local ok = true
          for i = 1, string.len(text) do
             if not fontquads[text:sub(i, i)] then
                ok = false
             end
          end
          if not ok then return end -- Can you believe this is taken from Minecraft?
          self.value = self.value .. text
          self.cursorpos = self.cursorpos + string.len(text)
       end
    end

    function guielement:keypress(key)
       if self.active then
          if self.type == "input" then
             if self.inputting then
                --[[if key == "-" or key == "," or key == ":" or key == ";" then
                   return
                end]]
                if key == "escape" then
                   self.inputting = false
                elseif (key == "return" or key == "enter" or key == "kpenter") then
                   if self.func then
                      self:func()
                   else
                      self.inputting = false
                   end
                elseif key == "backspace" then
                   self.value = string.sub(self.value, 1, string.len(self.value)-1)
                   if self.cursorpos > 1 and self.cursorpos > string.len(self.value)+1 then
                      self.cursorpos = self.cursorpos - 1
                   end
                   if self.offset > 0 and self.offset > string.len(self.value)-self.width+1 then
                      self.offset = self.offset - 1
                   end
                --[[else
                   if string.len(self.value) < self.maxlength or self.maxlength == 0 then
                      local found = false
                      for i = 1, string.len(fontglyphs) do
                         if key == string.sub(fontglyphs, i, i) then
                            found = true
                            break
                         end
                      end
                      
                      if found and (not self.numerical or tonumber(key) or key == "." or key == ",") then
                         if key == "," then
                            key = "."
                         end
                         
                         self.value = self.value .. key
                         if self.cursorpos ~= self.maxlength then
                            self.cursorpos = self.cursorpos + 1
                         end
                         if self.cursorpos > self.offset+self.width then
                            self.offset = self.offset + 1
                         end
                      end
                   end]]
                end
                
                return true
             end
          end
       end
    end
  • In game.lua:

    Code: Select all

    function game_textinput(text)
       if editormode and not testlevel then
          editor_textinput(text)
       end
    end
  • In editor.lua:

    Code: Select all

    function editor_textinput(text)
       if rightclickm then
          rightclickm:textinput(text)
       end

       if animationguilines then
          for i, v in pairs(animationguilines) do
             for k, w in pairs(v) do
                w:textinput(text)
             end
          end
       end
    end
  • In rightclickmenu.lua:

    Code: Select all

    function rightclickmenu:textinput(text)
       for i = 1, #self.t do
          if self.t[i].type then
             if self.t[i]:textinput(text) then
                return
             end
          end
       end
    end
  • And finally, in animationguiline.lua:

    Code: Select all

    function animationguiline:textinput(text)
       for i = 1, #self.elements do
          if self.elements[i].gui then
             self.elements[i].gui:textinput(text)
          end
       end
    end


I wanna point out that it is also implemented in my mod, but I figured it could be considered as a "bugfix".

Also, good luck Hugo with the contest (as I'm in too ;p).

HugoBDesigner
User avatar
Posts: 2124
Joined: 19 Sep 2012, 02:23
Reputation: 679
Contact:

Post » 18 Jun 2017, 03:37

Thanks a lot, dude! I was planning on implementing that at some point (I kept trying to type numbers using the keypad and it was frustrating me), so this came in handy at the right time! Implemented it already :)

And good luck with the contest too ;)

I LÖVE LUA
User avatar
Posts: 170
Joined: 12 Aug 2013, 13:19
Reputation: 21
Contact:

Post » 29 Jun 2017, 13:28

Just came across something weird in the editor (i did not move my mouse):


It also crashes when copying while the copy cursor (the green-ish square) is outside of the screen:
editor.lua:3719: attempt to index a nil value

Traceback

main.lua:126: in function '__index'
editor.lua:3719: in function 'getTiles'
editor.lua:3288: in function 'editor_keypressed'
editor.lua:4036: in function 'game_keypressed'
main.lua:1680: in function <main.lua:1619>
main.lua:80: in function <main.lua:26>
[C]: in funciton 'xpcall'

HugoBDesigner
User avatar
Posts: 2124
Joined: 19 Sep 2012, 02:23
Reputation: 679
Contact:

Post » 29 Jun 2017, 16:12

Yeah, I noticed these problems recently as well. I'm inclined to say it came with the port to SE, so I'll try to fix that if possible. Thanks!

HugoBDesigner
User avatar
Posts: 2124
Joined: 19 Sep 2012, 02:23
Reputation: 679
Contact:

Post » 01 Jul 2017, 19:05

Alright, I fixed the scrolling issues with Better Editor. But I have no idea why the error you reported happens, since I can't reproduce it myself. What exactly do you mean by "outside of the screen"?

Try reproducing it again, if you can, and if it still happens, please let me know how you make it happen, so I can understand it better. Thanks :)

I LÖVE LUA
User avatar
Posts: 170
Joined: 12 Aug 2013, 13:19
Reputation: 21
Contact:

Post » 01 Jul 2017, 19:07

I mean you scroll so much to the right you don't see the selection cursor when pressing control.

Edit 1: cool, it's fixed too. I was suspecting it a bit, but it looks those two errors were linked.

Edit 2: But there is another thing...
Image
Now (if it wasn't before) it's the replace_all that's not scrolling correctly.

HugoBDesigner
User avatar
Posts: 2124
Joined: 19 Sep 2012, 02:23
Reputation: 679
Contact:

Post » 01 Jul 2017, 19:35

It was an oversight from my end, should be patched now. Thanks again!

Technochips
User avatar
Posts: 712
Joined: 12 Mar 2015, 16:05
Reputation: 199
Contact:

Post » 29 Jul 2017, 17:19

On the latest version of Love2D, the game crashes when you try to change the controls. Apparently it's because it's using some functions for the joystick that was removed in 0.9.0. So I fixed this by copypasting this.


RealGabdhhf
Posts: 55
Joined: 16 Jul 2017, 21:45
Reputation: 14

Post » 29 Jul 2017, 18:34

No local multiplayer bug fixes?

HugoBDesigner
User avatar
Posts: 2124
Joined: 19 Sep 2012, 02:23
Reputation: 679
Contact:

Post » 29 Jul 2017, 22:01

Thanks, Technochips! Updated it to include your fixes :)

HansAgain
User avatar
Posts: 1135
Joined: 03 Feb 2012, 18:51
Reputation: 266
Contact:

Post » 02 Aug 2017, 00:21

Everytime i click the button to select tiles in the [i] entity menu the game crashes.
Image

EDIT: I happens when i do the same with the trigger area entity.

I LÖVE LUA
User avatar
Posts: 170
Joined: 12 Aug 2013, 13:19
Reputation: 21
Contact:

Post » 02 Aug 2017, 06:15

Replace editor.lua in the bugfix with this one. For some reason, startregion was commented out (maybe Hugo knows why).

HugoBDesigner
User avatar
Posts: 2124
Joined: 19 Sep 2012, 02:23
Reputation: 679
Contact:

Post » 02 Aug 2017, 12:22

Oops, probably my fault from when I was trying to fix the editor. Sorry about that, should be fixed now. Thanks, I LÖVE LUA :)

WillWare
User avatar
Posts: 1222
Joined: 08 Mar 2012, 04:35
Reputation: 267
Contact:

Post » 27 Sep 2017, 00:39

Bug report: when a level is finished in a sublevel, the next level loads into a sublevel instead of main, making it impossible to complete most mappacks. This may have something to do with the way the "load level" animation was fixed. Would post a fix for this but I can't pinpoint the exact place it occurs.

EDIT: Fixed by adding a new "reason" to the levelscreen logic. Thanks to Turret for helping me look at it.
In animation.lua starting at line 332:

Code: Select all

elseif v[1] == "loadlevel" then
   love.audio.stop()
   
   marioworld = tonumber(v[2]) or marioworld
   mariolevel = tonumber(v[3]) or mariolevel
   mariosublevel = tonumber(v[4]) or mariosublevel
   levelscreen_load("anim")

In levelscreen.lua starting at line 21:

Code: Select all

if reason == "next" or reason == "anim" then --next level
   checkpointsub = false
   checkpointx = {}
   checkpointy = {}
   respawnsublevel = 0
   if reason == "anim" then
      respawnsublevel = mariosublevel or 0
   end


EDIT 2: actually there's a much simpler way than the above
In game.lua after line 4726:

Code: Select all

mariosublevel = 0
Last edited by WillWare on 17 Nov 2017, 07:51, edited 1 time in total.

TurretBot
User avatar
Posts: 4687
Joined: 15 Mar 2012, 23:18
Reputation: 719
Contact:

Post » 28 Sep 2017, 00:25

4 possible fixes for the Lakito End entity.
Add one of these to enemy.lua at line 256:

Code: Select all

   if lakitoend and self.t == "lakito" then
      self.speedx = -3
      return false
   end

Code: Select all

   if lakitoend and self.movement == "follow" then
      self.speedx = -3
      return false
   end

Code: Select all

   if lakitoend and self.lakitoend then
      self.speedx = self.lakitoend or -3
      return false
   end

Code: Select all

   if lakitoend and (self.lakitoend or self.t == "lakito") then
      self.speedx = self.lakitoend or -3
      return false
   end

There's 4 because it depends on how you interpret the purpose of Lakito End. I actually put a strawpoll on the STYS Discord (invite) for which way people wanted me to fix it, however it turned out to be an extremely simple fix, so I just did them all. As for which fix is added, I'll leave that up to Hugo, but here's the poll if you want to vote.


Return to “Modding”

Who is online

Users browsing this forum: No registered users and 1 guest

cron