-
Notifications
You must be signed in to change notification settings - Fork 6
Random Animations and Pickup Star Colours #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Adds random pickup stars and random character animations
EnAppelsin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What changes are made in the p3d files uploaded from the base game and the "0.p3d" files which are new? In general I prefer to not redistribute game files and we dynamically modify P3D files instead (this isn't strictly enforced but is done when possible)
Otherwise some pedantry comments and a few code lines I find confusing
| local CharName, l = string.split("/GameData/" .. GetPath(),"/") | ||
| CharName = CharName[l]:gsub(".cho","") | ||
|
|
||
| anims = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we avoid hardcoding these animations? (Probably not)
Should be local or stored in a global table
| } | ||
|
|
||
| file = ChoreoFile | ||
| if Path:sub(21,21) ~= "n" then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check is not clear (I think it's to avoid the npd/nps/ndr etc models right?)
| end | ||
| end | ||
|
|
||
| if string.find(filePath, "art/missions/level0%d/m%d.p3d") then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually prefer the x:find() syntax now. @Hampo should comment on the changes to the waypoint code or why it's a function
| local modified = false | ||
|
|
||
| if Settings.RandoPickupStars then | ||
| local tmp_0 = math.random(1,#RandomPickupStarColours) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tmp_0 :(
not a nice variablename
| local Path = "/GameData/" .. GetPath() | ||
|
|
||
|
|
||
| if Path:sub(21,21) ~= "n" then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See other comment about this condition being unclear
| DebugPrint("Level Init File:\r\n" .. InitFile) | ||
| end | ||
| Output(LoadFile) | ||
| Output(LoadFile.."\n"..'LoadP3DFile("art\\wrench0.p3d");') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this added even if the setting is disabled?
What is wrench0.p3d
|
|
||
| DefaultStars = {"yellowstar_full_m"} | ||
|
|
||
| if false then table.insert(DefaultStars, "doorstar") end No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Old code?
| local v = "wrench_pickupstar" | ||
| local tmp = P3D.CleanP3DString(Chunk.Shader) | ||
| if string.match(tmp, v) then | ||
| print("P3D",filePath.." : "..tmp.." --> "..tmp_0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DebugPrint should be used instead of print, it timestamps it all and such. You can also specify level for more verbose information
| @@ -0,0 +1,3 @@ | |||
| --LoadP3DFile("art\\global0.p3d", "GMA_DEFAULT", "Global"); | |||
| Path = "/GameData/" .. GetPath(); | |||
| Output(ReadFile(Path)..'\nLoadP3DFile("art\\global0.p3d", "GMA_DEFAULT", "Global");') No newline at end of file | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment about what is global0.p3d, it should not be added if not needed I guess
|
Some of these changes probably imply that more custom actions should be modularised:tm: as have level/mission scripts as well |
Summary of changes
Description of changes
Adds random player animations and random item pickup star for collectibles
Any additional information
Random player animations is disabled by default but random stars is enabled by default