kierananthonypenrice / PlayVN

A visual novel development plugin for Noble Engine for the Panic Playdate
MIT License
2 stars 1 forks source link

Demo crashes on Event 19 (Mac build) #1

Open jcedelson opened 3 months ago

jcedelson commented 3 months ago

I'm trying to run a build of the PlayVN demo project but it crashes after showing the text of event number 19. I had to make some tweaks to the build and run file to make the project build on my Mac, and do a few steps manually. I'm not sure if that's relevant to the error I actually experienced though. That was the only file I edited, I merged both folders as instructed and didn't do anything to any other file.

Event 19 (I looked it up in the JSON) was the first event I encountered where the text spilled onto a second screen. The second part of 19 loads when I click A, but when I click A again, it crashes rather than continue on to 20.

The full output of the console after that crash:

Total number of game slots: 1
libraries/playvn/visualnovelfunctions.lua:545: attempt to index a nil value (global 'rightpeepSprite')
stack traceback:
    libraries/playvn/visualnovelfunctions.lua:545: in function 'checkPeeps'
    libraries/playvn/visualnovelfunctions.lua:871: in function 'dialogueEvent'
    libraries/playvn/visualnovelfunctions.lua:998: in function 'checkEventType'
    scenes/PlayVNDemo.lua:82: in method 'update'
    libraries/noble/Noble.lua:323: in function <libraries/noble/Noble.lua:308>

And here's the full text of my edited file (retitled "build-and-run.ps1" so I could run it from Terminal)```

param (
    [string]$build = "./builds",
    [string]$source = "./source",
    [string]$name = (Get-Item -Path .).BaseName,
    [switch]$dontbuild = $false
 )
$pdx = Join-Path -Path "$build" -ChildPath "$name.pdx"

# Create build folder if not present
if (!$dontbuild)
{
    New-Item -ItemType Directory -Force -Path "$build"
}

# Clean build folder
if (!$dontbuild)
{
    Remove-Item "$build\*" -Recurse -Force 
}

# Build
if (!$dontbuild)
{
    pdc -sdkpath "$Env:PLAYDATE_SDK_PATH" "$source" "$pdx"
}

# Close Simulator
$sim = Get-Process "PlaydateSimulator.app" -ErrorAction SilentlyContinue

if ($sim)
{
    $sim.CloseMainWindow()
    $count = 0
    while (!$sim.HasExited) 
    {
        Start-Sleep -Milliseconds 10
        $count += 1

        if ($count -ge 5)
        {
            $sim | Stop-Process -Force
        }
    }
}

# Run (Simulator)
# & "$Env:PLAYDATE_SDK_PATH/bin/PlaydateSimulator.app" "$pdx"
kierananthonypenrice commented 3 months ago

Hey man thanks for trying out PlayVN!

I'll do my best to help you with this. Can you send me what you have in the JSON for events 19 and 20?


From: jcedelson @.> Sent: 21 June 2024 04:26 To: kierananthonypenrice/PlayVN @.> Cc: Subscribed @.***> Subject: [kierananthonypenrice/PlayVN] Demo crashes on Event 19 (Mac build) (Issue #1)

I'm trying to run a build of the PlayVN demo project but it crashes after showing the text of event number 19. I had to make some tweaks to the build and run file to make the project build on my Mac, and do a few steps manually. I'm not sure if that's relevant to the error I actually experienced though. That was the only file I edited, I merged both folders as instructed and didn't do anything to any other file.

Event 19 (I looked it up in the JSON) was the first event I encountered where the text spilled onto a second screen. The second part of 19 loads when I click A, but when I click A again, it crashes rather than continue on to 20.

The full output of the console after that crash:

Total number of game slots: 1 libraries/playvn/visualnovelfunctions.lua:545: attempt to index a nil value (global 'rightpeepSprite') stack traceback: libraries/playvn/visualnovelfunctions.lua:545: in function 'checkPeeps' libraries/playvn/visualnovelfunctions.lua:871: in function 'dialogueEvent' libraries/playvn/visualnovelfunctions.lua:998: in function 'checkEventType' scenes/PlayVNDemo.lua:82: in method 'update' libraries/noble/Noble.lua:323: in function <libraries/noble/Noble.lua:308>

And here's the full text of my edited file (retitled "build-and-run.ps1" so I could run it from Terminal)```

param ( [string]$build = "./builds", [string]$source = "./source", [string]$name = (Get-Item -Path .).BaseName, [switch]$dontbuild = $false ) $pdx = Join-Path -Path "$build" -ChildPath "$name.pdx"

Create build folder if not present

if (!$dontbuild) { New-Item -ItemType Directory -Force -Path "$build" }

Clean build folder

if (!$dontbuild) { Remove-Item "$build*" -Recurse -Force }

Build

if (!$dontbuild) { pdc -sdkpath "$Env:PLAYDATE_SDK_PATH" "$source" "$pdx" }

Close Simulator

$sim = Get-Process "PlaydateSimulator.app" -ErrorAction SilentlyContinue

if ($sim) { $sim.CloseMainWindow() $count = 0 while (!$sim.HasExited) { Start-Sleep -Milliseconds 10 $count += 1

    if ($count -ge 5)
    {
        $sim | Stop-Process -Force
    }
}

}

Run (Simulator)

& "$Env:PLAYDATE_SDK_PATH/bin/PlaydateSimulator.app" "$pdx"

— Reply to this email directly, view it on GitHubhttps://github.com/kierananthonypenrice/PlayVN/issues/1, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIFASU2NQFCNGGGPGBIMELTZIOMP7AVCNFSM6AAAAABJVC2BV6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGM3DKNRTGY4TKMQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>

jcedelson commented 2 months ago

Thanks for getting back to me so quickly! Here's that section of the JSON:

"19": {

"eventtype": "dialogue",

"content": "He's a sweetheart, isn't he? Now, what if we want to have

more than one person in the scene?",

"whospeaking": "Trickle",

"middlepeeptalking": "~1trickleforwardst1~",

"goto": "20"

},

"20": {

"eventtype": "dialogue",

"content": "Let me just shuffle over here a sec",

"whospeaking": "Trickle",

"middlepeep": "",

"rightpeep": "~1trickleforwards1~",

"rightpeeptalking": "~1trickleforwardst1~",

"goto": "21"

},

On Fri, Jun 21, 2024 at 1:44 AM kierananthonypenrice < @.***> wrote:

Hey man thanks for trying out PlayVN!

I'll do my best to help you with this. Can you send me what you have in the JSON for events 19 and 20?


From: jcedelson @.> Sent: 21 June 2024 04:26 To: kierananthonypenrice/PlayVN @.> Cc: Subscribed @.***> Subject: [kierananthonypenrice/PlayVN] Demo crashes on Event 19 (Mac build) (Issue #1)

I'm trying to run a build of the PlayVN demo project but it crashes after showing the text of event number 19. I had to make some tweaks to the build and run file to make the project build on my Mac, and do a few steps manually. I'm not sure if that's relevant to the error I actually experienced though. That was the only file I edited, I merged both folders as instructed and didn't do anything to any other file.

Event 19 (I looked it up in the JSON) was the first event I encountered where the text spilled onto a second screen. The second part of 19 loads when I click A, but when I click A again, it crashes rather than continue on to 20.

The full output of the console after that crash:

Total number of game slots: 1 libraries/playvn/visualnovelfunctions.lua:545: attempt to index a nil value (global 'rightpeepSprite') stack traceback: libraries/playvn/visualnovelfunctions.lua:545: in function 'checkPeeps' libraries/playvn/visualnovelfunctions.lua:871: in function 'dialogueEvent' libraries/playvn/visualnovelfunctions.lua:998: in function 'checkEventType' scenes/PlayVNDemo.lua:82: in method 'update' libraries/noble/Noble.lua:323: in function <libraries/noble/Noble.lua:308>

And here's the full text of my edited file (retitled "build-and-run.ps1" so I could run it from Terminal)```

param ( [string]$build = "./builds", [string]$source = "./source", [string]$name = (Get-Item -Path .).BaseName, [switch]$dontbuild = $false ) $pdx = Join-Path -Path "$build" -ChildPath "$name.pdx"

Create build folder if not present

if (!$dontbuild) { New-Item -ItemType Directory -Force -Path "$build" }

Clean build folder

if (!$dontbuild) { Remove-Item "$build*" -Recurse -Force }

Build

if (!$dontbuild) { pdc -sdkpath "$Env:PLAYDATE_SDK_PATH" "$source" "$pdx" }

Close Simulator

$sim = Get-Process "PlaydateSimulator.app" -ErrorAction SilentlyContinue

if ($sim) { $sim.CloseMainWindow() $count = 0 while (!$sim.HasExited) { Start-Sleep -Milliseconds 10 $count += 1

if ($count -ge 5) { $sim | Stop-Process -Force } } }

Run (Simulator)

& "$Env:PLAYDATE_SDK_PATH/bin/PlaydateSimulator.app" "$pdx"

— Reply to this email directly, view it on GitHub< https://github.com/kierananthonypenrice/PlayVN/issues/1>, or unsubscribe< https://github.com/notifications/unsubscribe-auth/AIFASU2NQFCNGGGPGBIMELTZIOMP7AVCNFSM6AAAAABJVC2BV6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGM3DKNRTGY4TKMQ>.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/kierananthonypenrice/PlayVN/issues/1#issuecomment-2182192242, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQ3GFULOZDAY32EY4RY47XTZIPKWBAVCNFSM6AAAAABJVC2BV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBSGE4TEMRUGI . You are receiving this because you authored the thread.Message ID: @.***>

kierananthonypenrice commented 2 months ago

Hi I believe the error is possibly due to it trying to index an image file that doesn't exist. I will have to investigate further later today.


From: jcedelson @.> Sent: 21 June 2024 10:40 To: kierananthonypenrice/PlayVN @.> Cc: kierananthonypenrice @.>; Comment @.> Subject: Re: [kierananthonypenrice/PlayVN] Demo crashes on Event 19 (Mac build) (Issue #1)

Thanks for getting back to me so quickly! Here's that section of the JSON:

"19": {

"eventtype": "dialogue",

"content": "He's a sweetheart, isn't he? Now, what if we want to have more than one person in the scene?",

"whospeaking": "Trickle",

"middlepeeptalking": "~1trickleforwardst1~",

"goto": "20"

},

"20": {

"eventtype": "dialogue",

"content": "Let me just shuffle over here a sec",

"whospeaking": "Trickle",

"middlepeep": "",

"rightpeep": "~1trickleforwards1~",

"rightpeeptalking": "~1trickleforwardst1~",

"goto": "21"

},

On Fri, Jun 21, 2024 at 1:44 AM kierananthonypenrice < @.***> wrote:

Hey man thanks for trying out PlayVN!

I'll do my best to help you with this. Can you send me what you have in the JSON for events 19 and 20?


From: jcedelson @.> Sent: 21 June 2024 04:26 To: kierananthonypenrice/PlayVN @.> Cc: Subscribed @.***> Subject: [kierananthonypenrice/PlayVN] Demo crashes on Event 19 (Mac build) (Issue #1)

I'm trying to run a build of the PlayVN demo project but it crashes after showing the text of event number 19. I had to make some tweaks to the build and run file to make the project build on my Mac, and do a few steps manually. I'm not sure if that's relevant to the error I actually experienced though. That was the only file I edited, I merged both folders as instructed and didn't do anything to any other file.

Event 19 (I looked it up in the JSON) was the first event I encountered where the text spilled onto a second screen. The second part of 19 loads when I click A, but when I click A again, it crashes rather than continue on to 20.

The full output of the console after that crash:

Total number of game slots: 1 libraries/playvn/visualnovelfunctions.lua:545: attempt to index a nil value (global 'rightpeepSprite') stack traceback: libraries/playvn/visualnovelfunctions.lua:545: in function 'checkPeeps' libraries/playvn/visualnovelfunctions.lua:871: in function 'dialogueEvent' libraries/playvn/visualnovelfunctions.lua:998: in function 'checkEventType' scenes/PlayVNDemo.lua:82: in method 'update' libraries/noble/Noble.lua:323: in function <libraries/noble/Noble.lua:308>

And here's the full text of my edited file (retitled "build-and-run.ps1" so I could run it from Terminal)```

param ( [string]$build = "./builds", [string]$source = "./source", [string]$name = (Get-Item -Path .).BaseName, [switch]$dontbuild = $false ) $pdx = Join-Path -Path "$build" -ChildPath "$name.pdx"

Create build folder if not present

if (!$dontbuild) { New-Item -ItemType Directory -Force -Path "$build" }

Clean build folder

if (!$dontbuild) { Remove-Item "$build*" -Recurse -Force }

Build

if (!$dontbuild) { pdc -sdkpath "$Env:PLAYDATE_SDK_PATH" "$source" "$pdx" }

Close Simulator

$sim = Get-Process "PlaydateSimulator.app" -ErrorAction SilentlyContinue

if ($sim) { $sim.CloseMainWindow() $count = 0 while (!$sim.HasExited) { Start-Sleep -Milliseconds 10 $count += 1

if ($count -ge 5) { $sim | Stop-Process -Force } } }

Run (Simulator)

& "$Env:PLAYDATE_SDK_PATH/bin/PlaydateSimulator.app" "$pdx"

— Reply to this email directly, view it on GitHub< https://github.com/kierananthonypenrice/PlayVN/issues/1>, or unsubscribe< https://github.com/notifications/unsubscribe-auth/AIFASU2NQFCNGGGPGBIMELTZIOMP7AVCNFSM6AAAAABJVC2BV6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGM3DKNRTGY4TKMQ>.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/kierananthonypenrice/PlayVN/issues/1#issuecomment-2182192242, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQ3GFULOZDAY32EY4RY47XTZIPKWBAVCNFSM6AAAAABJVC2BV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBSGE4TEMRUGI . You are receiving this because you authored the thread.Message ID: @.***>

— Reply to this email directly, view it on GitHubhttps://github.com/kierananthonypenrice/PlayVN/issues/1#issuecomment-2182397129, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIFASUZMXERWTX37WOGJPHTZIPYH5AVCNFSM6AAAAABJVC2BV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBSGM4TOMJSHE. You are receiving this because you commented.

kierananthonypenrice commented 2 months ago

Hi I found the problem.

Line 542 had ~= where it should have had ==. I also spotted a problem with the left and right character positions being messed up. I have corrected both and uploaded the changes. If you redownload the main.lua and visualnovelfunctions.lua and overwrite the old ones it should now work.

Please give it a go and let me know how you get on.