Version 0.13.0
Hey everyone. Sorry about the long period without any releases, there was a bad case of scope creep for this particular release, which you can probably infer from the long list of added features. For the sake of posterity, these are the update's major features as are now specified on the front page changelog:
- The 'code_on_add' and 'code_on_remove' properties were added to map objects, which allow you run a piece of code at the moment an object is added (including during initialization) or removed from the map respectively.
- The 'code_on_enter' and 'code_on_leave' properties were added to maps, allowing you to run a piece of code the moment the map is entered or left.
- The 'execute_code' control command was added, which executes a piece of code.
- The 'set_state(state_name, value)' and 'get_state(state_name)' functions were added to all pink engine objects. These functions can be used to save variables to an object after initialization.
- A new parallel process was added by the name of 'ConditionalCodeTriggers'. This parallel process is used to run pieces of code once specified conditions are met.
- A new parallel process was added by the name of 'ConditionalEventTriggers'. This parallel process is used to trigger events once specified conditions are met.
- Both of the new parallel processes make use of a new model of architecture that allows individual map objects (using code_on_add) to add conditional events and code triggers to them, rather than having to specify them all in the map properties. This should provide a more user-friendly experience to developers. Old parallel processes will be transitioned to the new model during a future update.
- The function 'pink_otm_wait_for_npc_to_finish_move(target_npc)' was added to the standard events library. This function makes an event halt until the targeted NPC has completed all its control commands.
- The function 'pink_otm_wait_for_player_to_finish_move()' was added to the standard events library. This function makes an event halt until the PC has completed all its control commands.
- The function 'pink_otm_walk_up_to_character(moving_npc, target_character)' was added to the standard events library. This function makes the moving_npc walk up to the target_character's nearest passable side and turn to it.
- The function 'pink_otm_pursuit_script(target_npc, pursuit_speed)' was added to the standard events library. This function makes the target_npc pursue the player. Best used in combination with arbitrary code triggers to start a pursuit once specified conditions are met. If no pursuit speed is specified, a default speed (specifiable in standard_events.rpy) can be specified.
- The function 'pink_otm_cease_pursuit_script(target_npc, return_coord)' was added to the standard events library. This function makes the target_npc cease pursuing the player and return to the given return_coord.
- The function 'get_map_object(ref_id)' was added to OTM maps. This function is used to retrieve objects by their ref_id from the map. In 'code_on_add' code, this function can be used by an object to reference itself without needing to use a ref_name.
- The functions 'pink_otm_pursuit_range(npc, engage_range, disengage_range, pursuit_speed, in_view)', 'pink_otm_pursuit_cone(npc, engage_range, disengage_range, pursuit_speed, in_view)' and 'pink_otm_pursuit_line(npc, engage_range, disengage_range, pursuit_speed, in_view)' were added to the standard events library. These functions can be used on NPCs in code_on_add to add ConditionalCodeTriggers to make these NPCs pursue the PC if they enter in a range, line-of-sight or cone-of-sight of the NPC respectively. If a disengage_range is given, a second ConditionalCodeTrigger is added that makes the pursuit stop once the PC gets sufficiently far away. If in_view is set to True (the default), the NPC will only pursue if they have a clear line-of-sight of the PC.
- Ten test rooms were added to demonstrate the new functions. These are rooms E-01 through E-10.
- The ren'py variable 'pink_otm_event_button' was added. This variable remembers the button that was used to initiate an event. This way, you can make different keys start different kinds of events when interacting with an object. Test room A24 was added to demonstrate this functionality.
Yeah, that's a lot of very powerful utilities right there. A special thank you to user hellofeline on our discord server, whose experimentation and feedback on the new features led to significant refinement.
This version contains 11 new test rooms, each demonstrating new functionality. I'll list 'em out here, so you don't have to go digging to figure out how each room works:
- Test Room A-24 exists solely to demonstrate the functionality of the new 'pink_otm_event_button' ren'py variable. The NPC will tell you which button was used to interact with it. If you look in the code, you will see examples of how to specify keyboard strokes, mouse presses and gamepad buttons.
- The 'consistent' boolean property was added to map properties. If an object's 'consistent' property is set to False, its state will not persist after leaving the map even if a ref_name is assigned to the object.
- Test Room E-01 demonstrates the 'pink_otm_pursuit_line' functionality, with the various NPCs in this room invoking that function through their 'code_on_add' property. There are three minotaurs in the room, each of which will start pursuing the player once they enter their line of sight. Their paths are very static, so you should be able to slip around the minotaurs and reach the end of the room with ease.
- Test Room E-02 demonstrates an alternate usage of the 'pink_otm_pursuit_line' functionality. It works identically to Room E-01, except you can't get around the line of sight of the NPCs, and their run speed is slightly lower than yours. This means you can race to stay ahead of them. Try to reach the end of the room without being caught.
- Test Room E-03 is another implementation of 'pink_otm_pursuit_line', featuring another race. In this room, the in_view variable is set to False, meaning that the minotaurs will be able to see you pass from behind pillars.
- Whereas Test Room E-01 through E-03 are concerned with ConditionalCodeTriggers, Test Room E-04 is concerned with ConditionalEventTriggers. If you stand in the line of sight of the NPCs in this room, it will trigger an event that causes them to walk up to you. The event for each NPC has an attached variable that ensures their event can be triggered only once, though it's also possible to use this functionality to build events that can be triggered multiple times.
- Test Room E-05 makes use of the 'execute_code' control command and the 'code_on_enter' map property to have an NPC walk around the room and even switch between maps depending on the time of day. Interact with the computer on the map to advance the time of day. The variable 'pink_otm_E05_time' tracks the current time of day, whereas the variable 'pink_otm_E05_npc_state' tracks which state the NPC is in. For each valid combination of these values (only combinations wherein the npc_state is equal to or one state earlier than the overall time are valid) there is a conditional object on the map. If the time is incremented, the old conditional NPC is despawned and the new conditional NPC set to walk from the old time location to the new location is spawned in its stead. This conditional NPC's movement route ends on an 'execute_code' command, that makes the moving NPC despawn and a static NPC spawn in the location of the new time zone. The 'code_on_enter' function assigns the current value of 'pink_otm_E05_time' to 'pink_otm_E05_npc_state', meaning that if you leave a room while an NPC is moving, it will be in its final location upon reenterin the room.
- Test Room E-06 makes use of a cone-based line of sight to trigger a ConditionalEventTriggers.
- Test Room E-07 makes use of pink_otm_pursuit_range to trigger pursuits by minotaurs.
- Test Room E-08 demonstrates how to add ConditionalEventTriggers on an object on an invisible 'interact' layer. The same can be done with ConditionalCodeTriggers. Trying to run in the room will trigger the event.
- Test Room E-09 demonstrates the disengage_range feature on the pursuit scripts. It has a minotaur that starts a pursuit based on range, similar to room E-06, but he will cease pursuit and return to its original position if the player gets more than six square away.
- Test Room E-10 demonstrates how to add ConditionalEventTriggers directly from the map properties, using code_on_enter. The functionality is identical to Test Room E-08.
If you're wondering why there's no Test Floor D: Floor D is where I put all my test rooms for RPG features that are still under development, so aren't in this release. If you're curious, you can find a test version of this branch featuring a Quest Journal on the discord server.
The next update will see the new ParallelProcesses architecture applied to all older parallel processes, which will make it possible to add new conditions to these processes from individual map objects. It should (hopefully) take significantly less time than this release.
Files
Get Pink Engine
Pink Engine
A framework for using Tiled-created orthogonal maps in Ren'py.
Status | In development |
Category | Tool |
Author | pink productions |
Tags | framework, Ren'Py |
More posts
- Version 0.20.0Jul 16, 2024
- Version 0.19.0Dec 13, 2023
- Version 0.18.0Aug 02, 2023
- Version 0.17.0Apr 23, 2023
- Version 0.16.1Feb 01, 2023
- Version 0.16.0Jan 01, 2023
- Version 0.15.2Nov 02, 2022
- Version 0.15.1Sep 18, 2022
- Version 0.15.0Aug 29, 2022
- Version 0.14.0May 24, 2022
Leave a comment
Log in with itch.io to leave a comment.