Creating a sign

grhmhome

New member
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
 

cargo

spam bots yandex
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.
 

grhmhome

New member
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.
 

dale_coop

Moderator
Staff member
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.
 

grhmhome

New member
dale_coop said:
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:
;;; 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.
 

dale_coop

Moderator
Staff member
The original code for NPC tile (pressing B to activate it) is:
Code:
;;; 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:
;;; 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
+:
 

cargo

spam bots yandex
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).
 

dale_coop

Moderator
Staff member
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)
 

cargo

spam bots yandex
Thank you dale.
dale_coop said:
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)
 
Top Bottom