The Dink Network

Push and Pull

Dink creates a barricade and stacks his resources safely in a corner. This makes pushing and pulling a snap! Turn that frown upside-down... or not.
Description
Push and Pull is a rebuild of the push system, so Dink can push things smoothly, and move with the objects, like in other games.

Might sound simple, but when you start to discover the bugs of trying to rebuild a hard coded game mechanic with DinkC, boy is it frustrating!

2 Months of 1 hour+ work a day of trial and error, and complete restarts when one method wouldn't work, and over 1000 lines of DinkC later, and here we have it!

Special Thanks to Bluedy for creating the map and title screen to show my dev file off, and for testing as well. He sped the development up of this file.

Enjoy, and please report bugs if/when you find them.

NOTE: This is a Development D-Mod, and it may not have a quest to complete or a story to experience.
Released:August 31st, 2022
File Size:3.34 MB
Downloads:402
Release Notes:Make sure you delete any old "pushandpull" Dmod folder in your Dink Directory before installing this package - installing over the top will cause bugs in the demonstration Dmod, and confusion when implementing, since I have deleted a lot of scripts that are no longer required.

There are many changes in this version but all old moveable sprite scripts will still work without any change, so you can implement this update into your dmod effortlessly.

Some of the updates and fixes:
- Removed the “Hold Z to pull” method. Sticky push is the one and only method now, because it’s superior and much more intuitive.
- Fixed an issue with remotely terminating a push/pull procedure, where it would not reset the sprite properly.
- Added custom key values that can be retrieved to determine current status and specifics of push/pull, for ease of puzzle creating.
- Removed much redundant scripting (Many unused custom keys, external calls, loops, unused procedures, and other redundant stuff).
- Fixed a bug where a sprite can permanently lose it's hardness if Dink touches it while moving another sprite.
- Fixed incorrect calculations in collision which would sometimes cause the player to move through hardness when pulling.
- Fixed the automatic hardbox calculation, used when the author DOES NOT pass hardbox info to phisbo proc in their sprite's script.
- Added a popup warning for authors if auto hardbox calc is unsuitable for the particular screen, and a reminder to pass the hardbox values to the phisbo procedure instead.
- The Push/Pull sequence frame_delay matches Dink's speed now, no sliding along the ground - now dink's steps actually match his speed everytime no matter the speed of the sprite.
- Fixed a bug where Dink could activate the push/pull on two sprites at once and the whole game would start glitching.
- Fixed a bug where Dink's push sequences can get messed up between loading save games.
- Fixed a bug with the "moveactive" procedure that would sometimes cause the procedure to return "0" when it should return "1".
- Skeleton "move-able sprite" script has been updated to reflect changes, with some redundant stuff removed and to clean it up.
- Added a sp_custom key, which can be set to make a sprite ignore hardness when being push/pulled.
- Added many other custom keys able to be "set" in the moveable sprite's script, to manipulate and configure almost any aspect of the push and pull system.
- Altered push/pull calculations to assure sprite move limits are strictly followed regardless of engine timing issues, so a sprite will not move even 1 pixel passed it's intended x/y limit.
- Fixed a bug that would cause a very slight(probably un-detectable) discrepency when using a sp_custom key to override a sprite's move limit.
- Fixed Dink's position mis-aligning when swapping between push and pull, and a faster item is equipped, causing weird graphic jumping issues.
- Old dink push mechanic and push and pull BOTH work - if push and pull is configured on a sprite, it will work, and sprites with a push procedure will still work and use the old dink push mechanic.
- Push and Pull now does not interfere with original push mechanic when walking against sprites - you can now enable “push_active” if you want so dinks push anim still happens on all sprites (even ones that aren't move-able)
- Fixed a bug where pull calculations would get messed up, causing Dink and the Sprite to jump across the screen
- When you check if a sprite is currently being moved with "external("phisbo", "moveactive)", it now returns the active sprite number of detected sprite(if it tests TRUE) instead of just returning "1".
- Fixed a bug caused by a conflict of active sprite numbers in the push and pull scripts, when a dmod developer attaches a shadow to a move-able sprite.
- Altered system to unload 1 very large script out of memory(phishyb.c) as soon as push and pull is fully initiated (lag removal).
- Simplified dinkspeed.c script (it’s super simple now compared to before)
- Removed requirement of button4.c script.
- Removed many unnecessary "wait()" lines. (lag/delay removed)
- Global Variable “&spush” no longer required
- Local variable no longer required in move-able sprite scripts
- Removed use of init lines (no duplicate push graphics loaded over the top of pig feed sequence anymore. Push anim accomplished with created fakedink sprite shadowed to Dink instead)
- Removed chance of dink showing the push sequence of a direction the player presses to disengage, before resuming his normal base_walk.
- Added diagonal direction check to phisbo.c to remove lag, by preventing load of phishyb.c into memory in situations where push/pull isn’t possible.
- Fixed a bug where disengaging a currently held object would allow you to phase through adjacent hardness
- Removed requirement of version checker - it's not required by push and pull anymore
Play:Play this D-Mod right now in your web browser! (More Info)
 
September 22nd, 2023
1.01
Score : 9.7 exceptional
pq_knight.gif
exdeathevn
Peasant He/Him New Zealand rumble
Don't look at me, I'm a ghost 
Push & Pull's overall design is a complete overhaul of the original object pushing system, allowing for precise movement in multiple directions.
This can be used for complex puzzle systems with less clunky "void push" code when applied correctly, and it's uses are explained both within the Dmod and the commented script files.

Examples provided within the showcase Dmod include moving an object through a fence maze, re-positioning bombs next to rocks, and even a playground area where you can rearrange objects in a map screen within the game itself, instead of the editor.

Overall, an extremely powerful tool for setting up your own puzzles in a large variety of ways. Strongly recommended!