Random Animations and Pickup Star Colours#59
Random Animations and Pickup Star Colours#59duffhause wants to merge 3 commits intoEnAppelsin:devfrom
Conversation
Adds random pickup stars and random character animations
EnAppelsin
left a comment
There was a problem hiding this comment.
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.
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.
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.
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.
tmp_0 :(
not a nice variablename
| local Path = "/GameData/" .. GetPath() | ||
|
|
||
|
|
||
| if Path:sub(21,21) ~= "n" then |
There was a problem hiding this comment.
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.
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 |
| 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.
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.
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