Skip to content

GitLab

    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    • Menu
    Projects Groups Snippets
  • Sign up now
  • Login
  • Sign in / Register
  • solarus solarus
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 229
    • Issues 229
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 10
    • Merge requests 10
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

GitLab 15.0 has launched! Please visit Breaking changes in 15.0 and 15.0 Removals to see which breaking changes may impact your workflow.

  • Solarus Games
  • solarussolarus
  • Issues
  • #667
Closed
Open
Created Mar 27, 2015 by Diarandor@DiarandorDeveloper

Request: Allow function as parameter of hero:save_solid_ground()

Allow a function as parameter of the method hero:save_solid_ground(). The function must return a coordinate (x,y,layer), where the hero would be set in case of falling in bad grounds (hole, water, lava,...).

This would be very useful in several situations allowing more customization. For example, in case the hero falls from a moving platform that is floating over a large hole, with the new function we could make the hero appear on the center of the platform. (The function would be called/created using a collision test with the platform, and destroyed an instant later as soon as the hero walks over solid ground out of the platform. It should not be hard to do this.)

The default behaviour of the engine would make the hero appear where he was before falling, but since the platform has moved, that ground could be a hole. Also, using hero:save_solid_ground(x,y,layer) before to make the hero appear at the entrance of the room or other fixed place could be bad, since this could ruin complex puzzles of the map (for instance, if there is a puzzle of several buttons opening and closing ways for the hero, the player could "cheat" jumping on the hole to reappear in another part of the room that was not accesible in the current state of the puzzle-door puzzle).

Besides, the new function would allow to solve with more customization the following well-known problem: if a stream pushes the hero into a hole, the hero reappears next to the hole, and he falls again and again into the hole (of course, to use the new function one would need to use scripted streams created with custom entities, and a similar trick as with the platform problem).

Of course, there could be more important uses for this function. Did I convince you? :)

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking