Posted: 15th Jul 2022 6:08
So, I'm trying to compile two separate EXEs, one with the world editor enabled (simple variable at the beginning of the code), and one without the editor enabled. Every time I compile it and put both EXEs into the same folder (the editor EXE and the non-editor EXE), both of them open up as the same EXE (whichever one I compiled last). It's like this no matter what folders I put the EXEs in, and no matter where I move the EXEs. This is the weirdest thing I've ever seen. DarkBASIC Pro never did this, only AppGameKit Classic. I have no idea what's going on.

Any ideas? Thanks.

EDIT: To clarify, I can compile both the editor and non-editor EXEs and keep them in separate folders, and both work. Then when I move the editor EXE into the other folder, it just becomes the non-editor EXE for no reason.
Posted: 15th Jul 2022 6:09
I imagine it has something to do with AppGameKit data files hiding somewhere that I don't know about.
Posted: 15th Jul 2022 6:15
Just found out it has something to do with the bytecode.byc file. It somehow changes the EXEs when I try to launch them. Is there any way around this?

EDIT: Also, this is very bad that AppGameKit doesn't allow two EXEs. What if people want to have a launcher program?

EDIT 2: I guess I could just make a launcher program in DarkBASIC Pro to launch an AppGameKit app, but that seems kind of ridiculous.
Posted: 15th Jul 2022 10:04
The bytecode doesn't change the exe file, the exe is a player/runtime that just finds the bytecode and runs it.
Posted: 15th Jul 2022 13:36
Is there any way to have multiple EXEs? I want one with world editor enabled, and another without, then maybe a launcher app. Thanks.
Posted: 15th Jul 2022 14:02
not tried myself, but you could just compile the first version then rename the .eXE file , then recompile the next version and rename if need to. or worse case scenario- create 2 separate projects
Posted: 15th Jul 2022 14:23
Compiling two separate files doesn't work, because they both point to that bytecode file, which is the real program. Essentially, it's impossible to make a launcher program in AGK. I really hope someone can prove me wrong.
Posted: 15th Jul 2022 16:09
Maybe try using 2 different app folders for the different versions, with your media (images etc) loaded from a resources folder above them. Then have a main launcher app that launches them using RunApp().

+ Code Snippet
-MainApp
  -Launcher.exe
  -media
    -bytcode.byc
  -resources
    -images/sounds/etc
  -App1
    -App1.exe
    -media
      -bytecode.byc
  -App2
    -App2.exe
    -media
      -bytecode.byc


[Edit] actually I guess the resources folder would be redundant. You could just use the top level media folder to store them.
Posted: 15th Jul 2022 18:17
I've done a workaround, you just need to modify the code for your needs. Download the zip file attached to this comment. You may need to refresh this page if the attachment doesn't show first time.

P.S: You need to make sure you compiled the code in the sub folder(s) before running the base application, I have already done that though in this case.
Posted: 16th Jul 2022 2:30
@Steve Ancell Oh, I could just change the media path at the beginning. Perfect, thank you.

EDIT: I'll try it out soon and let you know.
Posted: 16th Jul 2022 10:11
I would have to completely copy all of my media assets. That wouldn't be worth it. I might just have a DarkBasic Pro launcher to edit an ini file eventually.
Posted: 16th Jul 2022 10:54
There is a solution: take the hex editor and change all occurrences of bytecode.byc to the name you need, but in order for the length of the name to remain the same, you can simply change the format from byc to dat, for example, and the edited exe file will search for a new file to play.
I just checked it out and it works.
Posted: 16th Jul 2022 11:46
@Qugurun: Oh that does work. Thank you!

I'm just worried it might corrupt something down the line. I've never used Hex Editor before.
Posted: 16th Jul 2022 12:29
A hex editor was used quite extensively back in the day for things like finding cheat codes, removing copy protection and putting rude messages into games.

Posted: 16th Jul 2022 21:57
Well, I'm happy then. I didn't want to make a launcher, I just wanted two EXEs that you could launch from Steam. One with the world editor enabled, and one without.
Posted: 17th Jul 2022 7:38
Two EXEs working perfectly on Steam now. Just released early access. Thank you, Qugurun.

https://store.steampowered.com/app/1748160/Warlordocracy/
Posted: 17th Jul 2022 14:12
the game's looking good, LCS. nice work.

btw, check your PMs?
Posted: 18th Jul 2022 13:53
@Laughing Coyote Software:

Blimey!, that looks quite good mate!
Posted: 20th Jul 2022 6:07
Thank you. Pathfinding is still terrible, but I'm gonna work on that soon.
There's also my previous game that released 5 years ago. No more bugs: https://store.steampowered.com/app/652410/Brigand_Oaxaca/
EDIT: DarkBASIC Pro