Recent posts by lan14n on Kongregate

Flag Post

Topic: Technical Support / I need to talk to an Admin

Hello,

I need to talk to an admin. I accidentally published a game that was supposed to be on the kong beta.

Really sorry! _

Edit: Whoops I think it’s fixed.

 
Flag Post

Topic: Game Programming / Catching Error Opening URL

woot! it worked thanks! :D

 
Flag Post

Topic: Game Programming / Catching Error Opening URL

I copy pasted it from a tutorial about running a youtube video using actionscript. I saw the tutorial before stumbling upon the actual api with some examples. I have no idea what its for.

I’ve change the code to what the api example was, but I still can’t catch the error :(


public function runYoutube(s:String) {
Security.allowDomain(“www.youtube.com”);
loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.INIT, onLoaderInit);
loader.addEventListener(IOErrorEvent.IO_ERROR, onURLError);
loader.load(new URLRequest(s));
}
private function onURLError(event:IOErrorEvent):void {
trace(“CATCH”,event);
var txtError:Window_Text = new Window_Text( "", 0, 128, Game_System.GAME_PIXEL_WIDTH, 32 );
txtError.setFormat(Window_Text.DOUBLECENTER);
txtError.text = “Error connecting to youtube:\n” + event + “\nPress next to continue…”;
addChild( txtError );
}

 
Flag Post

Topic: Game Programming / Catching Error Opening URL

I cant seem to make it work… I tried doing this.

		public function runYoutube(s:String) {
			loader = new Loader();
			var context:LoaderContext = new LoaderContext();
			context.checkPolicyFile = true;
			context.securityDomain = SecurityDomain.currentDomain;
			context.applicationDomain = ApplicationDomain.currentDomain;

			loader.contentLoaderInfo.addEventListener(Event.INIT, onLoaderInit);
			loader.addEventListener(IOErrorEvent.IO_ERROR, onURLError);
			Security.allowDomain("www.youtube.com");
		
			loader.load(new URLRequest(s));
			
		}
		
		private function onURLError(event:IOErrorEvent):void {
     		var txtError:Window_Text = new Window_Text( "", 0, 128, Game_System.GAME_PIXEL_WIDTH, 32 );
			txtError.setFormat(Window_Text.DOUBLECENTER);
			txtError.text = "Error connecting to youtube:\n" + event + "\nPress next to continue...";
			addChild( txtError );
		}
 
Flag Post

Topic: Game Programming / Catching Error Opening URL

Hey! [AS3 Flash]

So I’m trying to test what would happen if my internet connection went out. I can’t seem to catch “Error opening URL” error. I tried:

try {
     	loader.load(new URLRequest(s));
} catch (e:Error) {
	trace("CATCH",e);
}

It doesn’t work. I also tried IOErrorEvent and I can’t get that to work also.

Flash traces the error:

Error opening URL <error>
SecurityError: Error #2000: No active security context.

But I want to be able to display it in flash.

I was wondering how to do it.

thanks

 
Flag Post

Topic: Game Programming / Arrays and SharedObjects

oh that’s really neat. Ended up learning a lot on concat and slice. thanks so much!

(I also didn’t know you can put commas inside trace… that’s so cool)

 
Flag Post

Topic: Game Programming / Arrays and SharedObjects

@feartehstickman
No sorry i want a copy of the array and not a reference, so I think slice might work.

I just want to check now if I have to create a separate function for a 2d array where i will have to go through it and slice each element to form a copy of the array. I’m still looking for a different solution. Maybe an easier one…

 
Flag Post

Topic: Game Programming / Arrays and SharedObjects

I forgot to mention I’m trying to use it as a save file, so I don’t want the changes to persist. Modifying the array would also change the data inside the shared object if you just reference it right?

@ace_blue
So I guess I need 2 functions?

 
Flag Post

Topic: Game Programming / Arrays and SharedObjects

Hello,

Quick Questions:

- What is the best way to clone an array so I can store it in a SharedObject?

- Do I have to have a different function to clone a 2d array?

thanks!

 
Flag Post

Topic: Game Programming / I need help!

Make one using starcraft 2 map editor (or maybe even Warcraft 3). It’s way easier and you wont have to make your own art or game engine.

 
Flag Post

Topic: Game Programming / So yeah, beta testing time draws near!

Pretty Entertaining. I’m just terrible at this type of game though. The difficulty on level 3 seem to spike too high. I beat level 1 and level 2 boss no problem. Level 3 trash is just hard. I cant seem to kill anything anymore and those mushrooms just run all over the screen.

I liked it though. I got entertained during my little break.

 
Flag Post

Topic: Game Programming / Custom Events

@ace_blue

thanks. I will try that out. That really helps.

 
Flag Post

Topic: Game Programming / Custom Events

I am thinking of implementing a “help popup” using custom events. I haven’t used it before and I was wondering what people think about it.

I was thinking of having a custom event trigger once the player reaches a certain area. The function called by the listener will show a help pop up screen and would then remove the listener afterward.

e.g. The player enters a room with a treasure chest. An event dispatch will occur, and will call a function that will show a help file of a treasure chest. The function will then remove the listener.

My question is, how is the performance of a custom event compare versus a single “if” statement. The “if” statement stays forever and gets checked every time the certain event happens, while the listener gets deleted after the event is triggered. The bad side is I will have a lot of listeners.

Also, Is this a good idea to implement custom events for a help pop up screen.

If I misunderstood what custom events does, I would be happy if someone explained it to me. I haven’t really played around with it. Thanks.

 
Flag Post

Topic: Game Programming / Show us a screenshot of what you're working on!

This thread is neat. I’m posting mine too:

 
Flag Post

Topic: Game Programming / When making a RPG game what is the first thing to program?

RPGs are easier to code in AS3. It will also make it more organized.

Basically making an rpg is like making ~4 games and merging it into one. You separate them on each of their own scene and call them when needed. What you will have to do are:

- Exploring scene (top down, or platformer depending on your design)
- Battle scene (turn based or it could be part of your exploring scene)
- Menu scene (Potions and magic)
- Town scene (Shops and inns)

On top of that you have to program the hero, enemy, spells and item datas. They needed to be shared with all of the scenes. For the first thing to program, I recommend doing the exploring scene first. You can try and move around with your hero and see how it feels.

 
Flag Post

Topic: Game Programming / How to do A RPG Turn Based Flash AS3

Well, It’s different based on whatever style you do it with. Here is how I did it:

Steps:
0.) Initialize the game – Here is where you arrange and display the graphics. This is also where you initialize the turn speeds, depending on your rules. You can have a “preemptive strike” or “back attack” based on the conditions.

1.) Check conditions – Check if everybody in the party, or every enemy is still alive. This will trigger the victory/defeat functions. You can also run turn conditions such as status effects here.

2.) Calculate the turn – This is where you check whos turn is it. Based on the turn you will either run player commands (3a), or run enemy ai (3b).

3a.) Show Command Menu – This is where you will show the menu for the player. Depending on what the player will click it should end up passing a SPELL.

3b.) Enemy AI – You can randomize the enemy actions here depending on your parameters. It will eventually pass a SPELL.

4.) Run the Spell Effect – This is where you will display the spell effect.

5.) Run the Spell Damage – This is where you calculate the damage output from the spell. You can then show the damage done by the spell. I prefer to separate the spell effect from the damage calculation because usually the effects get in the way of the text display. You can combine them however you want.

6.) Repeat Check Conditions (Step 1)

 
Flag Post

Topic: Game Programming / plot dialogs

It’s actually easier to put the text and the image together to avoid confusion. I have the text, texbox, portraits, and backgrounds in one movieclip frame. On top of the text is a movielip that covers it and starts playing and uncovers the text one letter at a time. I can reuse the component by having the portrait/background frame be the same as the previous one while just changing the text box in a different frame.

Or… hmmm… maybe i could try what you said and do code for the dialogues instead. Maybe I could dynamically resize the textbox too.

 
Flag Post

Topic: Game Programming / plot dialogs

For me, I cheat and I use movieclips. I have a button, that when pressed, goes to the next frame of the movieclip. It also checks if it is the last frame and removes it.

I’m thinking of using code, but I think it’s too much work when you can just freely arrange movieclips to your liking.

I would like to hear how others do it. Maybe there is an easier way.

 
Flag Post

Topic: Game Programming / What is the best way to handle Saves?

Thanks! I drew it on paper then scanned and inked on manga studio.

 
Flag Post

Topic: Game Programming / What is the best way to handle Saves?

I think i’m pretty decent when it comes to art. Takes a really long time to do a piece though. I’m really slow. Anyway here is my latest work: (I’m really proud of it!)

Sorry for the thread derail. I should probably stop replying.

 
Flag Post

Topic: Game Programming / What is the best way to handle Saves?

Yeah I actually didn’t know about that until recently. I’m actually considering collaborating and getting hired as an artist once my current project finishes.

 
Flag Post

Topic: Game Programming / Moving and Shooting at the same time

Well for one, you can easily change keyboard bindings, or map out a different set of control keys on the options menu. (e.g. Arrow keys and WASD keys)

 
Flag Post

Topic: Game Programming / What is the best way to handle Saves?

@saybox
Good point. After looking around for a bit, I don’t think it’s worth it to flush a dummy so to ask for space. I guess ill just forget about it.

About the art: I am currently doing everything myself and I am doing programming at the same time. I wanted to finish the game in about 2 months, but at this current rate it’s probably not going to happen. I’m pretty bad at doing effects and backgrounds. I’m trying my best though.

 
Flag Post

Topic: Game Programming / Best way to make a huge tilemap?

I never used this, you might want to take a look at:

http://www.8bitrocket.com/2008/9/27/Tutorial-N-way-tile-based-blit-fine-scrolling-in-AS3-part-1/

 
Flag Post

Topic: Game Programming / What is the best way to handle Saves?

Oh i mean just the allow thing for storage options. Like I think last stand union city did.

Anyway, I’m actually lurking around collab. I’m trying to see if i can find a cheap artist. heh.