Originally Posted by
krazyshank
@
JustAnoobROTMG
If you could please clearify on how to properly embed your code into the method that would be great.
I've tried replacing everything before the L10: to no avail, the game just crashes when you try to walk.
Just checked this out. Paste all this code after setlocal3 of the _-cJ function in the Player class and you'll be in business. BTW I didn't change anything, just tried to make it a tiny bit clearer what was needed to be inserted.
Code:
;-------------------------
; NOWALK ON LAVA
;-------------------------
;First we need to make sure the Square name contains Lava
getlocal3
getproperty QName(PackageNamespace("", "#0"), "props_")
getproperty QName(PackageNamespace("", "#0"), "id_")
pushstring "Lava"
callproperty QName(Namespace("https://adobe.com/AS3/2006/builtin"), "search"), 1
pushint -1
ifeq SKIPNOWALK
;Now, we must test if the Square has an object on him.
;If obj_ is not null, it means there is a "bridge on the lava"
;In this case we DONT HAVE TO FORCE NOWALK since we can cross using the bridge
;If its another object than "Partial Red floor" we should be blocked.
getlocal3
getproperty QName(PackageNamespace("", "#0"), "obj_")
pushnull
ifne SKIPNOWALK
pushfalse ; set the square NonWalkable
returnvalue
; trace obj, only for debug
;findpropstrict QName(PackageNamespace("", "#0"), "trace")
;getlocal3
;getproperty QName(PackageNamespace("", "#0"), "obj_")
;callpropvoid QName(PackageNamespace("", "#0"), "trace"), 1
;Let the game do NOWALK checks
SKIPNOWALK: