small start screen bug (SOLVED)

drexegar

Member
IF you hold down left of right while starting a game from the start screen this will stop the player from loading when the game starts.

Holding up, down, A or B doesn't do this.

I'm using the starting script from adventure folder, there isn't one in the platform folder.


doesn't matter which button you program to press i tested with start or A
 

dale_coop

Moderator
Staff member
I can't reproduce the problem.
Have you made any modification in the scripts?
Are you sure your Input Editor is correct?
 

drexegar

Member
That might be it. I dont know the relation to the button codes still working in the title screen or just having a button script running while I hold down on a button, all I did was put a check if a variable matches than allow the button press to work.
 

dale_coop

Moderator
Staff member
How is your "Input Editor"? check if you didn't assigned a script to the "StartScreen" except the "StartGame.asm" script.
 

drexegar

Member
dale_coop said:
How is your "Input Editor"? check if you didn't assigned a script to the "StartScreen" except the "StartGame.asm" script.

You know the problem happens in the game itself, if im holding the button when I start left or right, this just causes the player not to load. All I added was check variable to the code.

So its the input scripts Ive added. dude being the custom variable and 2 being the number to allow the controls to work. I just don't know why it would be whacked out if I hold them before a screen loads after the start screen.

LDA dude
CMP #02
BNE

StartMoving player1_object, MOVE_RIGHT
LDA Object_movement,x
ORA #%00000010
STA Object_movement,x

RTS

Doing this with the A button dosen't have that problem though, ill mess round with it.
 

drexegar

Member
Yep its my script so if I hold down a button and let the input check a variable before the screen even loads, the character wont load so i'm going to have to find another way to check the variable somewhere else.
 

dale_coop

Moderator
Staff member
Ok
Maybe I can help you...
What is the purpose of dude?
What du you want to do? Or not do?
 

drexegar

Member
dale_coop said:
Ok
Maybe I can help you...
What is the purpose of dude?
What du you want to do? Or not do?

I use dude as a variable and use the code in input scripts to disable controls, the input checks if dude is 2 and if its not, skip the controls, it works with a tile I made that changes dude from 0 to 2. I was going to also use dude variable to switch animation frames too, but that will be in the animation input script and not the movement script.

So if I hold the button down before a game starts with the check variable code in it, thats what keeps the player from loading somehow.

This only happen during the title and only so far, if I die it wont happen if I leave my finger on it.
 

dale_coop

Moderator
Staff member
Ok, I understand...
You should write your scripts like this:
Code:
	LDA Dude
	CMP #02
	BEQ endMovingPlayerRight	;; if IS equal to "2" then go to end of this script, labeled "endMovingPlayerRight"
	;; else, means if NOT equal to "2", continue the script as normal:
	
	StartMoving player1_object, MOVE_RIGHT
	LDA Object_movement,x
	ORA #%00000010
	STA Object_movement,x

endMovingPlayerRight: 
	RTS

Don't forget to add labels, and then you can use BEQ or BNE to that labels ;)
 

drexegar

Member
dale_coop said:
Ok, I understand...
You should write your scripts like this:
Code:
	LDA Dude
	CMP #02
	BEQ endMovingPlayerRight	;; if IS equal to "2" then go to end of this script, labeled "endMovingPlayerRight"
	;; else, means if NOT equal to "2", continue the script as normal:
	
	StartMoving player1_object, MOVE_RIGHT
	LDA Object_movement,x
	ORA #%00000010
	STA Object_movement,x

endMovingPlayerRight: 
	RTS

Don't forget to add labels, and then you can use BEQ or BNE to that labels ;)

Thanks i will try it later but I only was allowed to add a label to only one of the actions, if I add the label again in another input script I get a label already defined error. So I have to take the label away and it works, I'm assuming all the input scripts go into one script when export right?

Also I totally was not paying attention to Return to Subroutine thanks dude!
 

dale_coop

Moderator
Staff member
Of course, dont use the same label.
I used "endMovingPlayerRight" because it's your movingRight script.
But in other scripts, just change the label, each time, for example:
"endMovingPlayerLeft"
"endCreatingProjectile"
"endJumping"
"youCanWriteAnyLabelNameYouWant"
 

drexegar

Member
dale_coop said:
Of course, dont use the same label.
I used "endMovingPlayerRight" because it's your movingRight script.
But in other scripts, just change the label, each time, for example:
"endMovingPlayerLeft"
"endCreatingProjectile"
"endJumping"
"youCanWriteAnyLabelNameYouWant"

Thanks I did some testing and using separate labels is what made the bug go away!

I also swtich to BEQ and that didnt work, BNE made more sense? Branch not Equal?

Thank you! you have got a me a step closer to different sprites and cut scenes, I just hope we can get the music working again soon!
 

dale_coop

Moderator
Staff member
You’re welcome ;)
About cutscenes, did you see that topic: http://nesmakers.com/viewtopic.php?f=3&t=597
 

drexegar

Member
dale_coop said:
You’re welcome ;)
About cutscenes, did you see that topic: http://nesmakers.com/viewtopic.php?f=3&t=597

Yes I seen that before its awesome it reminds me of max payne with his dark storytelling. Even on the gba with still shots the max payne feeling was still there (but they did kept his dialouge)

I afraid I running out of code (and avoiding heavy custom coding) so I'm taking advantage of forcing the character to not be visible and use either an item enemy or a jump function (havent tried it yet) to get him to the next screen. This will also allow me if I can later to gameplay into cutscenes.

I plan to use up some monster and background banks for cutscenes.

But for right now i working on some graphics for the cutscene.
 

chronosv2

New member
You can make labels unique by putting a + or - before them and their reference in JMP commands. I think you're intended to put a + for a jump forward and a - for a jump backward, though I don't think that's enforced so user preference?
As an example...

From my Long HUD scripts:
Code:
	;Accumulator already had the number I was working with
	STY tempy
	TAY
	SEC
	SBC #$08 		;Let's see if HP > 8.
	BMI +GaugeLow 	;If Minus set we have <8 HP so jump forward
	;Code here if we have >= 8HP
	JMP ++

	+GaugeLow:
	TYA
	STA var1
	;Snipped for brevity
	
	++:
		LDA var1
		STA hudElementTilesToLoad
		;Snipped for brevity

The ASM6 assembler can turn the ++ and +GaugeLow into jumps that don't duplicate labels. Not that I think anyone will NEED GaugeLow, but you never know...
 

drexegar

Member
chronosv2 said:
You can make labels unique by putting a + or - before them and their reference in JMP commands. I think you're intended to put a + for a jump forward and a - for a jump backward, though I don't think that's enforced so user preference?
As an example...

Crap thats a lot for me to take in but I will study it little by little thank you for the reference!
 

chronosv2

New member
I'd suggest using uniquely named labels in most cases. Helps you keep your code straight.
+ and - work well if you're writing macros or subroutines you jump back from, though.
 

drexegar

Member
chronosv2 said:
I'd suggest using uniquely named labels in most cases. Helps you keep your code straight.
+ and - work well if you're writing macros or subroutines you jump back from, though.

i see now thats awesome! thanks for the tips!
 
Top Bottom