4.1 Adventure Checkpoint

hey there guys and gals!
was wondering how i could move the code around in the base adventure module to allow me to use checkpoint tiles as well as how to re-implement npc tiles. My concept is a story driven adventure game with a free roam feel but i would like to have strategic chekpoints placed after major events such as boss battles, vital npc interaction, etc.
any help would be greatly appreciated and terms could be negotiated for monetary compensation for assistance thank you very much
 

dale_coop

Moderator
Staff member
For the 4.1 Adventure module...

1/ Add the CheckPoint tile type in your project... In the "Project Settings > Script Settings", select the "Tile Collision 09" (or any other unused tile type) and assign it the "setCheckpoint.asm" script from the "Routines\Basic\ModuleScripts\TileScripts\ScrollingPlatformer\" folder:

2019-01-25-11-14-59-Project-Settings.png



2/ Rename the label: In the "Project Settings > Project Labels", rename the unsused "Tile Types > 9 - NULL" to "9 - CheckPoint":

2019-01-25-11-15-28-Project-Settings.png



3/ Add a constant usd byt the script: In the "Project Settings > User Constants", clic on the "add" button and name it "TILE_CHECKPOINT_CLEARED" with a value of "0" (index of the tile you want your checkpoint to be replaced with).

2019-01-25-11-18-15-Project-Settings.png



4/ Now, create your asset, selecting the new checkpoint tile type :

2019-01-25-11-16-01.png



5/ We need to add the Lives (because in the adventure module, no life, the game reset when you die): in the "HUD & Boxes > User variables", rename the "UserVar_5" (or another unused var) to "myLives" with a initial value "3" (3 lives).

2019-01-25-11-21-43.png



6/ Add the script checking lives when player dies: in the "Project Settings > Script Settings", select the "Handle Lose Life" element and assign it the "PlayerLoseLife.asm" script from the "Routines\Basic\ModuleScripts\HurtWinLoseDeath\ScrollingPlatformer\" folder:

2019-01-25-11-20-45-Project-Settings.png



Voilà, I think the checkpoint should work.



PS: For NPC tiles, it's broken in the 4.1. Someone will have to dig into that and fix it. In the mean time, I suggest to use AutoTiles (cf somewhere on this forum) or NPC monster.
 

dale_coop

Moderator
Staff member
As I wrote, first line of this "tutorial"... it's for Adventure module.
I didn't test/try/adapt it for the simple platformer one (...yet). Sorry.
 
Dale Coming in strong with them good replies! you never disappoint boss and i thank you greatly.
ill attempt to implement here in the next few hours and let you know how she goes
 

dale_coop

Moderator
Staff member
You’re welcome adeventureman.
Romeo, for scrolling platformer checkpoint already implemented and working. Don’t know for the simple platformer...
Will check, will check... need to find time to do all that :p
 

dale_coop

Moderator
Staff member
Just finished to try the same tutorial with the simple platformer module.
The only difference I suggest is the use of the "tile collision 11" in step 1 and 2 (because the "Tile Collision 09" is used for One Way Platform!)
It works well (like other modules).
 

rimoJO

Member
I did, but I got an error saying "setCheckpoint.asm label already defined". It pointed out that the problem was in line 17. This is line 17:
Code:
dontDoCheckpoint:
. Do I comment it or something?
EDIT: Never mind, I got it to work by changing line three in setCheckpoint to
Code:
	;JMP dontDoCheckpoint
and line seventeen to
Code:
;dontDoCheckpoint:
.
 

dale_coop

Moderator
Staff member
If it’s saying that. It means you have already this script assigned somewhere.
Did you assign it to another “tile collision 0X”?
You have it assigned more than once.

Can you share screenshots of your Project Settings > Script Settings? (I need to see ALL the scripts assigned)
 

rimoJO

Member
I set it to the last collision thingy because I cared about Death and I wanted to assign it to an unused one. I'll remember that.
EDIT: And then the one after Death. There's two.
 

dale_coop

Moderator
Staff member
Yep, when you assign scripts to "Project Settings > Scripts Settings", be careful auto not assign a script more than once, else you will have errors on Export & Test ;)
 

rimoJO

Member
It works perfectly in the platform module for me!
Except for the fact that like the poster, I'm making a story-based game, so what if I don't want a life system?
 

dale_coop

Moderator
Staff member
You mean you will not loose lives. Try setting myLives to "0" (I think you will have almost unlimited lives)
 

rimoJO

Member
...almost?
also, the color doesn't change when i get the checkpoint. intended color (tile) is 14, constant is 14, should work.
EDIT: Hmm... I did everything step by step but the checkpoint isn't triggering. the sound plays, but I respawn at the start of the game.
 

dale_coop

Moderator
Staff member
About the color of your checkpoint, it will. It not change... only the graphics change.

About the respawn, could you share your PlayerLoseLife script?
 
Top Bottom