Current code base is one massive script file called "script.rpy" #2

Closed
opened 2021-06-12 04:44:36 +00:00 by MichaelYick · 9 comments
Owner

This is disgusting and needs to be refactored, thinking about per-chapter files with jump statements and labels at the end to the next chapter as to make this not horrible.
Documentation on how to do this:
https://lemmasoft.renai.us/forums/viewtopic.php?t=22809
https://lemmasoft.renai.us/forums/viewtopic.php?t=4814

This is disgusting and needs to be refactored, thinking about per-chapter files with jump statements and labels at the end to the next chapter as to make this not horrible. Documentation on how to do this: https://lemmasoft.renai.us/forums/viewtopic.php?t=22809 https://lemmasoft.renai.us/forums/viewtopic.php?t=4814
MichaelYick added the
refactor
label 2021-06-12 04:46:27 +00:00

the worst part about having to digest these 28,000+ lines isn't the code itself but the fact that i need to relive my happiness/despair cycles all over again as i fuck around with the script and debug

anyway this looks pretty simple at first glance. agreed that splitting files per chapter/route would be much better - looking around the renpy documentation i see no reason we can't split the "boilerplate code" in it's own file as well.

before i start chopping things up do you have a chapter outline for reference? otherwise i can just read through the context clues in the script

the worst part about having to digest these 28,000+ lines isn't the code itself but the fact that i need to relive my happiness/despair cycles all over again as i fuck around with the script and debug anyway this looks pretty simple at first glance. agreed that splitting files per chapter/route would be much better - looking around the renpy documentation i see no reason we can't split the "boilerplate code" in it's own file as well. before i start chopping things up do you have a chapter outline for reference? otherwise i can just read through the context clues in the script
Author
Owner

Lol, reliving the snoot trauma. In all seriousness, I'll attach a copy of the script with this message. Chapter numbers and names are pretty obvious since they're massive. I'd say the best format would be '$number. $name.rpy' for the individual chapter files. Beware that the ending segments are implemented differently than they look in the file though. Code doesn't go around per-chapter, it goes per-route.

Lol, reliving the snoot trauma. In all seriousness, I'll attach a copy of the script with this message. Chapter numbers and names are pretty obvious since they're massive. I'd say the best format would be '$number. $name.rpy' for the individual chapter files. Beware that the ending segments are implemented differently than they look in the file though. Code doesn't go around per-chapter, it goes per-route.
Author
Owner

script should be attached to THIS comment

script should be attached to THIS comment

thanks for getting the fork perms set up. quick update here

got the basic file structure done after reviewing the script and tested the call relationship with cross directory support (works out of the box very nice)

had to go awol earlier irl but i'm planning on chopping up oldscript.rpy into the new chapter .rpys before the night's over

https://git.snootgame.xyz/coolestskinnieinthejungle/SnootGame/src/branch/issue2-init

thanks for getting the fork perms set up. quick update here got the basic file structure done after reviewing the script and tested the call relationship with cross directory support (works out of the box very nice) had to go awol earlier irl but i'm planning on chopping up `oldscript.rpy` into the new chapter `.rpy`s before the night's over https://git.snootgame.xyz/coolestskinnieinthejungle/SnootGame/src/branch/issue2-init
Author
Owner

cool, hopefully once this is done, we'll have managable code. I hope this doesn't interfere with issues #4 or #5 being fixed. If it does, I think we can easily just move the commits over with either patch files or manual editing. I'll try to avoid any major work on the script until this is done though.

cool, hopefully once this is done, we'll have managable code. I hope this doesn't interfere with issues #4 or #5 being fixed. If it does, I think we can easily just move the commits over with either patch files or manual editing. I'll try to avoid any major work on the script until this is done though.
MichaelYick added the
Critical Priority
label 2021-06-13 01:55:35 +00:00

merged it into my master just now - launches fine and gets thru the opening (haven't compiled but i wouldn't think these changes would introduce new gremlins after being packed into a binary rather than just running the project thru ren.py. definitely something to check down the road before i "fully publish" it though.

https://git.snootgame.xyz/coolestskinnieinthejungle/SnootGame

feel free to peep around at your leisure. i got wagie cagie tomorrow until Wed. but i should be able to spare some time in bursts throughout the days no problem

merged it into my master just now - launches fine and gets thru the opening (haven't compiled but i wouldn't think these changes would introduce new gremlins after being packed into a binary rather than just running the project thru ren.py. definitely something to check down the road before i "fully publish" it though. https://git.snootgame.xyz/coolestskinnieinthejungle/SnootGame feel free to peep around at your leisure. i got wagie cagie tomorrow until Wed. but i should be able to spare some time in bursts throughout the days no problem
Author
Owner

renpy doesn't really have compiling-induce problems due to the way python is handled (no compiled binaries here). If stuff works in the SDK, it'll work when compiled. Probably should get some fixes for #4 and #5 implemented into this too just to avoid future headache. Any prefered way that I should send the modified code over? diff file? uploading script.rpy raw?

renpy doesn't really have compiling-induce problems due to the way python is handled (no compiled binaries here). If stuff works in the SDK, it'll work when compiled. Probably should get some fixes for #4 and #5 implemented into this too just to avoid future headache. Any prefered way that I should send the modified code over? diff file? uploading script.rpy raw?

diffs sound good - i'll tweak the appropriate files on my end for those.

diffs sound good - i'll tweak the appropriate files on my end for those.
updooted my repo (thank you @dagoddamnlazysnake) https://git.snootgame.xyz/coolestskinnieinthejungle/SnootGame/pulls/2
MichaelYick added this to the Patchy-Patch5 Release milestone 2021-06-20 04:27:39 +00:00
Sign in to join this conversation.
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Cavemanon/SnootGame#2
No description provided.