11 March 2016 - Forum Rules
Started by DrDimension, October 17, 2018, 10:40:12 PM
ObjectData_WindAttack2 ; Object 11 ;; Level 2 shot from Sword of Wind $1afff .byte $33 $1b000 .byte $ff,$18,$00,$0a,$02,$03,$1e,$00,$03 $1b009 .byte $ff,$00,$02,$00,$10,$00,$11,$00,$00 $1b012 .byte $88,$01,$1c $1b015 .byte $07,$01,$00,$01
Quote from: steve_hacks on June 03, 2019, 10:23:54 PMTeleport should be a piece of cake - just change the entrance from $00 or $01 to $40 or $41.
Quote from: steve_hacks on June 03, 2019, 10:23:54 PMThat's interesting about the object data. What you're changing is the object's "action script". It's stored in $4a0,x and determines the routine that runs every (other?) frame for each object on the map. It corresponds to an entry in the jump table at $36314. In this case, $11 (most sword level 1 shots) goes to $370a8, while $10 (crystalis shot) goes to $370b5, which the former one falls through into after setting direction and graphics. So in this case, that's probably exactly the right thing to do, though it might be possible to do some slightly different graphics in a currently-unused location and then jump to the same spot.
ObjectActionJump_36 $37070 a9 00: lda #$00 $37072 9d 60 03: sta $0360,x $37075 bd 20 06: lda $0620,x $37078 d0 44: bne $370be $3707a fe 20 06: inc $0620,x $3707d a0 00: ldy #$00 $3707f a9 14: lda #$14 $37081 20 2d 97: jsr AdHocSpawnObject $37084 90 38: bcc $370be $37086 a4 10: ldy $10 $37088 b9 b0 00: lda $00b0,y $3708b 18: clc $3708c 69 18: adc #$18 $3708e 99 b0 00: sta $00b0,y $37091 4c be b0: jmp $370beObjectActionJump_11 ;; The first frame, set the correct sprite for the direction $370a8 bd 60 03: lda ObjectDirection,x $370ab 4a: lsr $370ac 1d 00 03: ora ObjectMetasprite,x $370af 9d 00 03: sta ObjectMetasprite,x $370b2 de a0 04: dec ObjectActionScript,xObjectActionJump_10 ;; Subsequent frames, do normal thing: ;; 1. subtract 4 from 4e0 ;; 2. $370b5 bd e0 04: lda $04e0,x $370b8 38: sec $370b9 e9 04: sbc #$04 $370bb 9d e0 04: sta $04e0,x
a5 6c: lda CurrentLocationc9 5f: cmp #LOC_DYNA
a5 6c: lda CurrentLocation29 f8: and #$f8c9 5f: cmp #LOC_DYNA
Quote from: Cyneprepou4uk on June 11, 2019, 03:01:26 AMBNE checks flag Z = 0 and jumps if trueAND doesn't add anything, it compares bits from memory and accumulator. Result is a byte, which have bit number = 1 if both bytes had the same bit number = 1, else 0
Quote from: steve_hacks on June 10, 2019, 11:43:09 PMIf you're mucking with action scripts and worried about space, I'd recommend finding some spare space in the back of the PRG (around $3f9ba) and JSR to it. This will give you plenty of space to do whatever you need, without worrying about fitting exactly into the same area.The teleport check in vanilla is `cmp #$58`, not `cmp #$5f`. But you're correct that if you simply remove the `and #$f8` then you can simply compare against #$5f to have the desired effect. But why do you care if the player teleports out while fighting Dyna? Does that cause any problems?I don't know how the player effect works teleport, but if you look at $3d31c (DialogFollowupActionJump_02_Disappear) you'll see how the sages (and Stom) disappear, which might give you some clue... unless you're thinking of something completely different.For the backwards routes - does this cause any problems for keeping them closed until the white robots are killed?
Quote from: Cyneprepou4uk on June 22, 2019, 05:51:00 PMput graphics in chr bank, check for a direction before firing a projectile and set 4 differend id's depending, add sprite attributes to a table for these new id's
Page created in 0.082 seconds with 19 queries.