If you are looking for the decompiler itself, visit https://github.com/jindrapetrik/jpexs-decompiler
NEW : You can now close your own issues and reopen them later if needed. You can also comment closed issues.
List of issues#2626 Updating Robot Unicorn Attacks swf breaks it
Author:
Perdu
PerduDate created:
Type: bug
Visibility: Everybody
Assigned to:
Labels: AS1/2Direct Editation
State: closed 

> What steps will reproduce the problem?
I've used JPEXS to patch several games successfully. However, for Robot Unicorn Attack
(found here: https://files.crazygames.com/robot-unicorn-attack/2/robotunicornattack.swf ), patching it breaks the game (display is
broken after a few seconds, possibly also the gameplay).
To reproduce:
- run robotunicornattack.swf in Ruffle and see it running properly
- open robotunicornattack.swf in JPEXS
- edit a script file, e.g. DoAction in frame 1, with some innocuous code, and save
- run the .swf in Ruffle again and see how display now breaks a few second into the run
(you need to actually launch the game, not remain on the title screen)
> What version of the product are you using? Is it "nightly build"? Which operating system
do you have?
ffdec 24.1.2 on Arch Linux
> Please provide any additional information below. If the problem is related to a SWF
file, attach it here, otherwise we can't help you.
Adding original .swf + patched one
Exporting all scripts before and after saving and then diffing them gives difference that
do not seem relevant to our case:
> 21,22c21,22
> < var _loc4_ = {x:colliderx,y:collidery};
> < this.localToGlobal(_loc4_);
> ---
> > var _loc3_ = {x:colliderx,y:collidery};
> > this.localToGlobal(_loc3_);
> 27c27
> < if(_root.engine.world["building" +
count].solid.hitTest(_loc4_.x,_loc4_.y,true))
> ---
> > if(_root.engine.world["building" +
count].solid.hitTest(_loc3_.x,_loc3_.y,true))
> 184c184
> < _X += 1 * landDirection;
> ---
> > _X = _X + 1 * landDirection;
> 682,685c682,685
> < var _loc3_ = {x:_x,y:_y};
> < this.localToGlobal(_loc3_);
> < _root.playerPointx = _loc3_.x + 300;
> < _root.playerPointy = _loc3_.y;
> ---
> > var playerPoint = {x:_x,y:_y};
> > this.localToGlobal(playerPoint);
> > _root.playerPointx = playerPoint.x + 300;
> > _root.playerPointy = playerPoint.y;
Capture d’écran du 2026-02-08 20-09-48.png (190 KiB)
robotunicornattack.swf (2,406 KiB)
robotunicornattack_patched2.swf (2,406 KiB)Breaking inside showPoints which is causing engine to be undefined.
Original:
DefineFunction "showPoints", 2, "psize" , "pnum" {
Push "pointFX"
Push "_root"
GetVariable
Push "points"
Push "psize"
GetVariable
Add2
GetMember
SetVariable
Push "fxy"
Push "_root"
GetVariable
Push "engine"
GetMember
Push "_y"
GetMember
Push "_root"
GetVariable
Push "engine"
GetMember
Push "player"
GetMember
Push "_y"
GetMember
Push 10
Subtract
Add2
SetVariable
Push "pointFX"
GetVariable
With {
Push "_visible"
Push true
SetVariable
Push 2
Push 1
Push "gotoAndPlay"
CallFunction
Pop
Push "_x"
Push 100
SetVariable
Push "_y"
Push "fxy"
GetVariable
SetVariable
}
After editing:
DefineFunction2 "showPoints", 2, 4, false, true, true, false, true, false, true, false,
false, 2, "psize", 3, "pnum" {
Push "pointFX"
Push register1
Push "points"
Push register2
Add2
GetMember
SetVariable
Push "fxy"
Push register1
Push "engine"
GetMember
Push "_y"
GetMember
Push register1
Push "engine"
GetMember
Push "player"
GetMember
Push "_y"
GetMember
Push 10
Subtract
Add2
SetVariable
Push "pointFX"
GetVariable
With {
Push "_visible"
Push true
SetVariable
GotoFrame 1
Play
Push "_x"
Push 100
SetVariable
Push "_y"
Push "fxy"
GetVariable
SetVariable
}
This is fixed in nightly 3408.
State: new→upgraded
State: upgraded→closed
