Be a Supporter!

The Flash 'Reg' Lounge

  • 1,648,210 Views
  • 63,935 Replies
New Topic Respond to this Topic
nitokov
nitokov
  • Member since: May. 8, 2012
  • Offline.
Forum Stats
Member
Level 05
Programmer
Response to The Flash 'Reg' Lounge 2013-06-22 11:26:09 Reply

and thats why i "grow my own"


RangeError: Error #1125: The index 4 is out of range 4.

egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Supporter
Level 05
Game Developer
Response to The Flash 'Reg' Lounge 2013-06-22 11:29:57 Reply

At 6/22/13 11:26 AM, nitokov wrote: and thats why i "grow my own"

grower and not a shower, eh?


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

BBS Signature
nitokov
nitokov
  • Member since: May. 8, 2012
  • Offline.
Forum Stats
Member
Level 05
Programmer
Response to The Flash 'Reg' Lounge 2013-06-22 11:33:07 Reply

At 6/22/13 11:29 AM, egg82 wrote:
At 6/22/13 11:26 AM, nitokov wrote: and thats why i "grow my own"
grower and not a shower, eh?

i will wait until harvest :D


RangeError: Error #1125: The index 4 is out of range 4.

FlyingColours
FlyingColours
  • Member since: Jul. 3, 2011
  • Offline.
Forum Stats
Member
Level 06
Programmer
Response to The Flash 'Reg' Lounge 2013-06-22 13:32:59 Reply

egg, your team's interpretation of the screenshot is completely different from ours.

egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Supporter
Level 05
Game Developer
Response to The Flash 'Reg' Lounge 2013-06-22 14:41:47 Reply

At 6/22/13 01:32 PM, FlyingColours wrote: egg, your team's interpretation of the screenshot is completely different from ours.

i'd hope so! ;)


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

BBS Signature
FlyingColours
FlyingColours
  • Member since: Jul. 3, 2011
  • Offline.
Forum Stats
Member
Level 06
Programmer
Response to The Flash 'Reg' Lounge 2013-06-22 20:14:35 Reply

At 6/22/13 02:41 PM, egg82 wrote:
At 6/22/13 01:32 PM, FlyingColours wrote: egg, your team's interpretation of the screenshot is completely different from ours.
i'd hope so! ;)

Let's prove 4ur's prediction wrong then! :P

Glaiel-Gamer
Glaiel-Gamer
  • Member since: Dec. 28, 2004
  • Offline.
Forum Stats
Member
Level 28
Game Developer
Response to The Flash 'Reg' Lounge 2013-06-22 20:39:31 Reply

At 6/22/13 11:16 AM, egg82 wrote: is it just me, or does that make much more sense than the way Flixel does it?
I created that so I can implement the ability to share levels easily, but honestly I think it makes more sense than a string. Mostly because JSON.

a string is easier to load from an external file

im pretty sure something like ogmo editor works with flixel (http://www.ogmoeditor.com/)

Even if you're gonna roll your own engine you should stop and think why other engines do things a certain way

egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Supporter
Level 05
Game Developer
Response to The Flash 'Reg' Lounge 2013-06-22 21:16:27 Reply

At 6/22/13 08:39 PM, Glaiel-Gamer wrote: a string is easier to load from an external file

very true, but they could have allowed the "[]" in case of arrays, which is really likely.


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

BBS Signature
Glaiel-Gamer
Glaiel-Gamer
  • Member since: Dec. 28, 2004
  • Offline.
Forum Stats
Member
Level 28
Game Developer
Response to The Flash 'Reg' Lounge 2013-06-22 21:50:35 Reply

At 6/22/13 09:16 PM, egg82 wrote:
At 6/22/13 08:39 PM, Glaiel-Gamer wrote: a string is easier to load from an external file
very true, but they could have allowed the "[]" in case of arrays, which is really likely.

you could probably spend 2 minutes writing code to convert the array into a string

egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Supporter
Level 05
Game Developer
Response to The Flash 'Reg' Lounge 2013-06-22 21:51:19 Reply

At 6/22/13 09:50 PM, Glaiel-Gamer wrote: you could probably spend 2 minutes writing code to convert the array into a string

already did, that was the load function I displayed :P


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

BBS Signature
redligot2009
redligot2009
  • Member since: Jul. 9, 2011
  • Offline.
Forum Stats
Member
Level 03
Blank Slate
Response to The Flash 'Reg' Lounge 2013-06-23 02:45:57 Reply

Hmm... speaking of Flixel, I seem to get errors when I try to refer to the player class within the enemy class. For example,
public var player:Player;
^so I set that up, and then within the update function,
if(player.x < this.x)
^This gives me errors. I am still trying to get my head around it =P

nitokov
nitokov
  • Member since: May. 8, 2012
  • Offline.
Forum Stats
Member
Level 05
Programmer
Response to The Flash 'Reg' Lounge 2013-06-23 02:50:44 Reply

At 6/23/13 02:45 AM, redligot2009 wrote: Hmm... speaking of Flixel, I seem to get errors when I try to refer to the player class within the enemy class. For example,
public var player:Player;
^so I set that up, and then within the update function,
if(player.x < this.x)
^This gives me errors. I am still trying to get my head around it =P

do you know to use trace() ?


RangeError: Error #1125: The index 4 is out of range 4.

redligot2009
redligot2009
  • Member since: Jul. 9, 2011
  • Offline.
Forum Stats
Member
Level 03
Blank Slate
Response to The Flash 'Reg' Lounge 2013-06-23 02:59:19 Reply

At 6/23/13 02:50 AM, nitokov wrote:
do you know to use trace() ?

Yes. I do use trace...

FlyingColours
FlyingColours
  • Member since: Jul. 3, 2011
  • Offline.
Forum Stats
Member
Level 06
Programmer
Response to The Flash 'Reg' Lounge 2013-06-23 03:52:45 Reply

At 6/23/13 02:45 AM, redligot2009 wrote: Hmm... speaking of Flixel, I seem to get errors when I try to refer to the player class within the enemy class. For example,
public var player:Player;
^so I set that up, and then within the update function,
if(player.x < this.x)
^This gives me errors. I am still trying to get my head around it =P

Can give us the ID and name of the error? It's hard to tell what's wrong if we don't know what the error is.

Have you tried having the game engine pass the coordinates of the player to the enemy's AI? That would be better than having player as a property of enemy.

redligot2009
redligot2009
  • Member since: Jul. 9, 2011
  • Offline.
Forum Stats
Member
Level 03
Blank Slate
Response to The Flash 'Reg' Lounge 2013-06-23 10:52:09 Reply

At 6/23/13 03:52 AM, FlyingColours wrote: Can give us the ID and name of the error? It's hard to tell what's wrong if we don't know what the error is.

Have you tried having the game engine pass the coordinates of the player to the enemy's AI? That would be better than having player as a property of enemy.

Oh. I didn't think of that. Thanks buddy :)

redligot2009
redligot2009
  • Member since: Jul. 9, 2011
  • Offline.
Forum Stats
Member
Level 03
Blank Slate
Response to The Flash 'Reg' Lounge 2013-06-23 11:02:57 Reply

At 6/23/13 03:52 AM, FlyingColours wrote: Can give us the ID and name of the error? It's hard to tell what's wrong if we don't know what the error is.

Have you tried having the game engine pass the coordinates of the player to the enemy's AI? That would be better than having player as a property of enemy.

O-on second thoughts
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Enemynormal/update()
at org.flixel::FlxGroup/update()
at org.flixel::FlxGroup/update()
at PlayState/update()
at org.flixel::FlxGame/update()
at org.flixel::FlxGame/step()
at org.flixel::FlxGame/onEnterFrame()
this is the error I get =P

egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Supporter
Level 05
Game Developer
Response to The Flash 'Reg' Lounge 2013-06-23 11:12:57 Reply

At 6/23/13 03:52 AM, FlyingColours wrote: Have you tried having the game engine pass the coordinates of the player to the enemy's AI? That would be better than having player as a property of enemy.

This. There's no reason the players, enemies, or maps should know about each other. Engine classes are very useful ;)


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

BBS Signature
redligot2009
redligot2009
  • Member since: Jul. 9, 2011
  • Offline.
Forum Stats
Member
Level 03
Blank Slate
Response to The Flash 'Reg' Lounge 2013-06-23 12:04:16 Reply

Oh, PFF. I see where I went wrong. So I put it in a Registry class so I can access it anywhere, that didn't work because I didn't set the value for the public static var player:Player; I put within it, and so I made the Registry.player equal to the player within the Playstate.as :) lol

MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to The Flash 'Reg' Lounge 2013-06-23 12:21:07 Reply

At 6/23/13 12:04 PM, redligot2009 wrote: Oh, PFF. I see where I went wrong. So I put it in a Registry class so I can access it anywhere, that didn't work because I didn't set the value for the public static var player:Player; I put within it, and so I made the Registry.player equal to the player within the Playstate.as :) lol

You should still listen to egg's advice. Player, enemy, etc shouldn't be public. Just handle collisions and whatnot in the class where you instantiate both of them. Like if in Main you create a new player and all the enemies, then collisions go there. The Player class doesn't care about the Enemy class, so it shouldn't have any access to an Enemy.

Kevin
Kevin
  • Member since: Jan. 5, 2008
  • Offline.
Forum Stats
Member
Level 36
Melancholy
Response to The Flash 'Reg' Lounge 2013-06-23 21:14:07 Reply

Hey guys.


BBS Signature
MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to The Flash 'Reg' Lounge 2013-06-23 21:28:34 Reply

At 6/23/13 09:14 PM, Kevin wrote: Hey guys.

I like your mustache.

Rustygames
Rustygames
  • Member since: May. 7, 2005
  • Offline.
Forum Stats
Member
Level 19
Programmer
Response to The Flash 'Reg' Lounge 2013-06-24 04:03:51 Reply

At 6/23/13 09:28 PM, MSGhero wrote:
At 6/23/13 09:14 PM, Kevin wrote: Hey guys.
I like your mustache.

+1 for the moustache liking


- Matt, Rustyarcade.com

FlyingColours
FlyingColours
  • Member since: Jul. 3, 2011
  • Offline.
Forum Stats
Member
Level 06
Programmer
Response to The Flash 'Reg' Lounge 2013-06-24 05:25:00 Reply

I've never used XML with AS before.

I looked up the documentation, and was shocked to see that nearly none of the familiar XML DOM functions were there!

Upon further investigation, I realised that AS's XML retrieval code is waaaaay easier than JS.

Long live E4X!

FlyingColours
FlyingColours
  • Member since: Jul. 3, 2011
  • Offline.
Forum Stats
Member
Level 06
Programmer
Response to The Flash 'Reg' Lounge 2013-06-24 12:25:38 Reply

Just wondering, why doesn't FD generate an error after an unsuccessful typecast? I got two null object references in one night for that. :P

MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to The Flash 'Reg' Lounge 2013-06-24 14:45:04 Reply

At 6/24/13 12:25 PM, FlyingColours wrote: Just wondering, why doesn't FD generate an error after an unsuccessful typecast? I got two null object references in one night for that. :P

It checks at runtime unlike Java which checks before you've typed the semicolon. Something to do with strict typing maybe or Philippe is just lazy.

E4X is so good. I like it better than haxe's Fast class.

egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Supporter
Level 05
Game Developer
Response to The Flash 'Reg' Lounge 2013-06-24 14:56:03 Reply

At 6/24/13 12:25 PM, FlyingColours wrote: Just wondering, why doesn't FD generate an error after an unsuccessful typecast? I got two null object references in one night for that. :P

I think it depends on how you typecast.

int("2")
vs
("2" as int)
vs
if ("2" is int) {

(alright, so the third one isn't a type cast. Sue me)


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

BBS Signature
Glaiel-Gamer
Glaiel-Gamer
  • Member since: Dec. 28, 2004
  • Offline.
Forum Stats
Member
Level 28
Game Developer
Response to The Flash 'Reg' Lounge 2013-06-24 18:08:49 Reply

At 6/24/13 12:25 PM, FlyingColours wrote: Just wondering, why doesn't FD generate an error after an unsuccessful typecast? I got two null object references in one night for that. :P

because flash is a dynamic language so you can't tell if its an unsuccessful typecast until run time

FlyingColours
FlyingColours
  • Member since: Jul. 3, 2011
  • Offline.
Forum Stats
Member
Level 06
Programmer
Response to The Flash 'Reg' Lounge 2013-06-24 20:43:42 Reply

Thanks guys. By 'error' I meant 'runtime error'. I've been mostly using the as keyword for typecasts and haven't got any errors.

MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to The Flash 'Reg' Lounge 2013-06-24 20:48:31 Reply

I went to a Russian site that's giving my game most of its views now, and I translated the description...

Orig: Battle the creatures of the forest, help out the villagers, and discover a few secrets here and there.

Russian: Perform a job, buy yourself a new ammunition and fight dozens of monsters to become even stronger. After all, only your company can overcome the treacherous sorcerer and save a fairyland!

Where the hell did that last line come from? lol

Rustygames
Rustygames
  • Member since: May. 7, 2005
  • Offline.
Forum Stats
Member
Level 19
Programmer
Response to The Flash 'Reg' Lounge 2013-06-25 05:58:15 Reply

At 6/24/13 08:48 PM, MSGhero wrote: I went to a Russian site that's giving my game most of its views now, and I translated the description...

Orig: Battle the creatures of the forest, help out the villagers, and discover a few secrets here and there.

Russian: Perform a job, buy yourself a new ammunition and fight dozens of monsters to become even stronger. After all, only your company can overcome the treacherous sorcerer and save a fairyland!

Where the hell did that last line come from? lol

lol fairyland. Maybe the translation tool wasn't accurate?

On XML:
There are third party classes to make it look more like js or java. E4X is awesome in my opinion but it only works with certain browsers in js (which means you can't use it). I think JSON is what all the cool kids are using now anyway


- Matt, Rustyarcade.com