Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
  • solarus solarus
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 222
    • Issues 222
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 8
    • Merge requests 8
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • 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