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

Closed
opened 4 months ago by PrincipalSpears · 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
PrincipalSpears added the
refactor
label 4 months ago

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
Poster
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.
Poster
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
Poster
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.
PrincipalSpears added the
Critical Priority
label 4 months ago

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
Poster
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
PrincipalSpears closed this issue 4 months ago
PrincipalSpears added this to the Patchy-Patch5 Release milestone 4 months ago
Sign in to join this conversation.
No project
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.