Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Weird Compile Bug

Author
Message
Laughing Coyote Software
6
Years of Service
User Offline
Joined: 30th Jun 2018
Playing: Pillars of Eternity 2
Posted: 15th Jul 2022 06:08 Edited at: 15th Jul 2022 06:12
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.
Laughing Coyote Software
6
Years of Service
User Offline
Joined: 30th Jun 2018
Playing: Pillars of Eternity 2
Posted: 15th Jul 2022 06:09
I imagine it has something to do with AppGameKit data files hiding somewhere that I don't know about.
Laughing Coyote Software
6
Years of Service
User Offline
Joined: 30th Jun 2018
Playing: Pillars of Eternity 2
Posted: 15th Jul 2022 06:15 Edited at: 15th Jul 2022 06:50
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.
Steve Ancell
18
Years of Service
User Offline
Joined: 16th Feb 2006
Location: Brighton, East Sussex, UK
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.
Laughing Coyote Software
6
Years of Service
User Offline
Joined: 30th Jun 2018
Playing: Pillars of Eternity 2
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.
Bored of the Rings
User Banned
Posted: 15th Jul 2022 14:02 Edited at: 15th Jul 2022 14:03
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
Pro Programmer / Data Scientist, languages: SAS, C++, SQL, PL-SQL, DBPro, Purebasic, JavaScript, others
Laughing Coyote Software
6
Years of Service
User Offline
Joined: 30th Jun 2018
Playing: Pillars of Eternity 2
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.
hendron
8
Years of Service
User Offline
Joined: 20th Dec 2015
Location:
Posted: 15th Jul 2022 16:09 Edited at: 15th Jul 2022 16:33
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().



[Edit] actually I guess the resources folder would be redundant. You could just use the top level media folder to store them.
Steve Ancell
18
Years of Service
User Offline
Joined: 16th Feb 2006
Location: Brighton, East Sussex, UK
Posted: 15th Jul 2022 18:17 Edited at: 15th Jul 2022 19:03
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.

Attachments

Login to view attachments
Laughing Coyote Software
6
Years of Service
User Offline
Joined: 30th Jun 2018
Playing: Pillars of Eternity 2
Posted: 16th Jul 2022 02:30 Edited at: 16th Jul 2022 02:53
@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.
Laughing Coyote Software
6
Years of Service
User Offline
Joined: 30th Jun 2018
Playing: Pillars of Eternity 2
Posted: 16th Jul 2022 10:11 Edited at: 16th Jul 2022 20:09
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.
Qugurun
Valued Member
9
Years of Service
User Offline
Joined: 8th Dec 2014
Playing: AppGameKit
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.
Laughing Coyote Software
6
Years of Service
User Offline
Joined: 30th Jun 2018
Playing: Pillars of Eternity 2
Posted: 16th Jul 2022 11:46 Edited at: 16th Jul 2022 20:10
@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.
Steve Ancell
18
Years of Service
User Offline
Joined: 16th Feb 2006
Location: Brighton, East Sussex, UK
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.


Laughing Coyote Software
6
Years of Service
User Offline
Joined: 30th Jun 2018
Playing: Pillars of Eternity 2
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.
Laughing Coyote Software
6
Years of Service
User Offline
Joined: 30th Jun 2018
Playing: Pillars of Eternity 2
Posted: 17th Jul 2022 07:38 Edited at: 17th Jul 2022 07:39
Two EXEs working perfectly on Steam now. Just released early access. Thank you, Qugurun.

https://store.steampowered.com/app/1748160/Warlordocracy/
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 17th Jul 2022 14:12
the game's looking good, LCS. nice work.

btw, check your PMs?
Steve Ancell
18
Years of Service
User Offline
Joined: 16th Feb 2006
Location: Brighton, East Sussex, UK
Posted: 18th Jul 2022 13:53
@Laughing Coyote Software:

Blimey!, that looks quite good mate!
Laughing Coyote Software
6
Years of Service
User Offline
Joined: 30th Jun 2018
Playing: Pillars of Eternity 2
Posted: 20th Jul 2022 06:07 Edited at: 29th Jul 2022 14:21
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

Login to post a reply

Server time is: 2024-11-21 13:29:47
Your offset time is: 2024-11-21 13:29:47