Skip to content

Commit

Permalink
better flut/racer anywhere transitions (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
dallmeyer authored Oct 8, 2024
1 parent 20f57fa commit 4308242
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
5 changes: 1 addition & 4 deletions goal_src/jak1/levels/flut_common/flutflut.gc
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,8 @@
(let ((v1-35 gp-0)) (set! (-> v1-35 height) (the float 80)))
(set! (-> gp-0 flags) (font-flags shadow kerning large))
(print-game-text (lookup-text! *common-text* (text-id press-to-use) #f) gp-0 #f 128 22))
(if *allow-flutflut-anywhere* ;; if "self" is passed instead of #f, deloading level/flutflut will crash
(if (and (cpad-pressed? 0 circle) (send-event *target* 'change-mode 'flut #f))
(go-virtual pickup (method-of-object self wait-for-return)))
(if (and (cpad-pressed? 0 circle) (send-event *target* 'change-mode 'flut self))
(go-virtual pickup (method-of-object self wait-for-return))))))
(go-virtual pickup (method-of-object self wait-for-return)))))
(flutflut-effect)
(suspend)
(ja :num! (loop!))))
Expand Down
4 changes: 3 additions & 1 deletion goal_src/jak1/levels/flut_common/target-flut.gc
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,9 @@
(set! (-> self flut stick-lock) #f)
(set! (-> self flut flap-sound-id) (new-sound-id))
(set! (-> self flut entity) #f)
(let ((v1-11 (handle->process arg0))) (if v1-11 (set! (-> self flut entity) (-> v1-11 entity))))
(let ((v1-11 (handle->process arg0)))
(if (and (not *allow-flutflut-anywhere*) v1-11) ;; OG-modbase dont track entity, prevents crash on level deload
(set! (-> self flut entity) (-> v1-11 entity))))
(target-collide-set! 'flut (the-as float 0.0))
(set! (-> self control transv quad) (the-as uint128 0))
(set! (-> self control unknown-float01) 0.0)
Expand Down
4 changes: 3 additions & 1 deletion goal_src/jak1/levels/racer_common/racer-states.gc
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@
(set! (-> self racer boost-sound-id) (new 'static 'sound-id))
(set! (-> self racer scrape-sound-id) (new-sound-id))
(set! (-> self racer entity) #f)
(let ((v1-28 (handle->process arg0))) (if v1-28 (set! (-> self racer entity) (-> v1-28 entity))))
(let ((v1-28 (handle->process arg0)))
(if (and (not *allow-zoomer-anywhere*) v1-28) ;; OG-modbase dont track entity, prevents crash on level deload
(set! (-> self racer entity) (-> v1-28 entity))))
(set! (-> self control surf) *race-track-surface*)
(set! (-> self control reaction) racer-collision-reaction)
(vector-reset! (-> self racer rot))
Expand Down
5 changes: 1 addition & 4 deletions goal_src/jak1/levels/racer_common/racer.gc
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,8 @@
(let ((v1-25 gp-0)) (set! (-> v1-25 height) (the float 80)))
(set! (-> gp-0 flags) (font-flags shadow kerning large))
(print-game-text (lookup-text! *common-text* (text-id press-to-use) #f) gp-0 #f 128 22))
(if *allow-zoomer-anywhere* ;; if "self" is passed instead of #f, deloading level/zoomer will crash ;;mod-base-change
(if (and (or (cpad-pressed? 0 circle) (= (-> self condition) 4)) (send-event *target* 'change-mode 'racing #f))
(go-virtual pickup (the-as (state collectable) (method-of-object self wait-for-return))))
(if (and (or (cpad-pressed? 0 circle) (= (-> self condition) 4)) (send-event *target* 'change-mode 'racing self))
(go-virtual pickup (the-as (state collectable) (method-of-object self wait-for-return)))))))
(go-virtual pickup (the-as (state collectable) (method-of-object self wait-for-return))))))
(racer-effect)
(suspend))))
:post ja-post)
Expand Down

0 comments on commit 4308242

Please sign in to comment.