How To Make Slow Tiles and Slow Tile Script Included

User avatar
TolerantX
Posts: 108
Joined: Fri Jan 18, 2019 7:58 am

How To Make Slow Tiles and Slow Tile Script Included

Post by TolerantX » Fri Oct 16, 2020 10:40 am

Greetings and salutations!
This tutorial will show you how to make a slow tile script and some physics edits for the ADVENTURE module, and "possibly" others.

INCLUDED: SLOW_TILE_ADVENTURE.ASM - 5 LINES OF CODE
doHandlePhysics_Adventure_Ex - MINOR EDITS TO ADVENTURE PHYSICS

THE SCRIPT EDITS WILL ALSO BE SHOWN IN THE VIDEO.

I am using doHandlePhysics_AdventureBase.asm (from the MOD_Adventure/Subroutines folder)
IF YOU EDIT YOUR SCRIPTS ALWAYS BACK UP SCRIPTS BEFORE EDITING.
(OTHER FEATURES, SUCH AS THE SLOW TILE BEING DESTROYABLE WILL BE IN FUTURE TUTORIALS.)
MAKE SURE TO SAVE ALL CHANGES

1. GO TO PROJECT SETTINGS > SCRIPT SETTINGS
ADD A NEW VARIABLE NAME IT slowTile SET IT'S VALUE AS ZERO 0

2. The following is my script for the slow tile. (if you don't want to copy it, you can download it)

Code: Select all

;;;;; TILE COLLISION FOR SLOWING PLAYER SPEED ;;;;;

	CPX player1_object
	BNE notPlayer
		LDA #$01
		STA slowTile
notPlayer:
Slow_Tile_Adventure.zip
Slow_Tile_Adventure.asm included
(297 Bytes) Downloaded 1 time
3. Go to Project Settings > Script Settings and add the tile to a collision for a tile (example: I use 10 or 11 usually)


4. Next you open your folder NESmaker is in...
Go to: GameEngineData > Routines > BASE_4_5 > Game > MOD_AdventureBase > Subroutines > copy the doHandlePhysics_AdventureBase.asm


5. After copying the physics script, look for the following line:
line 284 +notHurt (UNDER THAT LINE YOU CAN BEGIN EDITING)
make a few blank lines of code as a buffer then add this at line 285:

Code: Select all

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; I ADD A CHECK FOR A VARIABLE A SLOW TILE INCREASES ;;;

	CPX player1_object
	BEQ isPlayer
		JMP +doNormalPhysics

isPlayer:
		
		LDA slowTile
		CMP #$01
		BNE +doNormalPhysics
			LDY Object_type,x
			LDA ObjectMaxSpeed,y
			ASL
			ASL
			ASL
			ASL
			ASL	  
			ASL
			ASL
			STA myMaxSpeed
			LDA ObjectMaxSpeed,y
			LSR
			LSR
			LSR
			LSR
			LSR
			LSR
			LSR
			STA myMaxSpeed+1
			;;; now high max speed byte is the actual high byte of speed
			;;; low max speed byte is the low byte of speed
			LDA #$00
			STA myAcc+1
			LDA ObjectAccAmount,y
			STA myAcc
			JMP +endDoNormal

+doNormalPhysics

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
As part of this script edit also on line 349 it should say "STA myAcc" then slightly lower it says: ;; ReturnBank ;;
ABOVE the line that says RETURN BANK add the following:

Code: Select all

+endDoNormal	;; SLOWTILE REQUIRES THIS ;; ALSO SEE END OF SCRIPT ;;
	
;;;;;;;;;;;;;;;;;;   
Now for the final Physics Script edit...
At the bottom of the script the line after skip physics: ADD THE FOLLOWING

Code: Select all

	LDA #$00				;; SLOWTILE REQUIRES THIS ;;
	STA slowTile
doHandlePhysics_Adventure_Ex.zip
doHandlePhysics_Adventure_Ex.asm included
(3.82 KiB) Downloaded 2 times
6. Go to Project Setting>Script settings look for subroutines. Find Handle physics. change it for your new physics code by going to MOD_AdventureBase\Subroutines\dohandelPhysics_AdventureBase_Ex



THAT'S IT!

Explanation: You make a tile that calls upon a variable that when colliding with the tile sets the variable to 1.
The variable now at 1 "flips the switch" on the physics script edit and tells it to slow the player down...
The end of the physics turns the variable "switch" back to off
You can change the speed the player is slowed by editing ASL and LSR lines adding more or less as you see fit.
Have fun and stay safe!

VIDEO TUTORIAL BELOW

Last edited by TolerantX on Sun Oct 18, 2020 1:10 am, edited 2 times in total.
User avatar
Logana
Posts: 419
Joined: Mon Nov 18, 2019 10:14 pm

Re: How To Make Slow Tiles and Slow Tile Script Included

Post by Logana » Fri Oct 16, 2020 8:01 pm

um i did this and it did absolutly nothing idk imma do some messing around in the thing but it had no effect wether i was on or off the tile
I’m currently working on platycat viewtopic.php?f=52&t=5848
A fun platform game also Monster Slayer witch is the bigger prodject viewtopic.php?f=52&t=6010
User avatar
Logana
Posts: 419
Joined: Mon Nov 18, 2019 10:14 pm

Re: How To Make Slow Tiles and Slow Tile Script Included

Post by Logana » Sat Oct 17, 2020 9:36 am

Could you possibly show some examples of it working ? As well
I’m currently working on platycat viewtopic.php?f=52&t=5848
A fun platform game also Monster Slayer witch is the bigger prodject viewtopic.php?f=52&t=6010
User avatar
TolerantX
Posts: 108
Joined: Fri Jan 18, 2019 7:58 am

Re: How To Make Slow Tiles and Slow Tile Script Included

Post by TolerantX » Sat Oct 17, 2020 7:56 pm

Logana wrote:
Sat Oct 17, 2020 9:36 am
Could you possibly show some examples of it working ? As well
Did you both follow the tutorial every specific thing in it and watch the video? The video shows an example of it working. Maybe a better way would be for you to show me possibly a video of you doing this process and it not working. Honestly I'm surprised it's doing nothing at all differently. You used the adventure module and before you edited everything you backed up the defaults?
User avatar
Logana
Posts: 419
Joined: Mon Nov 18, 2019 10:14 pm

Re: How To Make Slow Tiles and Slow Tile Script Included

Post by Logana » Sat Oct 17, 2020 9:41 pm

I can show you everything I’m currently at a friends house, imma take a look at the video again so if I missed anything
I’m currently working on platycat viewtopic.php?f=52&t=5848
A fun platform game also Monster Slayer witch is the bigger prodject viewtopic.php?f=52&t=6010
User avatar
Logana
Posts: 419
Joined: Mon Nov 18, 2019 10:14 pm

Re: How To Make Slow Tiles and Slow Tile Script Included

Post by Logana » Sat Oct 17, 2020 10:05 pm

I’m currently working on platycat viewtopic.php?f=52&t=5848
A fun platform game also Monster Slayer witch is the bigger prodject viewtopic.php?f=52&t=6010
User avatar
Logana
Posts: 419
Joined: Mon Nov 18, 2019 10:14 pm

Re: How To Make Slow Tiles and Slow Tile Script Included

Post by Logana » Sat Oct 17, 2020 10:07 pm

Could it be possible that it’s messing with the other variable I set up for palletcycles? Idk I’m really new to using the script settings
I’m currently working on platycat viewtopic.php?f=52&t=5848
A fun platform game also Monster Slayer witch is the bigger prodject viewtopic.php?f=52&t=6010
User avatar
TolerantX
Posts: 108
Joined: Fri Jan 18, 2019 7:58 am

Re: How To Make Slow Tiles and Slow Tile Script Included

Post by TolerantX » Sun Oct 18, 2020 1:09 am

Logana wrote:
Sat Oct 17, 2020 10:07 pm
Could it be possible that it’s messing with the other variable I set up for palletcycles? Idk I’m really new to using the script settings
It shouldn't be messing with anything else. did you make the physics script the physics script you edited?
User avatar
Logana
Posts: 419
Joined: Mon Nov 18, 2019 10:14 pm

Re: How To Make Slow Tiles and Slow Tile Script Included

Post by Logana » Sun Oct 18, 2020 2:26 am

No I used the one in the zip file
I’m currently working on platycat viewtopic.php?f=52&t=5848
A fun platform game also Monster Slayer witch is the bigger prodject viewtopic.php?f=52&t=6010
User avatar
TolerantX
Posts: 108
Joined: Fri Jan 18, 2019 7:58 am

Re: How To Make Slow Tiles and Slow Tile Script Included

Post by TolerantX » Mon Oct 19, 2020 2:06 am

Check this post out. This may help.

viewtopic.php?f=41&t=6164
Post Reply