hi im getting error in simulator but it works fine testing in browser. I cant test on hardware as mine didnt come yet. anyone know how to fix this? 02:07:59: SetupDiGetDeviceRegistryProperty failed (122) (required size=560)
02:07:59: Loading: OK
loaded pdz in 2ms
caching bitmaps...
using frames.pdt
using pipe.pdt
using chars.pdt
welcome back!
ready in 16ms
Update error: ? attempt to perform arithmetic on a nil value
stack traceback:
?: in upvalue '?'
?: in function <?:3743>
02:07:59: Update failed, simulator paused. im not sure what variable i have to fix theres no name mentioned plus i dont think i have a linecode 3743.. using pulp so I'm not to codey
So line 3743 refers to probably main.lua
When you download a PDX it actually converts the pulp JSON into a lua game. So you can go into the folder and open the main.lua or whatever else in a text editor to find the reference
i opened the main.pdz but tis just weird letters.. is this the same as main.lua? where can i find that thanks! Dropbox - main.pdz - Simplify your life
ah sorry. i forget that pulp has the main and other files converted to pdz. i was thinking of when i ran things through pulpmill and got a lua project. this won't be readable i believe. one other thing to check is to make sure the pdxinfo (which you can open in a text editor) has a proper pdxversion attached. i've had that issue throw a wrench in things. not sure if it's related here.
ok i checked that version=1.0
buildNumber=1
imagePath=card
pdxversion=11000
buildtime=747098836 ...versions build 1 is correct its version 1 which it says in actual pdxinfo. whats weird is it runs fine in the browser, but in simulator there's an error but im not sure how to get to the main.lua to even know what to fix. it seems to happen on cranking/a button...
If it launches fine then crashes on pressing a specific button or cranking, can you share the code for that event? Either confirm
for the A button, cancel
for the B button, or crank
for the crank. Maybe there is something in the pulpscript we can spot
rooms are numbered room1 room2 etc i took out confirm code and cancel code (which just plays a song) so it happens on crank. ok here's crank code:
on crank do
// crankTotal += event.ra
crankTotal += event.ra
roomnb = crankTotal
roomnb /= 180
// roomb =>5
roomnb = floor roomnb
room = "room{roomnb}"
goto 11,10 in "{room}"
end ...it works 100 percent in the online browser...
Not sure if that's the issue, but unless you have a "room-1" you should probably check for the roomnb to be >= 0 (or 1 if you don't have a "room0" either).
If we add some logging we should be able to see exactly what line it errors on and why:
on crank do
log "crankTotal: {crankTotal}"
log "event.ra: {event.ra}"
crankTotal += event.ra
log "crankTotal: {crankTotal}"
log "roomnb: {roomnb}"
roomnb = crankTotal
log "roomnb: {roomnb}"
roomnb /= 180
log "roomnb: {roomnb}"
roomnb = floor roomnb
log "roomnb: {roomnb}"
room = "room{roomnb}"
log "room: {room}"
goto 11,10 in "{room}"
end
Try that and share the simulator error again
ok i added a room0 and the log here is what it shows: 09:47:41: Loading: OK
loaded pdz in 2ms
caching bitmaps...
using frames.pdt
using pipe.pdt
using chars.pdt
ready in 15ms
crankTotal: 6.654425
event.ra: 6.654425
crankTotal: 13.30885
roomnb: 0
roomnb: 13.30885
roomnb: 0.07393806
roomnb: 0
room: room0
crankTotal: 58.87874
event.ra: 45.56989
crankTotal: 104.4486
roomnb: 0
roomnb: 104.4486
roomnb: 0.5802701
roomnb: 0
room: room0
crankTotal: 131.4854
event.ra: 27.03679
crankTotal: 158.5222
roomnb: 0
roomnb: 158.5222
roomnb: 0.8806789
roomnb: 0
room: room0
crankTotal: 178.7234
event.ra: 20.20122
crankTotal: 198.9246
roomnb: 0
roomnb: 198.9246
roomnb: 1.105137
roomnb: 1
room: room1
crankTotal: 254.8807
event.ra: 55.95611
crankTotal: 310.8369
roomnb: 1
roomnb: 310.8369
roomnb: 1.726871
roomnb: 1
room: room1
crankTotal: 318.8614
event.ra: 8.024506
crankTotal: 326.8859
roomnb: 1
roomnb: 326.8859
roomnb: 1.816033
roomnb: 1
room: room1
crankTotal: 331.8382
event.ra: 4.952301
crankTotal: 336.7905
roomnb: 1
roomnb: 336.7905
roomnb: 1.871058
roomnb: 1
room: room1
crankTotal: 345.8617
event.ra: 9.071213
crankTotal: 354.9329
roomnb: 1
roomnb: 354.9329
roomnb: 1.97185
roomnb: 1
room: room1
crankTotal: 412.011
event.ra: 57.07808
crankTotal: 469.0891
roomnb: 2
roomnb: 469.0891
roomnb: 2.60605
roomnb: 2
room: room2
crankTotal: 517.1779
event.ra: 48.08884
crankTotal: 565.2667
roomnb: 2
roomnb: 565.2667
roomnb: 3.140371
roomnb: 3
room: room3
Update error: ? attempt to perform arithmetic on a nil value
stack traceback:
?: in upvalue '?'
?: in function <?:3743>
09:47:46: Update failed, simulator paused.
Ok great, so we can see that the code in the crank
event is running fine from the logs. I suspect it's actually something in an enter
event when entering room3, start by checking the enter
event in the room3 script if you have one!
Try to pinpoint where the error is by taking out the enter events as you did with the confirm and cancel events and by adding logging between each line so you can see exactly which line causes the error.
yes! Thank you! Somehow the picture showing is causin the error! Im going to rework the 2 levels and release this game! Anyone that already commented here message me and ill send you the game ok thanks all!!!!!