Skip to content

Conversation

@duffhause
Copy link

@duffhause duffhause commented Jul 24, 2020

Summary of changes

  • I have read the CONTRIBUTING document
  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality) (target dev!)
  • My change adds a new setting/requires a change to the README & meta.ini
  • I have updated the README & meta.ini accordingly

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

@EnAppelsin EnAppelsin changed the title Dev Random Animations and Pickup Star Colours Jul 26, 2020
Copy link
Owner

@EnAppelsin EnAppelsin left a 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 = {
Copy link
Owner

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
Copy link
Owner

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
Copy link
Owner

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)
Copy link
Owner

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
Copy link
Owner

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");')
Copy link
Owner

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
Copy link
Owner

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)
Copy link
Owner

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
Copy link
Owner

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

@EnAppelsin EnAppelsin requested review from EnAppelsin and Hampo July 26, 2020 15:05
@EnAppelsin
Copy link
Owner

Some of these changes probably imply that more custom actions should be modularised:tm: as have level/mission scripts as well

@EnAppelsin EnAppelsin self-assigned this Jul 26, 2020
@EnAppelsin EnAppelsin added the enhancement New feature or request label Jul 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants