Be a Supporter!

The Flash 'Reg' Lounge

  • 2,157,289 Views
  • 64,734 Replies
New Topic Respond to this Topic
Diki
Diki
  • Member since: Jan. 31, 2004
  • Offline.
Forum Stats
Moderator
Level 13
Programmer
Response to The Flash 'Reg' Lounge 2014-01-12 16:15:11 Reply

At 1/12/14 02:27 PM, egg82 wrote: ah, awesome. So, if I wanted to compile my code for Win, Mac, and Linux on my current Win system without switching OSes and compiling on the different systems, what would I do? I'm sure there's a way. Maybe.

There isn't. The closest that you could get would be to run a virtual machine on your Windows computer, and use that to run Linux and/or OSX, and compile from there.

If you want to have a one-compile-and-go type application then you will need to use an application that itself runs on a virtual machine. The only language I know of that is in wide-spread use that can do that is Java, but that will require the user to have Java installed, and not everyone does (I don't, for example, because it's a huge security risk).

Another solution would be to instead use a high-level language such as Python or Ruby, as they won't require any compilation, so you could just use a batch script of sorts to run the application.

You might be able to compile the application once and have it run on both Linux and OSX, but no way in hell will that work for Windows as well. Microsoft doesn't like open-source technologies, or using anything that they didn't make, which is why they have their own C/C++ compiler (and it sucks).

Building/running code on Unix-based operating systems (e.g. Linux and OSX) is easy-peasy, so you could just let the end-user do that their self, and only compile the Windows versions for Windows users.

Long story short: there's no quick and easy way to get your thing to work on Windows, Linux and OSX together if you're using C/C++. They are just too low-level of languages, so it comes with the territory.

egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Member
Level 05
Game Developer
Response to The Flash 'Reg' Lounge 2014-01-12 16:48:16 Reply

At 1/12/14 04:15 PM, Diki wrote: The closest that you could get would be to run a virtual machine on your Windows computer, and use that to run Linux and/or OSX, and compile from there.

And if I happen to run an Ubuntu VM and compiled the source on that as well, I assume I would get a Windows and Linux binary that I could then call from the launcher (depending on the OS, which is simple enough to check)?


Programming stuffs (tutorials and extras)
PM me (instead of MintPaw) if you're confuzzled.
thank Skaren for the sig :P

BBS Signature
Diki
Diki
  • Member since: Jan. 31, 2004
  • Offline.
Forum Stats
Moderator
Level 13
Programmer
Response to The Flash 'Reg' Lounge 2014-01-12 16:58:44 Reply

By the way, egg, I talked to some other people and figured out why your regex wasn't working before. Just like I said it was something very simple. When you were doing:

^(?:.*?)(?:[\.|//]*)(.*?)$

The $ anchor was forcing (.*?) to match everything after the ./ and ../ parts. (.*?) is non-greedy, which means it will match as few characters as possible (including matching zero characters). But since you included the $ anchor (.*?) has no choice but to match everything up to the end of the string.

And in retrospect I don't know why I didn't figure that out on my own. Chalk it up to a brain fart.

Diki
Diki
  • Member since: Jan. 31, 2004
  • Offline.
Forum Stats
Moderator
Level 13
Programmer
Response to The Flash 'Reg' Lounge 2014-01-12 17:03:01 Reply

At 1/12/14 04:48 PM, egg82 wrote: And if I happen to run an Ubuntu VM and compiled the source on that as well, I assume I would get a Windows and Linux binary that I could then call from the launcher (depending on the OS, which is simple enough to check)?

I don't understand what you're asking. I was following you up to "could then call from the launcher". To which launcher are you referring?

egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Member
Level 05
Game Developer
Response to The Flash 'Reg' Lounge 2014-01-12 17:16:59 Reply

At 1/12/14 05:03 PM, Diki wrote: I don't understand what you're asking. I was following you up to "could then call from the launcher". To which launcher are you referring?

oh, yeah, sorry. Game launcher that auto-updates. This C++ program is the auto-update bit, where it scans a given directory, hashes the files in that directory, and checks an online source to grab any missing or updated files.

The launcher (AIR program, pretty much finished) calls this program. I already created this C++ program in C# but didn't want to rely on Linux users having Mono so i'm porting it.

At 1/12/14 04:58 PM, Diki wrote: The $ anchor was forcing (.*?) to match everything after the ./ and ../ parts. (.*?) is non-greedy, which means it will match as few characters as possible (including matching zero characters). But since you included the $ anchor (.*?) has no choice but to match everything up to the end of the string.

but shouldn't it have not matched everything before that because of the previous two groups?


Programming stuffs (tutorials and extras)
PM me (instead of MintPaw) if you're confuzzled.
thank Skaren for the sig :P

BBS Signature
Diki
Diki
  • Member since: Jan. 31, 2004
  • Offline.
Forum Stats
Moderator
Level 13
Programmer
Response to The Flash 'Reg' Lounge 2014-01-12 17:56:07 Reply

At 1/12/14 05:16 PM, egg82 wrote: oh, yeah, sorry. Game launcher that auto-updates. This C++ program is the auto-update bit, where it scans a given directory, hashes the files in that directory, and checks an online source to grab any missing or updated files.

The launcher (AIR program, pretty much finished) calls this program. I already created this C++ program in C# but didn't want to rely on Linux users having Mono so i'm porting it.

That would work then. However, sounds like using a high-level language would be the better route. You wouldn't need to worry about compiling anything or changing any code.

At 1/12/14 05:16 PM, egg82 wrote: but shouldn't it have not matched everything before that because of the previous two groups?

Without the $ anchor, yes. Because you included it this is what happens:

- From the start of the string match any characters an unlimited number of times, as few times as possible, up to an ellipse or a forward slash.
- After the ellipses and forward slashes match any characters an unlimited number of times, as few times as possible, up to the end of the string.

The key part being "up to the end of the string".

PSvils
PSvils
  • Member since: Feb. 3, 2010
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to The Flash 'Reg' Lounge 2014-01-13 14:34:26 Reply

At 1/12/14 05:16 PM, egg82 wrote: The launcher (AIR program, pretty much finished) calls this program. I already created this C++ program in C# but didn't want to rely on Linux users having Mono so i'm porting it.

I don't understand though...if you're already using AIR......then why not use AIR for the auto-update as well?

MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to The Flash 'Reg' Lounge 2014-01-13 14:44:07 Reply

At 1/13/14 02:34 PM, PSvils wrote: I don't understand though...if you're already using AIR......then why not use AIR for the auto-update as well?

Do you know how much sense that makes? Too much.

egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Member
Level 05
Game Developer
Response to The Flash 'Reg' Lounge 2014-01-13 15:25:59 Reply

At 1/13/14 02:34 PM, PSvils wrote: I don't understand though...if you're already using AIR......then why not use AIR for the auto-update as well?

Because AIR is relatively slow and has its own problems.
I actually went back to that and ported the code over from the C# program to AIR yesterday and finished up some bugs today.

The problem i'm facing now is the application freezes quite a lot because accessing files in AIR is quite slow.
To counteract that, I used Workers (yay, multithreading)

except now I can't seem to get that to work.

public class Main extends Sprite {
		//vars
		private var worker:Worker;
		private var fromWorker:MessageChannel;
		
		//constructor
		public function Main():void {
			if (Worker.current.isPrimordial) {
				//new StateEngine(this, new InitState());
				
				worker = WorkerDomain.current.createWorker(this.loaderInfo.bytes, true);
				
				fromWorker = worker.createMessageChannel(Worker.current);
				worker.setSharedProperty("fromWorker", fromWorker);
				fromWorker.addEventListener(Event.CHANNEL_MESSAGE, onWorkerChannelMessage);
				worker.addEventListener(Event.WORKER_STATE, onWorkerState);
				
				worker.start();
			} else {
				//do {
					(Worker.current.getSharedProperty("fromWorker") as MessageChannel).send("here");
				//} while (true);
			}
		}
		
		//public
		
		//private
		private function onWorkerState(e:Event):void {
			trace(worker.state);
		}
		
		private function onWorkerChannelMessage(e:Event):void {
			var receive:String = fromWorker.receive();
			
			trace("info");
			trace(receive);
		}
	}

you would think that would work just fine (in fact, it was copied almost directly from an example on Workers) but for some ungodly reason nothing is being sent from the worker and i'm ripping my hair out trying to figure out why.

Apparently there's a bug in 11.7 that prevents messages from being sent through the MessageChannel class?
though i'm using AIR 3.8, it might be using 11.7 to run. Christ, I don't know. I'm about to just give up and say "download the damn files yourself"


Programming stuffs (tutorials and extras)
PM me (instead of MintPaw) if you're confuzzled.
thank Skaren for the sig :P

BBS Signature
MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to The Flash 'Reg' Lounge 2014-01-13 15:54:26 Reply

At 1/13/14 03:25 PM, egg82 wrote: The problem i'm facing now is the application freezes quite a lot because accessing files in AIR is quite slow.
To counteract that, I used Workers (yay, multithreading)

except now I can't seem to get that to work.

http://jacksondunstan.com/. Start at nov 25. Might be useful, this is pretty much the only documentation of a few features since adobe hasn't updated their docs in forever (beta docs have few descriptions).

egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Member
Level 05
Game Developer
Response to The Flash 'Reg' Lounge 2014-01-13 23:27:30 Reply

At 1/13/14 03:54 PM, MSGhero wrote: http://jacksondunstan.com/. Start at nov 25. Might be useful, this is pretty much the only documentation of a few features since adobe hasn't updated their docs in forever (beta docs have few descriptions).

Once again I basically copy/pasted the code and it still doesn't seem to work, even after upping to AIR 3.... 9?
Whatever, latest version.

I dunno, maybe it's FlashDevelop?


Programming stuffs (tutorials and extras)
PM me (instead of MintPaw) if you're confuzzled.
thank Skaren for the sig :P

BBS Signature
MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to The Flash 'Reg' Lounge 2014-01-13 23:59:41 Reply

At 1/13/14 11:27 PM, egg82 wrote: I dunno, maybe it's FlashDevelop?

Probably not. If you copy adobe's example line for line without changing anything (no more "basically" copy pasting) and export to 11.4+ (excluding 11.7 maybe), it should work. If it doesn't, you broke it. If it does, try going to AIR and setting giveAppPrivileges to true.

And check Worker.isSupported.

egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Member
Level 05
Game Developer
Response to The Flash 'Reg' Lounge 2014-01-14 00:24:51 Reply

At 1/13/14 11:59 PM, MSGhero wrote: Probably not. If you copy adobe's example line for line without changing anything (no more "basically" copy pasting) and export to 11.4+ (excluding 11.7 maybe), it should work. If it doesn't, you broke it. If it does, try going to AIR and setting giveAppPrivileges to true.

Created a new blank AS3 project, copy/pasted Adobe's examples and JacksonDunstan's examples to the letter, all 11.4-11.9
Still nothing.

And check Worker.isSupported.

Checked both Worker and WorkerDomain, both true


Programming stuffs (tutorials and extras)
PM me (instead of MintPaw) if you're confuzzled.
thank Skaren for the sig :P

BBS Signature
egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Member
Level 05
Game Developer
Response to The Flash 'Reg' Lounge 2014-01-14 00:26:41 Reply

At 1/14/14 12:24 AM, egg82 wrote: Still nothing.

Now here's a puzzle:
Compiling in Release mode works just fine except that it crashes after closing


Programming stuffs (tutorials and extras)
PM me (instead of MintPaw) if you're confuzzled.
thank Skaren for the sig :P

BBS Signature
egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Member
Level 05
Game Developer
Response to The Flash 'Reg' Lounge 2014-01-14 00:34:03 Reply

And a triple-post because I actually started doing research on this.

http://www.flashdevelop.org/community/viewtopic.php?f=6&t=10668
http://www.flashdevelop.org/community/viewtopic.php?f=13&t=9870

blah. That was almost the entirety of my day gone >:(


Programming stuffs (tutorials and extras)
PM me (instead of MintPaw) if you're confuzzled.
thank Skaren for the sig :P

BBS Signature
MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to The Flash 'Reg' Lounge 2014-01-14 00:47:15 Reply

At 1/14/14 12:34 AM, egg82 wrote: And a triple-post because I actually started doing research on this.

http://www.flashdevelop.org/community/viewtopic.php?f=6&t=10668
http://www.flashdevelop.org/community/viewtopic.php?f=13&t=9870

blah. That was almost the entirety of my day gone >:(

I stand corrected. That's really weird. You could try a different editor like mike does (sublime+flex?), but don't take forever trying alternatives lol.

slugrail
slugrail
  • Member since: Sep. 1, 2013
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to The Flash 'Reg' Lounge 2014-01-14 13:51:43 Reply

Decided to create a scripting language a couple of hours ago (its 6 am right now). Really great progress so far, it will be running on a multithreaded engine once I clean up the project and switch the base from FP to AIR.

I'll be using this in my game on both the server and client side to promote modding; custom maps, vehicles, weapons and game modes!

http://youtu.be/ArQA9lnk2UI

PSvils
PSvils
  • Member since: Feb. 3, 2010
  • Offline.
Forum Stats
Member
Level 01
Game Developer
Response to The Flash 'Reg' Lounge 2014-01-14 14:23:55 Reply

At 1/14/14 01:51 PM, slugrail wrote: Decided to create a scripting language a couple of hours ago (its 6 am right now). Really great progress so far, it will be running on a multithreaded engine once I clean up the project and switch the base from FP to AIR.

I'll be using this in my game on both the server and client side to promote modding; custom maps, vehicles, weapons and game modes!

http://youtu.be/ArQA9lnk2UI

It doesn't seem to have for/while loops or if statements, or functions.

Why don't you just use hscript?
http://code.google.com/p/hscript/

Download a .swc for use with AS3:
https://plus.google.com/+AndreasR%C3%B8nning/posts/LEFUqnSoKxS

P.

kkots
kkots
  • Member since: Apr. 16, 2013
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to The Flash 'Reg' Lounge 2014-01-14 14:27:17 Reply

At 1/14/14 01:51 PM, slugrail wrote: Decided to create a scripting language a couple of hours ago (its 6 am right now).

Programmers have inspiration too.

BoMToons
BoMToons
  • Member since: Nov. 29, 2005
  • Offline.
Forum Stats
Moderator
Level 38
Game Developer
Response to The Flash 'Reg' Lounge 2014-01-14 14:50:22 Reply

Wow, this lounge is still going?!! It used to be full of artists. Now it's all programmers. You guys are boring! ;-)

egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Member
Level 05
Game Developer
Response to The Flash 'Reg' Lounge 2014-01-14 14:51:59 Reply

At 1/14/14 01:51 PM, slugrail wrote: Decided to create a scripting language a couple of hours ago (its 6 am right now). Really great progress so far, it will be running on a multithreaded engine once I clean up the project and switch the base from FP to AIR.

You're nuts for trying to make your own language, doubly so for trying to do it in AS3/AIR.

I'll be using this in my game on both the server and client side to promote modding; custom maps, vehicles, weapons and game modes!

Triple nuts for trying to put into production.

I mean, I see the appeal of making your own language because why the hell not, but you can't seriously be thinking about using it for realzies? O.o


Programming stuffs (tutorials and extras)
PM me (instead of MintPaw) if you're confuzzled.
thank Skaren for the sig :P

BBS Signature
Diki
Diki
  • Member since: Jan. 31, 2004
  • Offline.
Forum Stats
Moderator
Level 13
Programmer
Response to The Flash 'Reg' Lounge 2014-01-14 15:04:42 Reply

At 1/14/14 02:50 PM, BoMToons wrote: Wow, this lounge is still going?!! It used to be full of artists. Now it's all programmers. You guys are boring! ;-)

The programming lounde is super dead, and all the recent posts are just me posting updates about my projects and coln asking questions about them.

So you guys are stuck with me. >:)

slugrail
slugrail
  • Member since: Sep. 1, 2013
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to The Flash 'Reg' Lounge 2014-01-14 15:13:35 Reply

At 1/14/14 02:23 PM, PSvils wrote:
At 1/14/14 01:51 PM, slugrail wrote: Decided to create a scripting language a couple of hours ago (its 6 am right now). Really great progress so far, it will be running on a multithreaded engine once I clean up the project and switch the base from FP to AIR.

I'll be using this in my game on both the server and client side to promote modding; custom maps, vehicles, weapons and game modes!

http://youtu.be/ArQA9lnk2UI
It doesn't seem to have for/while loops or if statements, or functions.

Why don't you just use hscript?
http://code.google.com/p/hscript/

Download a .swc for use with AS3:
https://plus.google.com/+AndreasR%C3%B8nning/posts/LEFUqnSoKxS

P.

I'm using an unordered bytestack and just seeking into different pointers in mem depending on the current branch of operation, I don't rely on the underlying OOP base of AS3 to handle objects or data types (apart from floating points and integers where it is obviously required) - there is too much overhead running a script engine within another runtime. If what you have posted does anything remotely similar and doesnt rely on the AS3 runtime to handle memory and objects then I'll consider using it. For now I want to keep brainstorming ways to structure some of the logic before I keep working on it so I don't end up wasting hours refactoring the entire thing. It's a good learning experience too.

MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to The Flash 'Reg' Lounge 2014-01-14 17:11:35 Reply

At 1/14/14 02:50 PM, BoMToons wrote: Wow, this lounge is still going?!! It used to be full of artists. Now it's all programmers. You guys are boring! ;-)

The topic changes drastically each new page or two.

Diki
Diki
  • Member since: Jan. 31, 2004
  • Offline.
Forum Stats
Moderator
Level 13
Programmer
Response to The Flash 'Reg' Lounge 2014-01-14 17:26:42 Reply

At 1/14/14 05:11 PM, MSGhero wrote: The topic changes drastically each new page or two.

New page needs a new topic:

Catapult v.s. Trebuchet: Which is Better? You Decide!

BoMToons
BoMToons
  • Member since: Nov. 29, 2005
  • Offline.
Forum Stats
Moderator
Level 38
Game Developer
Response to The Flash 'Reg' Lounge 2014-01-14 17:54:54 Reply

At 1/14/14 05:11 PM, MSGhero wrote:
At 1/14/14 02:50 PM, BoMToons wrote: Wow, this lounge is still going?!! It used to be full of artists. Now it's all programmers. You guys are boring! ;-)
The topic changes drastically each new page or two.

Do you disagree that it's mostly coders now though?

MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to The Flash 'Reg' Lounge 2014-01-14 18:08:22 Reply

At 1/14/14 05:54 PM, BoMToons wrote: Do you disagree that it's mostly coders now though?

Us and luis. Anyone coming here would get put off by all the regex and C that's been in the past 2-3 pages, it's not usually like that.

egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Member
Level 05
Game Developer
Response to The Flash 'Reg' Lounge 2014-01-14 19:16:11 Reply

At 1/14/14 05:54 PM, BoMToons wrote: Do you disagree that it's mostly coders now though?

Pretty much everyone working in Flash knows how to code, at least to some degree.
Code talk just comes with the territory. I like being able to ask question when I'm absolutely stuck and google can't help (which doesn't happen very often)

for example: Why in the world is the downloader portion of this launcher not working?
So I have a downloader class/thingy which runs in a Worker and pipes back some information as to what's going on for debugging. When I hit run with FD in Release mode, it works absolutely flawlessly. However, when I package it all up into a bundle for redist, it gets stuck at specific points.

From the debug logs, I can see that two files are failing to hash. However, if it were that easy it wouldn't be a problem because I have an error handler for that which just skips the file. It seems like it's not erroring out when opening the files, but rather just... Not... Doing anything? Like, at all? I'll add another debug thing to see which files they are, but it's really strange that the progress shows "done" but two files are just completely missing from the supposed 26 that are supposed to be there.


Programming stuffs (tutorials and extras)
PM me (instead of MintPaw) if you're confuzzled.
thank Skaren for the sig :P

BBS Signature
MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to The Flash 'Reg' Lounge 2014-01-14 23:41:20 Reply

I'm about to venture into a whole new world.

I've been preparing myself for this for the past 3 years.

I've largely glossed over this until now because my mind, body, and soul were not ready.

But it's time.

bmd.copyPixels(src, rect, pt, null, null, true);

no longer.

I'm gonna use the alphaBitmapData parameter of copyPixels.

BoMToons
BoMToons
  • Member since: Nov. 29, 2005
  • Offline.
Forum Stats
Moderator
Level 38
Game Developer
Response to The Flash 'Reg' Lounge 2014-01-14 23:56:16 Reply

At 1/14/14 11:41 PM, MSGhero wrote: I'm gonna use the alphaBitmapData parameter of copyPixels.

It's a trap.