001 Game Creator

001 Game Creator

Not enough ratings
Game Recipe #1 Simple Following Flashlight/Torch
By MrNumbers
In this Game Recipe, we will be going over how to make a light follow an actor. We will be covering how to make a light that is centered on a player, or a light that is positioned in front of the player.
   
Award
Favorite
Favorited
Unfavorite
Requirements
  • Map with a sun color set to non-white.
  • Actor to attach a light to.
  • Light placed on a map.
Setup
  1. Open the map you want the flashlight to work on.
  2. Using the Timer tool, place a timer on the map.
    1. Set the Initial Delay to 0 seconds.
    2. Set the Every Interval to 0.05 seconds.
  3. Select the Every Timer Tick trigger and then press the Edit Script button
  4. Place a Position Light event. 
    1. For Centered On Actor Lights
      1. Select the light, then press the use-value box for the position.
      2. Select Actor > X Position.
      3. Select the actor you want the light to follow, then press OK.
      4. Click the use-value box for the Y position.
      5. Select Actor > Y Position.
      6. Select the actor you want the light to follow, then press OK.
      7. Click the use-value box for the Z position.
      8. Select Actor > Z Position.
      9. Select the actor you want the light to follow, then press OK.
      10. At the end of the Z use-value box, add + 48 to the end. It should look something like Actor("main").Z + 48.
      11. Press OK to close the Position Light event.
    2. For In Front Of Actor/Offset Lights
      1. Select the light, then press the use-value box for the position.
      2. Select Geometry > Direction Point X.
      3. For origin, select the use-value box and select Actor > X Position.
      4. Select the actor you want the light to follow, then press OK.
      5. Click the use-value box for the direction.
      6. Select Actor > Rotation Z.
      7. Select the actor you want the light to follow, then press OK.
      8. Enter into the length how far away you want the light from the actor, such as 64 or 128, then press OK.
      9. Select the use-value box for Y Position.
      10. Select Geometry > Direction Point Y.
      11. For origin, select the use-value box and select Actor > Y Position.
      12. Select the actor you want the light to follow, then press OK.
      13. Click the use-value box for the direction.
      14. Select Actor > Rotation Z.
      15. Select the actor you want the light to follow, then press OK.
      16. Enter into the length how far away you want the light from the actor, such as 64 or 128.
      17. Click the use-value box for the Z position.
      18. Select Actor > Z Position.
      19. Select the actor you want the light to follow, then press OK.
      20. At the end of the Z use-value box, add + 48 to the end. It should look something like Actor("main").Z + 48.
      21. Press OK to save and close the Position Light event.
  5. Press OK to save and close the scripting window.
  6. Press OK to save and close the timer window.
  7. Test your project to make sure your flashlight/torch light is working properly.
Notes
When handling lights in 001 Game Creator, care must be taken, as abusing the lighting system will cause significant performance issues. If you notice performance issues try reducing the size of the light, or increasing the Every Interval delay of your timer. Reducing the number of lights on the map will help as well.
2 Comments
MrNumbers  [author] Mar 4, 2021 @ 1:42pm 
Thank you for pointing that out Andika777!
It should be good now :)
Andika777 Mar 2, 2021 @ 4:15am 
Hi! Within the program, the first and third links are swapped. Flashlight and titlescreen