Creating a sign

User avatar
grhmhome
Posts: 12
Joined: Sat Nov 03, 2018 10:40 am

Creating a sign

Post by grhmhome » Mon Nov 05, 2018 7:45 pm

Hello, I've gave the platformer tutorial a try and was able to make a simple platformer. I was inspired and I plan to make a wild west platformer, where you save a town. Anyway, I created a sign, by creating a monster that acts like a npc, but I'm having a problem with that. The sign moves to the left, even if I don't have it set to move to the left or right. I want the object to remain stationary. Is there a way to make a monster stationary that acts like a stationary npc like on the Adventure tutorial or would I be better off making a new sign object type? If so, how would I make a new object type that displays a text box like a npc?

Thanks for your time.


Here is a screenshot of what I'm trying to accomplish. The sign is supposed to be stationary next to the fence post.
signtest.png
signtest.png (2.23 KiB) Viewed 200 times
User avatar
cargo
Posts: 54
Joined: Mon Sep 03, 2018 4:34 am

Re: Creating a sign

Post by cargo » Mon Nov 05, 2018 7:52 pm

Have you tried setting "Null" value on the "Action" drop down list found in the "Actions" tab of the window that shows up when you press "Object Details"?
You can also set "Normal Max Speed" (the fastest the monster can move) and "Acceleration Speed" (how fast it reaches Max Speed) to zero at the "Details" tab.
User avatar
grhmhome
Posts: 12
Joined: Sat Nov 03, 2018 10:40 am

Re: Creating a sign

Post by grhmhome » Mon Nov 05, 2018 8:00 pm

Thanks for the quick reply. Yes. I've set the object flag to NPC. The action drop down is set to '0 - null'. I also tried setting it to '5 - stop movement', but the sign still moves to the left. The speed and acceleration speed are both set to 0.
User avatar
dale_coop
Posts: 1465
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Creating a sign

Post by dale_coop » Mon Nov 05, 2018 9:04 pm

I suspect you checked "Ignore main physics" for your monster or another flag maybe....?
So I suggest to keep everything by default in the Action Steps tab. Just set "NPC" and a bounding box, that's all.
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
User avatar
grhmhome
Posts: 12
Joined: Sat Nov 03, 2018 10:40 am

Re: Creating a sign

Post by grhmhome » Mon Nov 05, 2018 9:11 pm

dale_coop wrote:
Mon Nov 05, 2018 9:04 pm
I suspect you checked "Ignore main physics" for your monster or another flag maybe....?
So I suggest to keep everything by default in the Action Steps tab. Just set "NPC" and a bounding box, that's all.
I tried different things with no avail. I scrapped the monster and went with making a npc tile object. That seems to work, but now I'm having another problem. I'm trying to change the input from 'b' to 'up', when triggering a npc tile, since 'b' is already mapped to run. Cargo is helping me figure out some of some of the assembly, but I don't know what I could be missing.

This is what I have as my NPCtile assembly script.

Code: Select all

;;; NPC TILE
	LDA Object_movement
	ORA #%00000100
	BEQ +
	LDA #$00
	STA Object_movement
	LDA textBoxFlag
	BNE +
	LDA #$00
	STA stringTemp
	LDA #$01
	STA textBoxFlag
+:
The issue now is that if I bump a npc tile (the sign object) it will loop the textbox.
User avatar
dale_coop
Posts: 1465
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Creating a sign

Post by dale_coop » Mon Nov 05, 2018 10:09 pm

The original code for NPC tile (pressing B to activate it) is:

Code: Select all

;;; NPC TILE
	LDA gamepad
	AND #%00000010  ;<<-- here we want to check if "B" is pressed
	BEQ +
	LDA textBoxFlag
	BNE +
	LDA #$00
	STA stringTemp
	LDA #$01
	STA textBoxFlag
+:
So (I suppose), to test if "Up" is pressed, you should:

Code: Select all

;;; NPC TILE
	LDA gamepad
	AND #%00010000  ;<<-- here we want to check if "Up" is pressed
	BEQ +
	LDA textBoxFlag
	BNE +
	LDA #$00
	STA stringTemp
	LDA #$01
	STA textBoxFlag
+:
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
User avatar
grhmhome
Posts: 12
Joined: Sat Nov 03, 2018 10:40 am

Re: Creating a sign

Post by grhmhome » Mon Nov 05, 2018 10:30 pm

That was it. Thanks. Problem solved.
User avatar
dale_coop
Posts: 1465
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Creating a sign

Post by dale_coop » Mon Nov 05, 2018 10:31 pm

Glad it worked :)
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
User avatar
cargo
Posts: 54
Joined: Mon Sep 03, 2018 4:34 am

Re: Creating a sign

Post by cargo » Mon Nov 05, 2018 10:35 pm

Hey Dale what are the arbitrary values for all possible button presses?
I've seen some comments inside the assembly files but it's not as clear as one would think (there are other things in there that are being checked for direction).
User avatar
dale_coop
Posts: 1465
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Creating a sign

Post by dale_coop » Mon Nov 05, 2018 10:50 pm

LDA gamepad
Then you need to compare with those values:
#%10010000 ;; check if upright is pressed
#%10100000 ;;check if downright is pressed
#%01010000 ;;check if upleft is pressed
#%01100000 ;;check if downleft is pressed

#%00010000 ;; check if up is pressed
#%00100000 ;;check if down is pressed
#%01000000 ;;check if left is pressed
#%10000000 ;;check if right is pressed

#%00000010 ;;check if B is pressed

The last others bites might be for A, select and Start...
(I think #$00000001 for if A is pressed)
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
Post Reply