Got these errors.. dont have a clue.

dale_coop

Moderator
Staff member
I'd suggest to watch all the tutorial videos... (maybe on the older ones too) For Monster AI... action steps...
BAsically, just set the "Solid Obkect Reaction" and "Edge Solid Rection" to "Reverse direction".
Then for acction step 0 (the first action executer when your Monster spawns) set move up (or Move UD if move Up only doesn't exists), then for "End of Timer" set it "Advance" (also, set the Timer to a value for that action... I'd suggest 8). Then for the Action Step 1 set the action to "Shoot straight"... then for "End of Timer" set it "GoToFirst" (with a Timer value of "1" for example)...
Voilà, your monster is set to move Up/down... and after some seconds he will shoot then start again. And if he collides a solid element or the edge, he'll walk to the opposite direction.
You can adjust the "Timer" value to slight modify the delay between cycles.


About your score HUD... I think it's might be the Collectable_JustForScore.asm script? Check the "Tile Collision ??" element in the "Project Settings > Script Settings" where "??" should be the type of your carrot tile (if the carrot is, for example "03 collectable", then you need to check the "Tile Collision 03" element)
 

axbakk

Member
Yeah. Thats what ive done. But just up down does not exist. Its an up down random and the monster can change direktion even When in air. But Will test timer etc tonight and see if i can make it better. Is there anyway to sort out the random part of the up/down script maybe.

Will also check the script for the hud. Maybe something is wrong there.
Update tonight When trying. 😊
 

dale_coop

Moderator
Staff member
You could make a new script "Movement_UP.asm" in your "ModuleScripts\AiScripts" folder with :

Code:
;;;; Moving UP

	; LDA #%00000000 ;; down
	LDA #%00000100 ;; up
    TAY
    LDA DirectionMovementTable,y
    STA temp
    TYA ;; the 0-7 value for direction
    ORA temp
    STA Object_movement,x

And assign that script to a unused "AI Action" in Proejct Settings > Script Settings... (or instead of UP/Down if you don't need that one)
 

axbakk

Member
This is my collectable_justforscore.asm

I do not know if anything is wrong here.. 🤔
 

Attachments

  • A9E242EB-B4BE-4A11-B4AF-5C652CD755D8.jpeg
    A9E242EB-B4BE-4A11-B4AF-5C652CD755D8.jpeg
    276 KB · Views: 646
  • 81CA398A-0E0C-42BF-A927-93D752501D9F.jpeg
    81CA398A-0E0C-42BF-A927-93D752501D9F.jpeg
    363.1 KB · Views: 646

dale_coop

Moderator
Staff member
Do you have the same problem on any screen? youshould try on the screen next to the one you tested (just before or just after)... the results could be different.
 

axbakk

Member
dale_coop said:
Do you have the same problem on any screen? youshould try on the screen next to the one you tested (just before or just after)... the results could be different.

its the same all trough the the game. all screens. the hud update the score (like the lives) after you died.. :roll:
 

dale_coop

Moderator
Staff member
Ok let's start from the beginning, we might have missed something here...
So you want to increase your score when? When you collect a carrot? When you kill a monster?

If when collecting carrot, what is you carrot tile type ("3 collectable for score")? If when killing monster, how do you kill monsters (jumping on them, with a projectile, with a sprite based melee, with an melee object... )?
 

axbakk

Member
Ok.
Yes. I want to increase my score When i collect a ”carrot” like in the tutorial. I have made an assett block that is in collect score like in the tutorial. It collects the carrot in game and another background i placed at the spot. But No score to hud until i die and start over the level.

Yes. Get score When killing an enemy. I use projectile to kill enemies and the same there.. No score until i die and the level restarts.

😊
 

dale_coop

Moderator
Staff member
Could you share the script that is assigned to your "Tile collision 03" (...I think it's that one? "3 collectable score" you are using for the carrot)...
It might not be correct...
 

axbakk

Member
Code:
;;blank
    CPX player1_object
    BEQ isPlayerForCollectableScore
    JMP ++
isPlayerForCollectableScore:
    LDA tileCollisionFlag
    BEQ +
    JMP ++
+
    LDA #$01
    STA tileCollisionFlag
    ChangeTileAtCollision #$00, #$24
    
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    TXA
    STA tempx   
    AddValue #$08, myScore, #$05, #$02
    ;;; we also need to set up the routine to update the HUD
    ;; for this to work right, health must be a "blank-then-draw" type element.
    ;STA hudElementTilesToLoad
    ;   LDA #$00
    ;   STA hudElementTilesMax
        ; LDA DrawHudBytes
        ; ora #HUD_myScore
        ; STA DrawHudBytes
    UpdateHud HUD_myScore
    LDX tempx
    
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


++
 

dale_coop

Moderator
Staff member
This one looks correct too.
The carrot NEVER updates your score when you collect one ? Have you tried with only one on a screen, for example ?
Need to determine where .when, .. the issue is.
 

axbakk

Member
In game the carrot never updates the hud score (not killing an enemy too) but When i die and the level starts over the hud is updated with all score i collected last life. When my 3 lives is gone and i hit ”game over” my hud reset back to 0.
Have not tried just one object on a screen. Can try later and update here.

Feels like the problem is in det hud settings somewere but im not so in to the program yet so i can have wrong.
I have followed the tutorial of scrolling platformer When i wanted to make this work. Maybe i have missed something but i dont think so. 🤔
 

dale_coop

Moderator
Staff member
Hmmm ... Maybe you made a (incorrect) modification in on of the scripts that manage the HUD data ....?
 

dale_coop

Moderator
Staff member
Could you share your NESmaker folder zipped (via send.firefox.com or google drive or dropbox, ...)? I 'd take a look and tell you how to fix your issue...
 
Top Bottom