how to write a script for a prize title in adventure mode?

So I watched the trigger tutorial and tried putting it to use more than one getting a bunch of, already defined, and out of range, errors and then I even got the code from one of the discorders and I still couldn't force it too work. If there is anyone else here that has a script guaranteed to work with my problem that would be great and while at it how to make my tile 9 less of a blank script.
 

Jonny

Well-known member
I've stripped this back so you can try to get just the tile change working first.

If you tell me which variable you want to change and by how much when the prize tile is collected, I can add that.

Code:
;;; WAIT UNTIL SCREEN HAS UPDATED ;;;;;;;;;;;;;;;;;;;;;;;;;;

    LDA updateScreenData
    AND #%00000100
    BEQ screenUpdated
    RTS
screenUpdated:

;;; CHECK IS PLAYER COLLIDING ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    CPX player1_object             
    BEQ isPlayer
    JMP notPlayer                   ;; DONT CHANGE TILE   ;;
isPlayer:

;;; TILE CHANGE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    ChangeTileAtCollision #$00, #$00
    RTS
    
notPlayer:

If you save this as a tile type and assign it to a free tile slot in script settings it should change that tile type to null and your first BG graphic when the player touches it.
Better to start with something simple and add what you need it to do.
 
I'm trying to learn which one can work with picking up characters and making them disappear so you can get on to the next stage the script that's used for coins.
 

Jonny

Well-known member
Do you mean an NPC object? That's different, this is just to change background tiles then maybe addvalue to something i.e score, health, money. keys.
 

mouse spirit

Well-known member
Meaning you want an NPC to collect the coins also,
or you want to collect NPCs?
What are you trying to achieve as an end goal in the situation?
This may help us help you.
 
sorry that was stupid but what I'm trying to do is like how you collect a coin you can collect an NPC to pick them up so they dissappear so you can go on to the next part of the game I'm trying to get a code on how to do that.
 

Jonny

Well-known member
Presuming the non playable character is an object and not a tile it would not be a tile script. You could destroy the NPC object then reinstate that object later though.
 
I've been trying to do that but I can't get it to time it right I've watched the videos on the triggers followed it's instructions but I could still not figure it out right and there are parts of the game where I don't want that character disappearing to kingdom come all the dang time. That was why I asked for help on it and the code for the tile script.
 
so for later this is where I have the problem with the little timer and action step flags I tried looking up how to use them, and I followed the instructions on like having the character do a certain action on this screen. But the problem is it doesn't really work and we're back to problem I described.
 

Attachments

  • problem.JPG
    problem.JPG
    55.8 KB · Views: 5
writing back I followed your suggestion, I went into defined scripts then I clicked on the games folder and then on the tile type folder, clicked tile 9, copied and pasted the code in that script and saved it. Then I applied the tile type again reloading the game and I still got the errors. Sorry.
 
so for later this is where I have the problem with the little timer and action step flags I tried looking up how to use them, and I followed the instructions on like having the character do a certain action on this screen. But the problem is it doesn't really work and we're back to problem I described.
is there anyway this can be pointed out?
 
I've stripped this back so you can try to get just the tile change working first.

If you tell me which variable you want to change and by how much when the prize tile is collected, I can add that.

Code:
;;; WAIT UNTIL SCREEN HAS UPDATED ;;;;;;;;;;;;;;;;;;;;;;;;;;

    LDA updateScreenData
    AND #%00000100
    BEQ screenUpdated
    RTS
screenUpdated:

;;; CHECK IS PLAYER COLLIDING ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   
    CPX player1_object            
    BEQ isPlayer
    JMP notPlayer                   ;; DONT CHANGE TILE   ;;
isPlayer:

;;; TILE CHANGE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    ChangeTileAtCollision #$00, #$00
    RTS
   
notPlayer:

If you save this as a tile type and assign it to a free tile slot in script settings it should change that tile type to null and your first BG graphic when the player touches it.
Better to start with something simple and add what you need it to do.
Could this be used in a 4.5.9 Brawler?
I want a tile that increases my health to refresh to myMaxHealth of 5 right before you walk onto warp tile to next stage.
 

TolerantX

Active member
Could this be used in a 4.5.9 Brawler?
I want a tile that increases my health to refresh to myMaxHealth of 5 right before you walk onto warp tile to next stage.
LDA #$05
STA myHealth
Update HUD element it's in
You'd need something like that right?
Wouldn't that work?
 
Top Bottom