A bunch of questions i have about nesm

rimoJO

Member
ok so i know this is just getting annoying but i do not know asm at all so yeah

1- npc dialogue trigger auto tile? i tried that one script from that one post but it only works on the edge of the screen and triggers the npc text box while the player moves to the next screen.
2- shops- i don't really understand the whole shop thing in nesm. once, i tried the npc end of text action, but it didn't work. Instead of... something happening, it just says "555555555555555555555555...5" and so on. also, couldn't there just be a whole special screen for shops, like in a lot of games? That'd be good. again, i know nothing about asm, so... any help would be great.
3- how to aim attacks upward with inputs like up+b in a platformer? i feel like it's pretty simple, but i have no idea how to do it...
4- hud. the hpm (hitpoint meter) only appears when the protagonist/player takes damage. the only way i know that this could be fixed... would be if the owners of this website took out the whole overposted word thing.
5- jumping- in the game i'm making, you can either: 1- jump and not move in midair, and 2- move, then jump, and not be able to turn around. gravity lo and hi are 50 and 0, and jump lo and hi are 150 and 5, the standard. in other games with 50 0 150 5, jumping is completely normal...
6- the hud doesn't appear on 1 out of 2 screens. definitely my biggest problem next to jumping.
yeah that i guess
and also if you are interested in checking out my new game i'm making then please refer to my signature for a link
have a nice day
 

dale_coop

Moderator
Staff member
About all that...
1 - remove your script... and try again from scratch (read until the last page the topic about autotext tiles).
2 - Shop doesn't work. It's not implemented yet. Don't use that action text, it will just glitch your game.
3 - I bet you would have to fix projectiles ignore gravity (http://nesmakers.com/viewtopic.php?f=35&t=1939) then modify the shooting script to check if is pressed at the same time... and change the direction of the object created.
Make a specific topic for that demand.
4 - check your myHealth HUD variable "initial value". Is it correct (same than your player object details)?
5 - jump is not easy to manage... make a script for that, with details of the behavior you want. (normal settings should work fine, at least)
6 - You hud on 1 of 2 screens is simple: set your sprite 0 settings in HUD & Boxes (cf the video about "sprite zero" on the official site).
 

rimoJO

Member
thanks!
more info.:
1- okay i'll try that
2- oh. rip
3- well it's more like how do you look upwards in a platformer but thanks
4- player hp is 5, initial value is 5, and max value is 5. is there also any way for a hud asset to be adjusted upon gaining hp?
5- welp. time to go learn asm. :|
6- well that was easy. EDIT: wait no sprite zero detection ruined everything???
EDIT EDIT: wait a minute if there's no shops then what's the mymoney variable for
 

WillElm

New member
rimoJO said:
5- jumping- in the game i'm making, you can either: 1- jump and not move in midair, and 2- move, then jump, and not be able to turn around. gravity lo and hi are 50 and 0, and jump lo and hi are 150 and 5, the standard. in other games with 50 0 150 5, jumping is completely normal...

What kind of movement do you want in your game? Whatever problems you are having with your jump behavior, i bet the key lies in your move left and right scripts. there's probably a

LDA Object_physics_byte,x
AND #%00000001 ;; is it on the ground?

somewhere that needs to be moved or just inserted. Right now, I bet the code just jumps to the end if you're not on the ground.
 

rimoJO

Member
i just want the default jumping actions. when you jump without moving, you can move mid jump. when you're in mid jump after jumping after moving, you can turn around. that's pretty much it. Start Moving Player Right:
Code:
 ;;;;; START MOVING PLAYER RIGHT:
 ;;;;; We will use this when the right button is pressed.
 ;;;;; If we are already showing the walking animation, which is for this module
 ;;;;; action step 1, we will skip changing to the walking state.
    LDX player1_object
    GetCurrentActionType player1_object
    CMP #$02 ;; if the state is invincible
    BEQ ++ ; skip movement if attacking
    CMP #$03
    BEQ ++ ;skip if we are casting spell
    CMP #$01
    BEQ + ;; if the action type already equals 1, jump forward
    ChangeObjectState #$01, #$04
+
;;;;;; Then, we will begin moving.
    StartMoving player1_object, MOVE_RIGHT
;;;;;; Lastly, we will change the facing direction.
    FaceDirection player1_object, FACE_RIGHT
++
    RTS
and
Code:
; a jumps
 
   LDX player1_object
   ;;; let's check for if we are standing on a jumpthrough platform,
   ;;; for which "down and jump" will jump downwards through
   ;;; comment this out if you do not want that functionality
    LDA screenFlags
    AND #%00100000 ;; does it use gravity?
    BEQ dontJump
    
   LDA Object_physics_byte,x
   AND #%00001000
   BEQ notStandingOnJumpThroughPlatform
   LDA gamepad
   AND #%00100000
   BEQ notStandingOnJumpThroughPlatform
   LDA Object_y_hi,x
   CLC
   ADC #$09
   STA Object_y_hi,x
   JMP dontJump
notStandingOnJumpThroughPlatform:
   
   LDA Object_physics_byte,x
   AND #%00000001
   BNE canJump
   LDA Object_physics_byte,x
   AND #%00000100
   BEQ dontJump
    
canJump:
    ;;; TURN OFF "STANDING ON JUMPTHROUGH PLATFORM" if it is on
    LDA Object_physics_byte,x
    AND #%11110111
    STA Object_physics_byte,x
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    LDA #$00
    SEC
    SBC #JUMP_SPEED_LO
    STA Object_v_speed_lo,x
    LDA #$00
    SEC
    SBC #JUMP_SPEED_HI
    STA Object_v_speed_hi,x
    GetCurrentActionType player1_object
    CMP #$03 ;; attack
    BEQ +
    ChangeObjectState #$02, #$04
   +
   PlaySound #sfx_shoot
dontJump:
    RTS
 

WillElm

New member
Try commenting out these lines in your move code:

Code:
    CMP #$02 ;; if the state is invincible
    BEQ ++ ; skip movement if attacking

I think what is happening is that when you jump, you are changing your action state to #$02, and your movement script branches to the end if your player is in action state 2.
 

WillElm

New member
Awesome, I'm glad it worked. Regarding asm, I strongly recommend trying to really understand how your move code is working. I'm new also and didn't understand it at all, but I've spent a ton of time looking at movement code and I think it's a good introduction and the macros make it so you can more easily write your own without having to have a much deeper understanding. That part you commented out:

Code:
    LDX player1_object
    GetCurrentActionType player1_object
    CMP #$02 ;; if the state is invincible
    BEQ ++ ; skip movement if attacking

It says: look at the player's action state (GetCurrentActionType player1_object), compare it (CMP) to #$02. If the number found through GetCurrentActionType is equal to the number specified by that comparison, then branch (BEQ) to ++, which is the end of your code.

In other words, if you are jumping, you can't move, because your jump code changes your action state to 2.
 

rimoJO

Member
ohhhh ok. i get it. thank you for this knowledge!

a few more questions:
1- Can a HUD asset be changed when something happens? I have a HUD asset which is a tile of decoration, then a health meter, then another block. When your health increases, you can't even tell because there's a block in the way. So, when your health increases, is there any way that the hud asset could become 1 pixel wider and the 2nd deco tile be shifted over by one tile? probably not, but oh well.
2- if shops don't exist then what's mymoney for?
3- how does the item thing work? how can you make extra items and assign them to an item and then make an item menu to select the item? any way to do that? if not, then what's the give item end of text action for?
 

WillElm

New member
rimoJO said:
two more questions:
1- Can a HUD asset be changed when something happens? I have a HUD asset which is a tile of decoration, then a health meter, then another block. When your health increases, you can't even tell because there's a block in the way. So, when your health increases, is there any way that the hud asset could become 1 pixel wider and the 2nd deco tile be shifted over by one tile? probably not, but oh well.
2- if shops don't exist then what's mymoney for?

1. Absolutely. I'm using var tiles (hearts) as my health HUD element. Maybe you could replace the hearts with bar segments. Anytime you update a HUD variable, you still have to put code in for the HUD update. If you don't, your variable will go up but it won't be reflected in the HUD. Whatever player hurt script you are using probably already has that though.

2. I guess it's a feature he's gonna put in at some point? You could still use it. Make it so every so many coins you get a life, or make you own store. One easier way to do this without trying to make a menu system would be to make it so you can only pick up a powerup object or tile if you have so many coins.
 

rimoJO

Member
1- There's a deco tile, then a health bar, (NOT hearts) then another deco tile. When the health bar increases, the 2nd deco block doesn't shift 1 tile over, but instead blocks the new health bar segment.
3- what's it for?
 

WillElm

New member
ah okay I see what you want now. I don't how to to do that. I'd just simplify it by getting rid of the second decorative tile or by just letting it be static.

the myMoney HUD variable is just a variable. You can do whatever you want with it. Such as making a script that increases it when you pick up a coin object or something.
 

rimoJO

Member
Well, what i meant by 3 was:
3- how does the item thing work? how do you make a complete item that does what an item does then assign it to an item then make a special item screen and be able to select the item, or do the select button thing from super metroid and be able to use the item? how do you even make the item? if that's not possible then what's the item EoTA for? Also how to make extra magic attacks
 

rimoJO

Member
And some screenshots regarding the HPM (hitpoint meter) in this order: BF upgrade w/h 1 hit, AF upgrade w/h no hits, AF upgrade w/h 1 hit, AF upgrade w/h 2 hits:
 

Attachments

  • HPM after upgrade with 2 hits.PNG
    HPM after upgrade with 2 hits.PNG
    9.7 KB · Views: 1,303
  • HPM after upgrade with one hit.PNG
    HPM after upgrade with one hit.PNG
    9.7 KB · Views: 1,303
  • HPM after upgrade with no hits.PNG
    HPM after upgrade with no hits.PNG
    9.7 KB · Views: 1,303
  • HPM before upgrade after 1 hit.PNG
    HPM before upgrade after 1 hit.PNG
    11 KB · Views: 1,303

rimoJO

Member
And also, just stating it again, how do you add extra magic attacks to the game? I'm thinking lots of projectiles, and you can swap each one in a super metroid-y way with the Select button. Is that possible, or is it like the shops?
 

WillElm

New member
Yes, this is possible. You make a variable, then make it so the select button selects the variable. then you make a magic attack script that pays attention to the variable.

There's a thread about it that's pretty clear: http://nesmakers.com/viewtopic.php?f=3&t=936&p=5916&hilit=special+ability#p5916

I'm using it but I've changed the whole setup pretty dramatically. You would probably want to get rid of all the stuff that checks for a direction being pressed.

If you haven't figured out how to actually make the second projectile yet, just search the forums, I feel like there are multiple threads on it. I made one not long ago. It's for monsters but the same principle applies. You can basically just copy your currently existing projectile script but change all the labels and make it call on a new constant, that you will of course have to make and set to the proper value, then go into that object and get the settings you want.

http://nesmakers.com/viewtopic.php?f=60&t=2473&p=15305#p15305
 

rimoJO

Member
K. 3- I'm thinking that just making a whole lot of game objects would work. Anyways thanks!




Also if you're reading this last line then I highly recommend checking out my game's WIP page (on signature)
 

rimoJO

Member
When I use my Melee attack, the projectile is spawned and goes toward the lower left-hand side of the screen. I don't even know how to explain it...
 

dale_coop

Moderator
Staff member
On your projectile object action step 0 (and other ones, too), don't set the "use Aimed Physics" (it's a special flag used for monster's "shoot at player" action). Then your projectiles won't fall down to bottom left anymore.
 

rimoJO

Member
Thank you!
The projectile still passes through everything: literally every single solid object, monsters, the side of the screen, everything. Any fixes for that?
EDIT: And also, the Melee input spawns the projectile at a specific location. The constant OBJ...MELEE is set to "2".
 
Top Bottom