Cheating at FoE

ElAcechador

Active Member
May 7, 2016
32
6
I've already mentionned in this other thread that it's possible with a bit of scripting magic to get a complete list of all TF Items in the game and their respective effects, which can be handy for Wiki maintainers. However, being able to manipulate the game without the use of a save editor really is the part I dig the most about it, and I thought maybe some people might enjoy being able to do this as well, so I'm going to put what I know in this thread here and try to explain it as best as I can.


First of all, though, and before I lose anyone who can't figure out what I'm talking about, Fall of Eden is a browser-based game made in Javascript, in such a way that all of the game's state and logic is managed by the browser itself. Most browsers include a developper console (which you can open by pressing F12 or Ctrl+Shift+C and selecting the "Console" tab) to make it easier to check what a webpage or a web application is doing without having to go back and fourth and make change to the code, and this is exactly what we need in order to tinker with FoE.


Word of warning, though : Note that copying and pasting code from the interwebs in this console is generally a very bad idea, and can be used for all sorts of nasty stuff, but everything that can be done in this console is limited to whatever webpage you're on and is cleared once you refresh it. Doing this on https://www.fenoxo.com/play/FoE/foe.html? That's fine, there's nothing on the page except for the game itself. Doing the same thing on Facebook? That's just asking for trouble.


Now let's get started.


Starting a new game or loading up an old one and simply typing player in the console will show you the value of (what else?) the object named "player", which has been created by the game and contains everything it knows about the player character (see screenshot). Since that amounts to quite a bit of stuff, you'll probably need to click it in order to see everything it contains. If you look inside and find the "body" object within, you'll that it actually contains informations on what your character looks like, which is the first thing we'll try to alter. As a quick note, typing player.body returns this part alone (the element named "body" in the "player" object), since the dot operator allows to specify some part of an object.


Screenshot from 2016-09-25 16-46-27.png


If we want to quickly change our head and make it into a horse head, no need to do find Rosalina and drink potions all day anymore. If you look at player.body.head, you'll see that there's an element inside with the "race" key. Put simply, everytime the game wants to know what your head looks like, it looks at the race element and compares it to a reference it keeps somewhere else. That "somewhere else" happens to be the Race object. In principle, we could just do something like this :


player.body.head.race = Race.Horse;


...and while it would technically work, you might run into problems later on because your eyes and ears haven't changed alongside the rest of your face. Luckily, as we can see here, the head class, which describes the head object, happens to have a function that will take care of that for you. All you need to do is call it like this :


player.body.head.SetRace(Race.Horse);


And you now have a horse head that looks exactly like your previous head (i.e : Same eye and hair color, no fur if you didn't have any before).


TO BE CONTINUED


Is anyone interested in seeing more of this?


Screenshot from 2016-09-25 16-46-27.png
 
Last edited by a moderator:
  • Like
Reactions: Lone Wolf115

LukaDoc

Scientist
Creator
Aug 27, 2015
73
3
Very interesting. Personally I prefer to just edit my save, but I haven't played for non-testing purposes in a while.
 
  • Like
Reactions: Lone Wolf115

Alder

Scientist
FoE Mod
Aug 26, 2015
290
51
I use this style of "cheating" for debugging, since it allows for calling pretty much every scene in the game from the terminal with 100% accuracy.
 
  • Like
Reactions: Lone Wolf115

ElAcechador

Active Member
May 7, 2016
32
6
I use this style of "cheating" for debugging, since it allows for calling pretty much every scene in the game from the terminal with 100% accuracy.

It's actually what keeps me coming back to FoE. (I'd insert an emote, but they all kinda suck)
 
  • Like
Reactions: Lone Wolf115

muttdoggy

Well-Known Member
Mar 23, 2016
289
9
I thought it was a folded up laptop.. now you said sandpaper, that makes more sense...lol
 

SheepyCloud

Well-Known Member
Apr 3, 2020
55
11
28
This most definitely does not work now, been trying to do this for the past 30 minutes.
 

SheepyCloud

Well-Known Member
Apr 3, 2020
55
11
28
I keep typing player into the console but get

ReferenceError: player is not defined

Yeah, that's why it doesn't work.
I just starting saving, grabbing the line, and tossing it into Notepad, then using that to edit things. (Can only edit stats, jobs, and such, i don't dare touch anything else)
 
  • Like
Reactions: Lone Wolf115

Alder

Scientist
FoE Mod
Aug 26, 2015
290
51
This method still works, but you need to write:
game.player.
instead. Inspecting the game object in the console should give you at least a little idea of what can be changed. Remember that messing around with flags is likely to create wonky behavior.
 
  • Like
Reactions: Lone Wolf115

SheepyCloud

Well-Known Member
Apr 3, 2020
55
11
28
This method still works, but you need to write:
game.player.
instead. Inspecting the game object in the console should give you at least a little idea of what can be changed. Remember that messing around with flags is likely to create wonky behavior.

Yeah, i know that from having done something similar (ish) in TiTS, by adding a weapon that breaks the game. (Tachyon Laser Beam, not sure why it exists in the SE, but it does, and breaks the game until removed from the save)

Even when editing in Jobs/Classes though, they don't get added until you've actually earned them. (Though if I'm remembering correctly, if you made them max level, they're gained at max level)
 

Alder

Scientist
FoE Mod
Aug 26, 2015
290
51
How do you call up scenes from the console? Is that possible?
Currently, no. I'm adding that to the 0.5.7 release as it would be useful for me as well. Some of it is available here already: https://github.com/AlderArts/foe/tree/feat_0.5.7

Keep in mind that due to how the game is coded, calling these functions may have side effects that could potentially break your game if you call them out of order. This isn't a scene viewer, it's a debug tool.
 

Yuurikin

New Member
Sep 28, 2022
1
0
21
Hello currently trying to understand /perform the commands in game but I'm failing at every corner. Is there like a guide that helps out in doing so? I've read above I've tried to put the exact command but using game.player but end up with no working results. Any advice I can receive?